diff --git a/comp/src/gb.settings/.component b/comp/src/gb.settings/.component index b0e4387a4..c545c3352 100644 --- a/comp/src/gb.settings/.component +++ b/comp/src/gb.settings/.component @@ -1,4 +1,5 @@ [Component] Key=gb.settings +Version=2.99.0 Authors=BenoƮt Minisini diff --git a/comp/src/gb.settings/.icon.png b/comp/src/gb.settings/.icon.png index f66c374b9..8748600ba 100644 Binary files a/comp/src/gb.settings/.icon.png and b/comp/src/gb.settings/.icon.png differ diff --git a/comp/src/gb.settings/.src/Settings.class b/comp/src/gb.settings/.src/Settings.class index 5ae2d9703..25fdbc27d 100644 --- a/comp/src/gb.settings/.src/Settings.class +++ b/comp/src/gb.settings/.src/Settings.class @@ -4,6 +4,8 @@ Export Create Static Class Window +Class Desktop +Class Screens Static Property Read Path As String @@ -303,26 +305,39 @@ End Public Sub ReadWindow(hWindow As Window, sKey As String) - Dim sPos As String Dim aPos As Integer[] + Dim X, Y, W, H, S As Integer + Dim sPos As String aPos = Me[sKey &/ "Geometry"] If Not aPos Or If aPos.Count < 2 Then Return - aPos[0] = Max(0, aPos[0]) - aPos[1] = Max(0, aPos[1]) - If aPos.Count = 4 Then - aPos[2] = Max(32, aPos[2]) - aPos[3] = Max(32, aPos[3]) + X = aPos[0] + Y = aPos[1] + If aPos.Count >= 2 Then + W = aPos[2] + H = aPos[3] + If aPos.Count >= 5 Then + S = aPos[4] + If S >= Screens.Count Then S = 0 + Endif Endif - 'cPos = Split(sPos, ",") - If aPos.Count = 4 And hWindow.Resizable Then + X += Screens[S].AvailableX + Y += Screens[S].AvailableY + + ' If Object.Type(hWindow) = "FHelpBrowser" Then + ' Print "ReadWindow: "; X;; Y; " / "; S;; Screens[S].AvailableX;; Screens[S].AvailableY + ' Endif + + If aPos.Count >= 4 And hWindow.Resizable Then + W = Max(32, W) + H = Max(32, H) If hWindow.Modal Then - hWindow.Resize(aPos[2], aPos[3]) + hWindow.Resize(W, H) hWindow.Center Else - hWindow.Move(Max(0, aPos[0]), Max(0, aPos[1]), aPos[2], aPos[3]) + hWindow.Move(X, Y, W, H) Endif Else If Not hWindow.Modal Then hWindow.Move(aPos[0], aPos[1]) @@ -333,7 +348,19 @@ End Public Sub WriteWindow(hWindow As Window, sKey As String) - Me[sKey &/ "Geometry"] = [hWindow.X, hWindow.Y, hWindow.Width, hWindow.Height] + Dim X, Y, W, H, S As Integer + + ' If Object.Type(hWindow) = "FHelpBrowser" Then + ' Print "WriteWindow: "; hWindow.X;; hWindow.Y; " / "; S;; Screens[S].AvailableX;; Screens[S].AvailableY + ' Endif + + S = hWindow.Screen + X = hWindow.X - Screens[S].AvailableX + Y = hWindow.Y - Screens[S].AvailableY + W = hWindow.Width + H = hWindow.Height + + Me[sKey &/ "Geometry"] = [X, Y, W, H, S] End diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index 09136dd51..bb77e2bde 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -495,6 +495,42 @@ void CWIDGET_resize_cached(void *_object, int w, int h) } +void CWIDGET_move_resize(void *_object, int x, int y, int w, int h) +{ + QWidget *wid = get_widget(THIS); + + if (wid) + { + if (w < 0) + w = wid->width(); + + if (h < 0) + h = wid->height(); + + if (x == wid->x() && y == wid->y() && w == wid->width() && h == wid->height()) + return; + + if (GB.Is(THIS, CLASS_Window)) + { + wid->move(x, y); + wid->resize(qMax(0, w), qMax(0, h)); + } + else + wid->setGeometry(x, y, qMax(0, w), qMax(0, h)); + } + + if (GB.Is(THIS, CLASS_Window)) + { + ((CWINDOW *)_object)->x = x; + ((CWINDOW *)_object)->y = y; + ((CWINDOW *)_object)->w = w; + ((CWINDOW *)_object)->h = h; + } + + CWIDGET_after_geometry_change(THIS, true); +} + +#if 0 void CWIDGET_move_resize(void *_object, int x, int y, int w, int h) { QWidget *wid = get_widget(THIS); @@ -530,6 +566,7 @@ void CWIDGET_move_resize(void *_object, int x, int y, int w, int h) CWIDGET_after_geometry_change(THIS, true); } +#endif void CWIDGET_move_resize_cached(void *_object, int x, int y, int w, int h) { @@ -1992,20 +2029,9 @@ static void handle_focus_change() void CWIDGET_handle_focus(CWIDGET *control, bool on) { - static int cpt = 0; - if (on == (CWIDGET_active_control == control)) return; - //qDebug("CWIDGET_handle_focus: %s %d", control->name, on); - - /*if (!qstrcmp(control->name, "Form1") && on) - { - cpt++; - if (cpt == 2) - BREAKPOINT(); - }*/ - CWIDGET_active_control = on ? control : NULL; handle_focus_change(); }