Skip to content

Commit

Permalink
Updated Fl::x(), ::y(), ::w(), and ::h() to account for WIN32 trays.
Browse files Browse the repository at this point in the history
Updated menu code to account for tray locations.


git-svn-id: file:///fltk/svn/fltk/trunk@307 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Feb 19, 1999
1 parent d91bdb6 commit 1a135b0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 10 deletions.
9 changes: 7 additions & 2 deletions FL/Fl.H
@@ -1,5 +1,5 @@
//
// "$Id: Fl.H,v 1.6 1999/02/16 21:59:34 mike Exp $"
// "$Id: Fl.H,v 1.7 1999/02/19 15:34:07 mike Exp $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -145,8 +145,13 @@ public:
static FL_EXPORT void paste(Fl_Widget &receiver);

// screen size:
#if defined(WIN32) || defined(__EMX__)
static FL_EXPORT int x();
static FL_EXPORT int y();
#else
static FL_EXPORT int x() {return 0;}
static FL_EXPORT int y() {return 0;}
#endif /* WIN32 || __EMX__ */
static FL_EXPORT int w();
static FL_EXPORT int h();

Expand Down Expand Up @@ -199,5 +204,5 @@ public:
#endif

//
// End of "$Id: Fl.H,v 1.6 1999/02/16 21:59:34 mike Exp $".
// End of "$Id: Fl.H,v 1.7 1999/02/19 15:34:07 mike Exp $".
//
8 changes: 4 additions & 4 deletions src/Fl_Menu.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu.cxx,v 1.15 1999/01/29 07:52:21 bill Exp $"
// "$Id: Fl_Menu.cxx,v 1.16 1999/02/19 15:34:08 mike Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -272,9 +272,9 @@ void menuwindow::position(int X, int Y) {
// scroll so item i is visible on screen
void menuwindow::autoscroll(int i) {
int Y = y()+Fl::box_dx(box())+2+i*itemheight;
if (Y <= 0) Y = -Y+10;
if (Y <= Fl::y()) Y = Fl::y()-Y+10;
else {
Y = Y+itemheight-Fl::h();
Y = Y+itemheight-Fl::h()-Fl::y();
if (Y < 0) return;
Y = -Y-10;
}
Expand Down Expand Up @@ -710,5 +710,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}

//
// End of "$Id: Fl_Menu.cxx,v 1.15 1999/01/29 07:52:21 bill Exp $".
// End of "$Id: Fl_Menu.cxx,v 1.16 1999/02/19 15:34:08 mike Exp $".
//
36 changes: 32 additions & 4 deletions src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_win32.cxx,v 1.28 1999/02/16 21:59:51 mike Exp $"
// "$Id: Fl_win32.cxx,v 1.29 1999/02/19 15:34:09 mike Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -156,9 +156,37 @@ double fl_wait(int timeout_flag, double time) {

////////////////////////////////////////////////////////////////

int Fl::h() {return GetSystemMetrics(SM_CYSCREEN);}
int Fl::x()
{
RECT r;

SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
return r.left;
}

int Fl::y()
{
RECT r;

SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
return r.top;
}

int Fl::w() {return GetSystemMetrics(SM_CXSCREEN);}
int Fl::h()
{
RECT r;

SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
return r.bottom - r.top;
}

int Fl::w()
{
RECT r;

SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
return r.right - r.left;
}

void Fl::get_mouse(int &x, int &y) {
POINT p;
Expand Down Expand Up @@ -867,5 +895,5 @@ void Fl_Window::make_current() {
}

//
// End of "$Id: Fl_win32.cxx,v 1.28 1999/02/16 21:59:51 mike Exp $".
// End of "$Id: Fl_win32.cxx,v 1.29 1999/02/19 15:34:09 mike Exp $".
//

0 comments on commit 1a135b0

Please sign in to comment.