[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
This commit is contained in:
seraf1 2008-05-20 08:54:04 +00:00
parent d0ddcf2e1b
commit 11d0dcad71
3 changed files with 25 additions and 12 deletions

View File

@ -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

View File

@ -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
}
}

View File

@ -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