[DEVELOPMENT ENVIRONMENT]
* BUG: Signature and automatic completion are visible again. Moreover, they are not hidden anymore when the editor is resized, but this may change in the future. [GB.FORM] * BUG: The DatePicker works again. [GB.FORM.MDI] * BUG: The Enabled state of toolbar buttons is preserved now when configuring the toolbar. [GB.GTK] * NEW: Container have now a BeforeArrange event, that is raised just before the container is arranged ; the Arrange event being raised just after. [GB.QT] * NEW: Container have now a BeforeArrange event, that is raised just before the container is arranged ; the Arrange event being raised just after. [GB.QT4] * NEW: Container have now a BeforeArrange event, that is raised just before the container is arranged ; the Arrange event being raised just after. git-svn-id: svn://localhost/gambas/trunk@1799 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
fa7f7029c4
commit
c650b91dcd
@ -1,5 +1,5 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 2.99.0 (r1759)
|
||||
# Compiled with Gambas 2.99.0 (r1796)
|
||||
Title=Gambas 3
|
||||
Startup=Project
|
||||
StackTrace=1
|
||||
|
@ -64,12 +64,12 @@ Public Sub _new(hComp As CComponent, bDark As Boolean)
|
||||
panName = New HPanel(panVBox) As "panComp"
|
||||
|
||||
hVBox = New VBox(panName)
|
||||
hVBox.W = 24
|
||||
hVBox.W = Desktop.Scale * 4
|
||||
|
||||
picCheck = New PictureBox(hVBox) As "picCheck"
|
||||
picCheck.Alignment = Align.Center
|
||||
picCheck.Picture = Picture["img/16/unchecked.png"]
|
||||
picCheck.Resize(24, 24)
|
||||
picCheck.Resize(Desktop.Scale * 4, Desktop.Scale * 4)
|
||||
|
||||
txtName = New TextLabel(panName)
|
||||
txtName.Padding = 2
|
||||
@ -105,8 +105,6 @@ Public Sub _new(hComp As CComponent, bDark As Boolean)
|
||||
$iMaxWidth = W
|
||||
Endif
|
||||
|
||||
'txtInfo.Text = $sInfo
|
||||
|
||||
Expanded_Write(False)
|
||||
$bAnim = True
|
||||
|
||||
@ -250,13 +248,13 @@ Private Sub Expanded_Write(Value As Boolean)
|
||||
Wend
|
||||
Object.Unlock($hWatch)
|
||||
Endif
|
||||
|
||||
Me.Height = H
|
||||
|
||||
End
|
||||
|
||||
Public Sub Watcher_Arrange()
|
||||
|
||||
Object.Lock(Me)
|
||||
txtDesc.Adjust
|
||||
If panName.H <> txtDesc.H Then
|
||||
panName.H = txtDesc.H
|
||||
@ -264,6 +262,5 @@ Public Sub Watcher_Arrange()
|
||||
Expanded_Write(panInfo.Visible)
|
||||
$bAnim = True
|
||||
Endif
|
||||
Object.Unlock(Me)
|
||||
|
||||
End
|
||||
|
@ -318,14 +318,18 @@ Public Function IsModified() As Boolean
|
||||
|
||||
End
|
||||
|
||||
Public Sub Form_Resize()
|
||||
|
||||
'HideCompletion
|
||||
'HideSignature
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Form_Arrange()
|
||||
|
||||
Dim iToolbarOffset As Integer
|
||||
|
||||
HideCompletion
|
||||
HideSignature
|
||||
|
||||
If $bToolbar Then
|
||||
panToolBar.Move(0, 0, Me.ClientW)
|
||||
iToolbarOffset = panToolBar.H
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 2.99.0 (r1759)
|
||||
# Compiled with Gambas 2.99.0 (r1796)
|
||||
Startup=FTest
|
||||
StackTrace=1
|
||||
Version=2.99.0
|
||||
|
@ -29,7 +29,7 @@ Private Const $bShowHandle As Boolean = True
|
||||
Private $iHandleSize As Integer
|
||||
|
||||
Private $iLock As Integer
|
||||
Private $iArrangement As Integer
|
||||
'Private $iArrangement As Integer
|
||||
|
||||
Private $aHidden As Control[]
|
||||
|
||||
@ -134,29 +134,6 @@ Private Function GetFreeWidth() As Integer
|
||||
|
||||
End
|
||||
|
||||
|
||||
' PUBLIC SUB Form_Resize()
|
||||
'
|
||||
' 'DEBUG ME.Width
|
||||
'
|
||||
' IF NOT DesignMode THEN
|
||||
' Object.Lock(ME)
|
||||
' panToolBar.Arrangement = Arrange.LeftRight
|
||||
' panToolBar.Padding = 2
|
||||
' panToolBar.AutoResize = TRUE
|
||||
' panToolBar.Move(If(System.RightToLeft, 0, 6), 0, Min(ME.ClientW - 6, GetToolBarWidth()))
|
||||
' 'panToolBar.Width = GetToolBarWidth()
|
||||
' ME.Parent.Resize(Max(8, panToolBar.Width) + 6, Max(8, panToolBar.Height))
|
||||
' Object.Unlock(ME)
|
||||
' ELSE
|
||||
' panToolBar.Arrangement = Arrange.None
|
||||
' panToolBar.Move(If(System.RightToLeft, 0, 6), 0, ME.ClientW, ME.ClientH)
|
||||
' ENDIF
|
||||
'
|
||||
' dwgHandle.Move(If(System.RightToLeft, ME.ClientW - 5, 2), 2, 3, ME.ClientH - 4)
|
||||
'
|
||||
' END
|
||||
|
||||
Private Sub SetArrangement()
|
||||
|
||||
Dim hToolbar As ToolBar = Me.Parent
|
||||
@ -167,26 +144,17 @@ Private Sub SetArrangement()
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Sub Update()
|
||||
|
||||
Dim W As Integer
|
||||
Dim XH, XP As Integer
|
||||
Dim WH As Integer
|
||||
|
||||
' IF $bIgnoreNextUpdate THEN
|
||||
' $bIgnoreNextUpdate = bSetIgnore
|
||||
' RETURN
|
||||
' ENDIF
|
||||
'
|
||||
' $bIgnoreNextUpdate = bSetIgnore
|
||||
|
||||
If Not Object.IsValid(Me.Parent.Parent) Then Return
|
||||
If $iLock Then Return
|
||||
If $bLock Then Return
|
||||
$bLock = True
|
||||
|
||||
'$bVertical = ME.H > ME.W
|
||||
SetArrangement
|
||||
|
||||
If System.RightToLeft Then
|
||||
@ -317,24 +285,15 @@ Public Sub Form_Resize()
|
||||
End
|
||||
|
||||
|
||||
' PUBLIC SUB Container_Arrange()
|
||||
'
|
||||
' DEBUG
|
||||
' Form_Resize
|
||||
'
|
||||
' END
|
||||
|
||||
Public Sub Container_Resize()
|
||||
|
||||
'IF DesignMode THEN RETURN
|
||||
Update
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub panToolBar_Arrange()
|
||||
Public Sub panToolBar_BeforeArrange()
|
||||
|
||||
'IF DesignMode THEN RETURN
|
||||
Update
|
||||
|
||||
End
|
||||
@ -767,13 +726,9 @@ Public Sub DragEnd(bAnim As Boolean)
|
||||
Else
|
||||
hCtrl = FindControl($sDropAction)
|
||||
If hCtrl Then
|
||||
panToolBar.Enabled = True
|
||||
'Debug "hCtrl.Enabled = "; hCtrl.Enabled
|
||||
hCtrl.Reparent(panToolBar)
|
||||
'Debug "hCtrl.Enabled = "; hCtrl.Enabled
|
||||
ShowControl(hCtrl)
|
||||
hCtrl.Show
|
||||
hCtrl.Next = panWhere.Next
|
||||
panToolBar.Enabled = False
|
||||
Endif
|
||||
Endif
|
||||
Update
|
||||
@ -1124,7 +1079,7 @@ End
|
||||
Private Sub Lock()
|
||||
|
||||
If $iLock = 0 Then
|
||||
$iArrangement = panToolBar.Arrangement
|
||||
'$iArrangement = panToolBar.Arrangement
|
||||
panToolBar.Arrangement = Arrange.None
|
||||
Endif
|
||||
Inc $iLock
|
||||
@ -1136,7 +1091,6 @@ Private Sub Unlock()
|
||||
If $iLock <= 0 Then Return
|
||||
Dec $iLock
|
||||
If $iLock = 0 Then
|
||||
panToolBar.Arrangement = $iArrangement
|
||||
Update
|
||||
Endif
|
||||
|
||||
@ -1144,13 +1098,17 @@ End
|
||||
|
||||
Public Sub HideControl(hCtrl As Control)
|
||||
|
||||
panToolBar.Enabled = True
|
||||
hCtrl.Reparent(panHide)
|
||||
panToolBar.Enabled = False
|
||||
|
||||
End
|
||||
|
||||
Public Sub ShowControl(hCtrl As Control)
|
||||
|
||||
panToolBar.Enabled = True
|
||||
hCtrl.Reparent(panToolBar)
|
||||
panToolBar.Enabled = False
|
||||
|
||||
End
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 2.99.0 (r1759)
|
||||
# Compiled with Gambas 2.99.0 (r1796)
|
||||
Startup=FMain
|
||||
Version=2.99.0
|
||||
VersionProgram=gbx3 -V
|
||||
|
@ -47,8 +47,8 @@ Public Sub _New()
|
||||
hPanel2.Border = Border.Sunken
|
||||
$hTextBox = New Label(hPanel2) As "TextBox"
|
||||
$hTextBox.Expand = True
|
||||
$hTextBox.BackColor = Color.White
|
||||
$hTextBox.ForeColor = Color.Black
|
||||
$hTextBox.Background = Color.White
|
||||
$hTextBox.Foreground = Color.Black
|
||||
$hTextBox.Border = Border.None
|
||||
|
||||
hIcon = Picture["icon:/small/calendar"]
|
||||
|
@ -1,3 +1,15 @@
|
||||
' Gambas class file
|
||||
|
||||
Private $hDatePicker As FileView
|
||||
|
||||
Public Sub Form_Open()
|
||||
|
||||
$hDatePicker = New FileView(Me)
|
||||
|
||||
End
|
||||
|
||||
Public Sub FileView1_Click()
|
||||
|
||||
|
||||
|
||||
End
|
||||
|
@ -5,9 +5,4 @@
|
||||
Text = ("")
|
||||
Arrangement = Arrange.Fill
|
||||
Padding = 8
|
||||
{ DirChooser1 DirChooser
|
||||
MoveScaled(5,3,95,52)
|
||||
ShowFile = True
|
||||
ShowBookmark = True
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,16 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
DECLARE_EVENT(EVENT_BeforeArrange);
|
||||
DECLARE_EVENT(EVENT_Arrange);
|
||||
DECLARE_EVENT(EVENT_Insert);
|
||||
|
||||
|
||||
void CCONTAINER_cb_before_arrange(gContainer *sender)
|
||||
{
|
||||
GB.Raise(sender->hFree, EVENT_BeforeArrange, 0);
|
||||
}
|
||||
|
||||
void CCONTAINER_cb_arrange(gContainer *sender)
|
||||
{
|
||||
GB.Raise(sender->hFree, EVENT_Arrange, 0);
|
||||
|
@ -79,6 +79,7 @@ DECLARE_PROPERTY(CCONTAINER_spacing);
|
||||
DECLARE_PROPERTY(CCONTAINER_margin);
|
||||
|
||||
void CCONTAINER_cb_arrange(gContainer *sender);
|
||||
void CCONTAINER_cb_before_arrange(gContainer *sender);
|
||||
void CCONTAINER_raise_insert(CCONTAINER *_object, CWIDGET *child);
|
||||
|
||||
#endif
|
||||
|
@ -307,7 +307,10 @@ void InitControl(gControl *control, CWIDGET *widget)
|
||||
control->onEnterLeave=gb_raise_EnterLeave;
|
||||
|
||||
if (control->isContainer())
|
||||
{
|
||||
((gContainer *)control)->onBeforeArrange = CCONTAINER_cb_before_arrange;
|
||||
((gContainer *)control)->onArrange = CCONTAINER_cb_arrange;
|
||||
}
|
||||
|
||||
if (control->parent())
|
||||
CCONTAINER_raise_insert((CCONTAINER *)control->parent()->hFree, widget);
|
||||
|
@ -68,6 +68,12 @@ static void cb_arrange(gContainer *sender)
|
||||
(*(sender->onArrange))(sender);
|
||||
}
|
||||
|
||||
static void cb_before_arrange(gContainer *sender)
|
||||
{
|
||||
if (sender->onBeforeArrange)
|
||||
(*(sender->onBeforeArrange))(sender);
|
||||
}
|
||||
|
||||
static void resize_container(gControl *cont, int w, int h)
|
||||
{
|
||||
if (w > 0 && h > 0)
|
||||
@ -122,6 +128,7 @@ static void resize_container(gControl *cont, int w, int h)
|
||||
#define GET_OBJECT_NAME(_object) (((gControl *)_object)->name())
|
||||
|
||||
#define RAISE_ARRANGE_EVENT(_object) cb_arrange((gContainer *)_object);
|
||||
#define RAISE_BEFORE_ARRANGE_EVENT(_object) cb_before_arrange((gContainer *)_object);
|
||||
|
||||
#define DESKTOP_SCALE gDesktop::scale();
|
||||
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
|
||||
//"Signals"
|
||||
void (*onArrange)(gContainer *sender);
|
||||
void (*onBeforeArrange)(gContainer *sender);
|
||||
//void (*onInsert)(gContainer *sender, gControl *child);
|
||||
|
||||
//"Private"
|
||||
|
@ -115,6 +115,9 @@ Returns the value of Desktop.Scale
|
||||
#define RAISE_ARRANGE_EVENT(_object)
|
||||
Code to raise the Arrange event of containers.
|
||||
|
||||
#define RAISE_BEFORE_ARRANGE_EVENT(_object)
|
||||
Code to raise the BeforeArrange event of containers.
|
||||
|
||||
#define FUNCTION_NAME
|
||||
This is the name of the arrangement function
|
||||
|
||||
@ -166,8 +169,8 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont)
|
||||
|
||||
arr->locked = true;
|
||||
|
||||
#ifdef RAISE_ARRANGE_EVENT
|
||||
RAISE_ARRANGE_EVENT(_object);
|
||||
#ifdef RAISE_BEFORE_ARRANGE_EVENT
|
||||
RAISE_BEFORE_ARRANGE_EVENT(_object);
|
||||
#endif
|
||||
|
||||
if (arr->mode != ARRANGE_NONE)
|
||||
@ -574,6 +577,10 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont)
|
||||
|
||||
}
|
||||
|
||||
#ifdef RAISE_ARRANGE_EVENT
|
||||
RAISE_ARRANGE_EVENT(_object);
|
||||
#endif
|
||||
|
||||
arr->locked = false;
|
||||
//qDebug("%p: dirty = FALSE", THIS);
|
||||
//arr->dirty = false;
|
||||
|
@ -585,8 +585,7 @@ void CDRAG_drag_drop(QWidget *w, CWIDGET *control, QDropEvent *e)
|
||||
CDRAG_info.x = p.x();
|
||||
CDRAG_info.y = p.y();
|
||||
|
||||
GB.Raise(control, EVENT_Drop, 0);
|
||||
|
||||
GB.Raise(CDRAG_destination, EVENT_Drop, 0);
|
||||
CDRAG_clear(false);
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
DECLARE_EVENT(EVENT_Insert);
|
||||
//DECLARE_EVENT(EVENT_Remove);
|
||||
DECLARE_EVENT(EVENT_BeforeArrange);
|
||||
DECLARE_EVENT(EVENT_Arrange);
|
||||
|
||||
static QWidget *get_widget(QObjectList *list)
|
||||
@ -111,6 +112,11 @@ static void resize_container(QWidget *wid, QWidget *cont, int w, int h)
|
||||
GB.Raise(_object, EVENT_Arrange, 0); \
|
||||
}
|
||||
|
||||
#define RAISE_BEFORE_ARRANGE_EVENT(_object) \
|
||||
{ \
|
||||
GB.Raise(_object, EVENT_BeforeArrange, 0); \
|
||||
}
|
||||
|
||||
#define DESKTOP_SCALE MAIN_scale
|
||||
|
||||
//THIS_ARRANGEMENT->dirty = FALSE;
|
||||
@ -748,6 +754,7 @@ GB_DESC CContainerDesc[] =
|
||||
|
||||
GB_METHOD("Find", "Control", CCONTAINER_find, "(X)i(Y)i"),
|
||||
|
||||
GB_EVENT("BeforeArrange", NULL, NULL, &EVENT_BeforeArrange),
|
||||
GB_EVENT("Arrange", NULL, NULL, &EVENT_Arrange),
|
||||
GB_EVENT("Insert", NULL, "(Control)Control", &EVENT_Insert),
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
|
||||
DECLARE_EVENT(EVENT_Insert);
|
||||
//DECLARE_EVENT(EVENT_Remove);
|
||||
DECLARE_EVENT(EVENT_BeforeArrange);
|
||||
DECLARE_EVENT(EVENT_Arrange);
|
||||
|
||||
static QWidget *get_next_widget(QObjectList &list, int &index)
|
||||
@ -120,6 +121,11 @@ static void resize_container(QWidget *wid, QWidget *cont, int w, int h)
|
||||
GB.Raise(_object, EVENT_Arrange, 0); \
|
||||
}
|
||||
|
||||
#define RAISE_BEFORE_ARRANGE_EVENT(_object) \
|
||||
{ \
|
||||
GB.Raise(_object, EVENT_BeforeArrange, 0); \
|
||||
}
|
||||
|
||||
#define DESKTOP_SCALE MAIN_scale
|
||||
|
||||
#define FUNCTION_NAME CCONTAINER_arrange
|
||||
@ -741,6 +747,7 @@ GB_DESC CContainerDesc[] =
|
||||
|
||||
GB_METHOD("Find", "Control", CCONTAINER_find, "(X)i(Y)i"),
|
||||
|
||||
GB_EVENT("BeforeArrange", NULL, NULL, &EVENT_BeforeArrange),
|
||||
GB_EVENT("Arrange", NULL, NULL, &EVENT_Arrange),
|
||||
GB_EVENT("Insert", NULL, "(Control)Control", &EVENT_Insert),
|
||||
|
||||
|
@ -527,6 +527,8 @@ static void QT_InitEventLoop(void)
|
||||
{
|
||||
}
|
||||
|
||||
extern void qt_x11_set_global_double_buffer(bool);
|
||||
|
||||
static void QT_Init(void)
|
||||
{
|
||||
static bool init = false;
|
||||
@ -552,6 +554,8 @@ static void QT_Init(void)
|
||||
|
||||
qApp->installEventFilter(&CWidget::manager);
|
||||
|
||||
//qt_x11_set_global_double_buffer(false);
|
||||
|
||||
//Q3StyleSheet::defaultSheet()->item("tt")->setFontFamily("Monospace");
|
||||
//Q3StyleSheet::defaultSheet()->item("pre")->setFontFamily("Monospace");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user