Thanks for the answers! I am not sure what to do with this source tough. As it is, it has the following errors:
*main.cpp(99) : error C2653: 'Fl_Dialog_Window' : is not a class or namespace name main.cpp(102) : error C2065: 'm_x' : undeclared identifier main.cpp(102) : error C2065: 'm_y' : undeclared identifier main.cpp(113) : error C3861: 'resize': identifier not found main.cpp(118) : error C2065: 'm_y' : undeclared identifier main.cpp(122) : error C2065: 'm_w' : undeclared identifier main.cpp(122) : error C2065: 'm_w' : undeclared identifier main.cpp(123) : error C2065: 'm_h' : undeclared identifier main.cpp(123) : error C2065: 'm_h' : undeclared identifier main.cpp(125) : error C2065: 'm_y' : undeclared identifier main.cpp(126) : error C2065: 'm_x' : undeclared identifier main.cpp(126) : error C2065: 'm_x' : undeclared identifier main.cpp(127) : error C2065: 'm_h' : undeclared identifier main.cpp(129) : error C2065: 'm_x' : undeclared identifier main.cpp(129) : error C2065: 'm_y' : undeclared identifier main.cpp(129) : error C2065: 'm_w' : undeclared identifier main.cpp(129) : error C2065: 'm_h' : undeclared identifier main.cpp(129) : error C3861: 'resize': identifier not found* I guess the m_'s should be inicialized in the Vollbild function, but I am not sure with what value. But whats with the resize() and that namespace? On 5 April 2011 22:06, Edzard Egberts <ed...@tantec.de> wrote: > imacart...@gmail.com schrieb: > > On 05/04/11 18:08, Zoltán Lengyel wrote: > > > > I'd post an example, but can't find it - someone may have something > > lying around? > > Yes, but it's a little oversized, not all english and there are some > linux parts missing (returning zero). But it takes account of multi > screens and prevents caption from vanishing (so the window cannot be > moved any more). I think, it points to the right direction... > > > > //----------------------------------------------------------------------------- > #include <FL/Fl.H> > #include <FL/x.H> > #include <FL/Fl_Window.H> > > #ifdef WIN32 > #include <windows.h> > #else > #include <X11/Xlib.h> > #endif > > //----------------------------------------------------------------------------- > int Caption_Height() > { // Bildschirmgröße in y-Richtung > #ifdef WIN32 > return GetSystemMetrics(SM_CYCAPTION); > #else > return 0; > #endif > } > > > //----------------------------------------------------------------------------- > int x_Border() > { // Bildschirmgröße in y-Richtung > #ifdef WIN32 > return GetSystemMetrics(SM_CXBORDER); > #else > return 0; > #endif > } > > > //----------------------------------------------------------------------------- > int y_Border() > { // Bildschirmgröße in y-Richtung > #ifdef WIN32 > return GetSystemMetrics(SM_CYBORDER); > #else > return 0; > #endif > } > > > //---------------------------------------------------------------------------- > int Screen_Index(int px, int py) > { // Liefert den Screen von Screen 0 bis Screen n zur gegebenen > Position > // oder -1, wenn Koordinate nicht sichtbar > if (Fl::screen_count() > 1) > { // Mehrere Desks aktiv, aufaddieren > for (int i= 0; i< Fl::screen_count(); ++i) > { > int x, y, w, h; > Fl::screen_xywh(x, y, w, h, i); > if ((px >= x && px < x+w) && (py >= y && py < py > +w)) return i; > } > return -1; // Koordinate nicht sichtbar > } > else > { > if ((px >= 0 && px < Fl::w()) && (py >= 0 && py < Fl::h())) > return 0; > else return -1; > } > } > > > //---------------------------------------------------------------------------- > void Screen_Multi(int Index, int& sx, int& sy, int& sw, int& sh) > { // Liefert Koordinaten des Desktops von Index > if (Fl::screen_count() > 1) Fl::screen_xywh(sx, sy, sw, sh, > Index); > // Tatsächlich mehrere Desks aktiv > else > { > #ifdef WIN32 > sx= 0; > sy= 0; > sw= GetSystemMetrics(SM_CXSCREEN); > sh= GetSystemMetrics(SM_CYSCREEN); > #endif > } > } > > //----------------------------------------------------------------------------- > int Size_Screen_X() > { // Bildschirmgröße in x-Richtung > #ifdef WIN32 > return GetSystemMetrics(SM_CXSCREEN); > #else > return XDisplayWidth(fl_display, 0); > #endif > } > > > //----------------------------------------------------------------------------- > int Size_Screen_Y() > { // Bildschirmgröße in y-Richtung > #ifdef WIN32 > return GetSystemMetrics(SM_CYSCREEN); > #else > return XDisplayHeight(fl_display, 0); > #endif > } > > //----------------------------------------------------------------------------- > bool m_Fullscreen= false; // Member > > void Fl_Dialog_Window::Vollbild(bool An) > { > int sx= 0, sy= 0, sw, sh; > int i= Screen_Index(m_x, m_y); > if (i) Screen_Multi(i, sx, sy, sw, sh); > else // if (i == Desktop Null) > { > sw= Size_Screen_X(); > sh= Size_Screen_Y(); > } > > if (An) > { // Vollbild-Modus einschalten > m_Fullscreen= true; > resize(sx, sy, sw, sh); > } > else > { // Fullscreen-Modus beenden > m_Fullscreen= false; > if (m_y== 0) > { // Titelleiste einblenden, wenn nicht sichtbar > int bx= x_Border(); > int by= y_Border(); > if (m_w > Fl::w() - 2* bx) m_w= Fl::w() - 2 *bx; > if (m_h > Fl::h() - 2* by) m_h= Fl::h() - 2 *by; > int ch= Caption_Height() + by; > m_y+= ch; > if (m_x < bx) m_x= bx; > m_h-= ch + by; > } > resize(m_x, m_y, m_w, m_h); > } > } > > _______________________________________________ > fltk mailing list > fltk@easysw.com > http://lists.easysw.com/mailman/listinfo/fltk > _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk