[GB.FORM]

* NEW: DateChooser[].Text is now taken into account. It is displayed as a 
  tooltip when the mouse cursor hovers the associated date.


git-svn-id: svn://localhost/gambas/trunk@5829 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-09-04 10:00:30 +00:00
parent 3a3449c068
commit 67e3478bdb
6 changed files with 22 additions and 74 deletions

View file

@ -343,10 +343,6 @@ msgstr ""
msgid "How quickly daft jumping zebras vex"
msgstr ""
#: FMain.form:34
msgid "ButtonBox1"
msgstr ""
#: FMessage.form:39
msgid "Do not display this message again"
msgstr ""

View file

@ -1,7 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.4.90
Title=More controls for graphical components
Startup=Form4
Startup=FMain
Version=3.4.90
VersionFile=1
Component=gb.image
@ -9,7 +9,7 @@ Component=gb.gui
Component=gb.form
Component=gb.settings
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt4"
Environment="GB_GUI=gb.gtk"
TabSize=2
Translate=1
Language=en

View file

@ -165,6 +165,7 @@ Public Sub dwgMonth_Draw()
Dim sKey As String
Dim bToday As Boolean
Dim hDate As _DateChooser_Date
Dim fSize As Float
iForeground = dwgMonth.Foreground 'Draw.Foreground
iBackground = dwgMonth.Background 'Draw.Background
@ -181,7 +182,8 @@ Public Sub dwgMonth_Draw()
Draw.LineStyle = Line.None
Draw.Font = dwgMonth.Font
Draw.Font.Size = Draw.Font.Size * H / Draw.Font.Height * 0.7
fSize = Draw.Font.Size * H / Draw.Font.Height * 0.7
Draw.Font.Size = fSize
Draw.Font.Bold = True
X = XD
@ -219,6 +221,7 @@ Public Sub dwgMonth_Draw()
If iBackground = Color.Default Then iBackground = dwgMonth.Background
Draw.Font = hDate.Font
Draw.Font.Size = fSize
If CInt(dDate) = CInt($dDate) Then
Draw.FillColor = If(dwgMonth.HasFocus, Color.SelectedBackground, Color.LightForeground)
@ -245,6 +248,7 @@ Public Sub dwgMonth_Draw()
bToday = CInt(Date(Now)) = CInt(Date(dDate))
Draw.Font.Bold = bToday
Draw.Font.Underline = hDate.Text
Draw.Text(Day(dDate), X, Y, W, H, Align.Center)
@ -348,8 +352,9 @@ Public Sub dwgMonth_KeyPress()
End
Private Sub CalcCurrenDate()
Private Sub CalcCurrentDate()
Dim hDate As _DateChooser_Date
Dim W, H As Integer
Dim XD, YD As Integer
@ -367,12 +372,15 @@ Private Sub CalcCurrenDate()
$dCurrentDate = $dStart + Min(6, Mouse.X \ W) + ((Mouse.Y - YD) \ H) * 7
hDate = GetParent()[$dCurrentDate]
dwgMonth.Tooltip = hDate.Text
End
Public Sub dwgMonth_MouseDown()
CalcCurrenDate
CalcCurrentDate
If Not $dCurrentDate Then Return
$dDate = $dCurrentDate
@ -536,7 +544,7 @@ Public Sub dwgTime_Draw()
End
Private Sub CalcCurrenTime()
Private Sub CalcCurrentTime()
Dim X, Y, DX, DY, DW, DH As Integer
@ -564,7 +572,7 @@ End
Public Sub dwgTime_MouseDown()
CalcCurrenTime
CalcCurrentTime
If $iCurrentTime >= 0 Then
SetTime(Time($iCurrentTime \ 2, 30 * ($iCurrentTime Mod 2), 0))
Endif
@ -671,14 +679,14 @@ Public Sub dwgTime_MouseMove()
Dim iLast As Integer = $iCurrentTime
CalcCurrenTime
CalcCurrentTime
If $iCurrentTime <> iLast Then dwgTime.Refresh
End
Public Sub dwgMonth_MouseMove()
CalcCurrenDate
CalcCurrentDate
dwgMonth.Refresh
End
@ -686,6 +694,7 @@ End
Public Sub dwgMonth_Leave()
$dCurrentDate = Null
dwgMonth.Tooltip = ""
dwgMonth.Refresh
End

View file

@ -27,6 +27,8 @@ End
Public Sub Form_Open()
DateChooser1[Date(2013, 9, 4)].Text = "Aujourd'hui"
DateChooser1[Date(2013, 9, 6)].Text = "Mon anniversaire"
DateChooser1[Date(2013, 9, 28)].Text = "Papa"
End

View file

@ -3,30 +3,13 @@
{ Form Form
Move(0,0,476,336)
#Scaled = False
Resizable = False
Arrangement = Arrange.Fill
Spacing = True
Margin = True
{ Button1 Button
Move(175,21,112,28)
#Translate = False
Foreground = &HFF0000&
Text = "Button1"
}
{ DateChooser1 DateChooser
Move(49,126,294,182)
#Translate = False
Foreground = &HFF0000&
Border = False
}
{ Panel1 Panel
Move(28,63,154,28)
Border = Border.Plain
{ ButtonBox1 ButtonBox
Move(0,0,154,28)
Text = ("ButtonBox1")
}
}
{ DateBox1 DateBox
Move(224,70,168,28)
}
}

View file

@ -1,44 +1,2 @@
' Gambas class file
Private Sub GetPicture() As Picture
Select Case Int(Rnd(0, 6))
Case 0
Return Picture["icon:/small/gambas"]
Case 1
Return Picture["icon:/small/gambas"]
Case 2
Return Picture["icon:/small/gambas"]
Case 3
Return Picture["icon:/small/gambas"]
Case 4
Return Picture["icon:/small/gambas"]
Case 5
Return Picture["icon:/small/gambas"]
End Select
End
Public Sub Form_Open()
Dim I As Integer
Dim sParent As String
Dim aList As String[] = ["gambas", "gnu", "people", "home", "internet", "language", "clock"]
For I = 1 To 20
'If I > 1 Then sParent = Int(Rnd(1, Min(6, I)))
TreeView1.Add(CStr(I), "Item " & CStr(I), Picture["icon:/small" &/ aList[Int(Rnd(0, aList.Count))]], sParent).Expanded = True
Next
End