mirror of https://github.com/fltk/fltk
Replace Fl_Window_Driver::is_a_rescale() by Fl_Window::is_a_rescale()
so it can be called by any user code.
This commit is contained in:
parent
ccb06e18b7
commit
7f7e0e4ea1
|
@ -541,6 +541,7 @@ public:
|
||||||
void shape(const Fl_Image& b) ;
|
void shape(const Fl_Image& b) ;
|
||||||
const Fl_Image *shape();
|
const Fl_Image *shape();
|
||||||
int screen_num();
|
int screen_num();
|
||||||
|
static bool is_a_rescale();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,7 +54,7 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
|
||||||
int oh = h();
|
int oh = h();
|
||||||
Fl_Window::resize(X,Y,W,H);
|
Fl_Window::resize(X,Y,W,H);
|
||||||
Fl_X *myi = Fl_X::i(this);
|
Fl_X *myi = Fl_X::i(this);
|
||||||
if (myi && Fl_Window_Driver::driver(this)->other_xid && (ow < w() || oh < h() || Fl_Window_Driver::is_a_rescale()))
|
if (myi && Fl_Window_Driver::driver(this)->other_xid && (ow < w() || oh < h() || is_a_rescale()))
|
||||||
Fl_Window_Driver::driver(this)->destroy_double_buffer();
|
Fl_Window_Driver::driver(this)->destroy_double_buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
|
||||||
// printf("Fl_Gl_Window::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
|
// printf("Fl_Gl_Window::resize(X=%d, Y=%d, W=%d, H=%d)\n", X, Y, W, H);
|
||||||
// printf("current: x()=%d, y()=%d, w()=%d, h()=%d\n", x(), y(), w(), h());
|
// printf("current: x()=%d, y()=%d, w()=%d, h()=%d\n", x(), y(), w(), h());
|
||||||
|
|
||||||
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || Fl_Window_Driver::is_a_rescale());
|
int is_a_resize = (W != Fl_Widget::w() || H != Fl_Widget::h() || is_a_rescale());
|
||||||
if (is_a_resize) valid(0);
|
if (is_a_resize) valid(0);
|
||||||
pGlWindowDriver->resize(is_a_resize, W, H);
|
pGlWindowDriver->resize(is_a_resize, W, H);
|
||||||
Fl_Window::resize(X,Y,W,H);
|
Fl_Window::resize(X,Y,W,H);
|
||||||
|
|
|
@ -708,7 +708,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
|
||||||
|
|
||||||
Fl_Widget::resize(X, Y, W, H); // make new xywh values visible for children
|
Fl_Widget::resize(X, Y, W, H); // make new xywh values visible for children
|
||||||
|
|
||||||
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window_Driver::is_a_rescale()) {
|
if ((!resizable() || (dw==0 && dh==0 )) && !Fl_Window::is_a_rescale()) {
|
||||||
|
|
||||||
if (!as_window()) {
|
if (!as_window()) {
|
||||||
Fl_Widget*const* a = array();
|
Fl_Widget*const* a = array();
|
||||||
|
|
|
@ -689,6 +689,9 @@ void Fl_Window::shape(const Fl_Image& img) {pWindowDriver->shape(&img);}
|
||||||
/** Returns the image controlling the window shape or NULL */
|
/** Returns the image controlling the window shape or NULL */
|
||||||
const Fl_Image* Fl_Window::shape() {return pWindowDriver->shape();}
|
const Fl_Image* Fl_Window::shape() {return pWindowDriver->shape();}
|
||||||
|
|
||||||
|
/** Returns true when a window is being rescaled */
|
||||||
|
bool Fl_Window::is_a_rescale() {return Fl_Window_Driver::is_a_rescale_;}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|
|
@ -69,7 +69,6 @@ public:
|
||||||
Fl_Offscreen other_xid; // offscreen bitmap (overlay and double-buffered windows)
|
Fl_Offscreen other_xid; // offscreen bitmap (overlay and double-buffered windows)
|
||||||
virtual int screen_num();
|
virtual int screen_num();
|
||||||
virtual void screen_num(int) {}
|
virtual void screen_num(int) {}
|
||||||
static bool is_a_rescale() {return is_a_rescale_;};
|
|
||||||
|
|
||||||
|
|
||||||
// --- frequently used accessors to public window data
|
// --- frequently used accessors to public window data
|
||||||
|
|
|
@ -3296,7 +3296,7 @@ void Fl_Cocoa_Window_Driver::resize(int X, int Y, int W, int H) {
|
||||||
} else {
|
} else {
|
||||||
NSPoint pt = FLTKtoCocoa(pWindow, X, Y, H);
|
NSPoint pt = FLTKtoCocoa(pWindow, X, Y, H);
|
||||||
FLWindow *xid = fl_xid(pWindow);
|
FLWindow *xid = fl_xid(pWindow);
|
||||||
if (W != w() || H != h() || is_a_rescale()) {
|
if (W != w() || H != h() || Fl_Window::is_a_rescale()) {
|
||||||
NSRect r;
|
NSRect r;
|
||||||
float s = Fl::screen_driver()->scale(screen_num());
|
float s = Fl::screen_driver()->scale(screen_num());
|
||||||
int bt = get_window_frame_sizes(pWindow);
|
int bt = get_window_frame_sizes(pWindow);
|
||||||
|
|
|
@ -1834,11 +1834,11 @@ int Fl_WinAPI_Window_Driver::fake_X_wm(int &X, int &Y, int &bt, int &bx, int &by
|
||||||
void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) {
|
void Fl_WinAPI_Window_Driver::resize(int X, int Y, int W, int H) {
|
||||||
//fprintf(stderr, "resize w()=%d W=%d h()=%d H=%d\n",pWindow->w(), W,pWindow->h(), H);
|
//fprintf(stderr, "resize w()=%d W=%d h()=%d H=%d\n",pWindow->w(), W,pWindow->h(), H);
|
||||||
UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
UINT flags = SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
|
||||||
int is_a_resize = (W != w() || H != h() || is_a_rescale());
|
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
|
||||||
int resize_from_program = (pWindow != resize_bug_fix);
|
int resize_from_program = (pWindow != resize_bug_fix);
|
||||||
if (!resize_from_program)
|
if (!resize_from_program)
|
||||||
resize_bug_fix = 0;
|
resize_bug_fix = 0;
|
||||||
if (X != x() || Y != y() || is_a_rescale()) {
|
if (X != x() || Y != y() || Fl_Window::is_a_rescale()) {
|
||||||
force_position(1);
|
force_position(1);
|
||||||
} else {
|
} else {
|
||||||
if (!is_a_resize)
|
if (!is_a_resize)
|
||||||
|
|
|
@ -2252,8 +2252,8 @@ int fl_handle(const XEvent& thisevent)
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) {
|
void Fl_X11_Window_Driver::resize(int X,int Y,int W,int H) {
|
||||||
int is_a_move = (X != x() || Y != y() || is_a_rescale());
|
int is_a_move = (X != x() || Y != y() || Fl_Window::is_a_rescale());
|
||||||
int is_a_resize = (W != w() || H != h() || is_a_rescale());
|
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
|
||||||
int resize_from_program = (pWindow != resize_bug_fix);
|
int resize_from_program = (pWindow != resize_bug_fix);
|
||||||
if (!resize_from_program) resize_bug_fix = 0;
|
if (!resize_from_program) resize_bug_fix = 0;
|
||||||
if (is_a_move && resize_from_program) force_position(1);
|
if (is_a_move && resize_from_program) force_position(1);
|
||||||
|
|
|
@ -124,8 +124,8 @@ void Fl_Android_Window_Driver::make_current()
|
||||||
|
|
||||||
void Fl_Android_Window_Driver::resize(int X,int Y,int W,int H)
|
void Fl_Android_Window_Driver::resize(int X,int Y,int W,int H)
|
||||||
{
|
{
|
||||||
int is_a_resize = (W != w() || H != h() || is_a_rescale());
|
int is_a_resize = (W != w() || H != h() || Fl_Window::is_a_rescale());
|
||||||
if (X != x() || Y != y() || is_a_rescale()) {
|
if (X != x() || Y != y() || Fl_Window::is_a_rescale()) {
|
||||||
force_position(1);
|
force_position(1);
|
||||||
} else {
|
} else {
|
||||||
if (!is_a_resize)
|
if (!is_a_resize)
|
||||||
|
|
Loading…
Reference in New Issue