center dialogs that have no location
svn: r3183
This commit is contained in:
parent
c127c5f422
commit
c5c852b88e
|
@ -208,7 +208,7 @@
|
||||||
(class100*/kw basic-top-level-window% ()
|
(class100*/kw basic-top-level-window% ()
|
||||||
[(label [parent #f] [width #f] [height #f] [x #f] [y #f] [style null])
|
[(label [parent #f] [width #f] [height #f] [x #f] [y #f] [style null])
|
||||||
top-level-window%-keywords]
|
top-level-window%-keywords]
|
||||||
(inherit on-traverse-char on-system-menu-char)
|
(inherit on-traverse-char on-system-menu-char center)
|
||||||
(sequence
|
(sequence
|
||||||
(let ([cwho '(constructor dialog)])
|
(let ([cwho '(constructor dialog)])
|
||||||
(check-label-string cwho label)
|
(check-label-string cwho label)
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
(super-init (lambda (finish)
|
(super-init (lambda (finish)
|
||||||
(set! wx (finish (make-object wx-dialog% this this
|
(set! wx (finish (make-object wx-dialog% this this
|
||||||
(and parent (mred->wx parent)) label #t
|
(and parent (mred->wx parent)) label #t
|
||||||
(or x -1) (or y -1) (or width 0) (or height 0)
|
(or x -11111) (or y -11111) (or width 0) (or height 0)
|
||||||
style)
|
style)
|
||||||
#f))
|
#f))
|
||||||
wx)
|
wx)
|
||||||
|
|
|
@ -337,6 +337,8 @@
|
||||||
(force-redraw))
|
(force-redraw))
|
||||||
(when (and on? use-default-position?)
|
(when (and on? use-default-position?)
|
||||||
(set! use-default-position? #f)
|
(set! use-default-position? #f)
|
||||||
|
(if dlg?
|
||||||
|
(center 'both)
|
||||||
(let*-values ([(w) (get-width)]
|
(let*-values ([(w) (get-width)]
|
||||||
[(h) (get-height)]
|
[(h) (get-height)]
|
||||||
[(sw sh) (get-display-size)]
|
[(sw sh) (get-display-size)]
|
||||||
|
@ -348,7 +350,7 @@
|
||||||
(values (max 0 (- sh h 20)) #t))])
|
(values (max 0 (- sh h 20)) #t))])
|
||||||
(move x y)
|
(move x y)
|
||||||
(set! top-x (if x-reset? init-top-x (+ top-x 10)))
|
(set! top-x (if x-reset? init-top-x (+ top-x 10)))
|
||||||
(set! top-y (if y-reset? init-top-y (+ top-y 20)))))
|
(set! top-y (if y-reset? init-top-y (+ top-y 20))))))
|
||||||
(if on?
|
(if on?
|
||||||
(hash-table-put! top-level-windows this #t)
|
(hash-table-put! top-level-windows this #t)
|
||||||
(hash-table-remove! top-level-windows this))
|
(hash-table-remove! top-level-windows this))
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
Version 301.16
|
||||||
|
When no location is given for a dialog%, it is centered when
|
||||||
|
shown
|
||||||
|
|
||||||
Version 301.8
|
Version 301.8
|
||||||
Added 'no-sheet dialog% style
|
Added 'no-sheet dialog% style
|
||||||
|
|
|
@ -61,7 +61,7 @@ void wxbDialogBox::Centre(int direction)
|
||||||
int width, height, x, y;
|
int width, height, x, y;
|
||||||
wxFrame *frame;
|
wxFrame *frame;
|
||||||
|
|
||||||
if (direction & wxCENTER_FRAME) {
|
if (1 /* direction & wxCENTER_FRAME */) {
|
||||||
frame = (wxFrame*)GetParent();
|
frame = (wxFrame*)GetParent();
|
||||||
if (frame) {
|
if (frame) {
|
||||||
frame->GetPosition(&x_offset, &y_offset);
|
frame->GetPosition(&x_offset, &y_offset);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user