From 11d0dcad713790417cd69d1b985282dad6656c03 Mon Sep 17 00:00:00 2001 From: seraf1 Date: Tue, 20 May 2008 08:54:04 +0000 Subject: [PATCH] [GB.FORM] * BUG: In DatePicker and ValueBox : DateChooser Move when Window Move * BUG: In ValueBox : Always hide DateChooser when DeActivate git-svn-id: svn://localhost/gambas/trunk@1389 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form/DatePicker.class | 17 ++++++++++------- comp/src/gb.form/FMain.form | 10 ++++++++-- comp/src/gb.form/ValueBox.class | 10 +++++++--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/comp/src/gb.form/DatePicker.class b/comp/src/gb.form/DatePicker.class index d5c4ec5ab..845b3f8c9 100644 --- a/comp/src/gb.form/DatePicker.class +++ b/comp/src/gb.form/DatePicker.class @@ -12,7 +12,7 @@ Public Const _DefaultEvent As String = "Change" Public Const _DefaultSize As String = "30,4" Public Const _DrawWith As String = "DatePicker" -Private $hObserver As Observer +'Private $hObserver As Observer Private $hDraw As DrawingArea Private $hForm As form @@ -70,7 +70,7 @@ Public Sub _New() Me.Begin = ThisDay Me.Value = Now() Me.Alignment = Align.Center - $hObserver = New Observer(Me.Window) As "OBS" +' $hObserver = New Observer(Me.Window) As "OBS" End Public Sub Draw_Draw() @@ -81,10 +81,11 @@ Public Sub Draw_Draw() End Public Sub Draw_Enter() - Draw.Begin($hDraw) - Draw.Style.Button(0, -5, 54, Me.Height + 50, True) - Draw.Picture(hIcon, (28 - hIcon.Width) / 2, (Me.Height - hIcon.Height - 4) / 2) - Draw.End() +$hDraw.Refresh + ' Draw.Begin($hDraw) + ' Draw.Style.Button(0, -5, 54, Me.Height + 50, True) + ' Draw.Picture(hIcon, (28 - hIcon.Width) / 2, (Me.Height - hIcon.Height - 4) / 2) + ' Draw.End() End Public Sub Draw_Leave() @@ -105,6 +106,7 @@ Public Sub LstForm_DeACtivate() End Public Sub LstForm_Show() +OBS_Move() Draw_Enter End @@ -113,7 +115,7 @@ Public Sub LstForm_Hide() End Public Sub hTimer_Timer() - 'hTimer.Stop + hTimer.Stop Try $hForm.Close isActivate = False End @@ -232,6 +234,7 @@ Public Sub DateChooser_Change() Display_Text() End + Public Sub OBS_Move() $hdatechooser.Font = Me.Font If $hDraw.ScreenY + $hDraw.Height + $hForm.Height < Desktop.Height Then diff --git a/comp/src/gb.form/FMain.form b/comp/src/gb.form/FMain.form index f94ef3967..046ea8fd5 100644 --- a/comp/src/gb.form/FMain.form +++ b/comp/src/gb.form/FMain.form @@ -1,10 +1,16 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(12,12,43,38) + MoveScaled(12,12,79,38) Text = ("") Icon = Picture["icon:/small/gambas"] - Arrangement = Arrange.Fill Spacing = 8 Padding = 8 + { DatePicker1 DatePicker + MoveScaled(26,8,30,4) + } + { ValueBox1 ValueBox + MoveScaled(27,19,30,4) + Type = ValueBox.Date + } } diff --git a/comp/src/gb.form/ValueBox.class b/comp/src/gb.form/ValueBox.class index 22c5ababf..8c6b4f00d 100644 --- a/comp/src/gb.form/ValueBox.class +++ b/comp/src/gb.form/ValueBox.class @@ -17,7 +17,7 @@ Public Const {Identifier} As Integer = 3 'PUBLIC CONST {MailAddress} AS Integer = 5 'PUBLIC CONST {IPAddress} AS Integer = 6 -Private $hObserver As Observer +'Private $hObserver As Observer Property Value As Variant Property Type As Integer @@ -105,7 +105,7 @@ Public Sub _new() Me.WidthForm = 300 Me.HeightForm = 200 $hForm.Resize($iWidthForm, $iHeightForm) - $hObserver = New Observer(Me.Window) As "OBS" +' $hObserver = New Observer(Me.Window) As "OBS" Type_Write(Number) End @@ -508,8 +508,10 @@ Public Sub Form_Resize() End Public Sub Button_Draw() + Draw.Begin($hButton) Draw.Style.Button(0, -5, 54, Me.Height + 50, $bInButton) Draw.Picture(hIcon, (28 - hIcon.Width) / 2, (Me.Height - hIcon.Height - 4) / 2) + Draw.End() End Public Sub Button_Enter() @@ -529,10 +531,11 @@ Public Sub Button_MouseDown() End Public Sub LstForm_DeACtivate() - htimer.Start + htimer.Trigger End Public Sub LstForm_Show() + OBS_Move() Button_Enter End @@ -541,6 +544,7 @@ Public Sub LstForm_Hide() End Public Sub hTimer_Timer() +Print "aa" hTimer.Stop Try $hForm.Close isActivate = False