Skip to content
Commits on Source (6)
This diff is collapsed.
......@@ -38,8 +38,6 @@ Public (Shortcut) As Boolean
Public Arrangement As Boolean
'PUBLIC Control AS Boolean
Static Public Sub _init()
$cRedirect["Visible"] = True
......@@ -63,6 +61,7 @@ Static Public Sub _init()
$cRedirect["Height"] = True
$cRedirect["Label.Padding"] = False
$cRedirect["PictureBox.Padding"] = False
$cRedirect["LCDLabel.Padding"] = False
$cRedirect["TextLabel.Padding"] = False
$cRedirect["GridView.Padding"] = False
......
......@@ -189,7 +189,7 @@ Private Function CreateControl(sName As String, sClass As String, hParent As Obj
Case "picturebox"
hCtrl = New PictureBox(hParent)
hCtrl.Picture = Picture["img/control/picturebox.png"]
'hCtrl.Picture = Picture["img/control/picturebox.png"]
Case "treeview"
hCtrl = New TreeView(hParent)
......
......@@ -2785,12 +2785,6 @@ Public Sub SetReadOnly()
End
Public Sub OnProjectChange()
SetReadOnly
End
Public Sub OnProjectDebug()
SetReadOnly
......
......@@ -210,6 +210,8 @@ Public Sub SetReadOnly()
UpdateMenu
DrawTitle
FImageProperty.OnProjectActivate
End
......@@ -680,7 +682,6 @@ Private Sub GetImagePos() As PointF
Endif
Debug X;; Y
Return PointF(X, Y)
End
......
......@@ -1027,6 +1027,7 @@ Public Sub OnProjectActivate()
If hCurrent Then
ShowGridOption(hCurrent.HasGrid())
ShowTextOption(hCurrent.GetTool() = "text")
Me.Enabled = Not hCurrent.ReadOnly
Endif
End
......
......@@ -8,14 +8,13 @@
Arrangement = Arrange.Fill
Margin = True
{ wizProject Wizard
MoveScaled(1,1,82,69)
MoveScaled(1,1,83,69)
Arrangement = Arrange.Vertical
Spacing = True
Count = 3
TextFont = Font["Bold,+3"]
ShowIndex = True
Border = False
Animated = True
Index = 0
Text = ("Project type")
{ Panel1 Panel
......
# Gambas Connection File 3.0
[Connection]
Type="mysql"
Type="postgresql"
RememberPassword=True
IgnoreCharset=False
Database="test"
Requests=[""]
DisplayMetadata=False
RememberTemplate=False
User="root"
Host="localhost"
NoPassword=False
......@@ -927,12 +927,24 @@ End
Private Sub UpdateMode()
Dim iRow As Integer
Dim iCol As Integer
iRow = $hCtrl.Row
iCol = $hCtrl.Column
Object.Lock($hCtrl)
If $bCreate And If HasNewRecord() Then
$hCtrl.Mode = Select.None
Else
$hCtrl.Mode = $iMode
Endif
$hCtrl.MoveTo(iRow, iCol)
Object.Unlock($hCtrl)
End
......@@ -1175,7 +1187,7 @@ Private Sub Editable_Write(Value As Boolean)
$hCtrl.ShowCursor = $bEditable
'If Value Then
'CreateNewRecord
Create()
Create()
'Endif
End
......
......@@ -9,13 +9,13 @@
{ btnSave ToolButton
MoveScaled(0,0,9,4)
AutoResize = True
Text = ("Save...")
Text = ("Save") & "..."
Picture = Picture["icon:/small/save-as"]
}
{ btnLoad ToolButton
MoveScaled(11,0,10,4)
AutoResize = True
Text = ("Load...")
Text = ("Load") & "..."
Picture = Picture["icon:/small/open"]
}
{ btnClear ToolButton
......@@ -35,7 +35,7 @@
}
{ gvwPreview GridView
MoveScaled(5,11,47,40)
Font = Font["Monospace"]
Font = Font["Monospace,-1"]
Mouse = Mouse.Pointing
Expand = True
Border = False
......
......@@ -24,10 +24,9 @@
Connection = Connections["Connection2"]
Table = "color"
{ DataBrowser2 DataBrowser
MoveScaled(7,5,54,16)
MoveScaled(7,5,42,16)
Font = Font["-1"]
Expand = True
Control = False
Grid = True
}
}
......
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FBugFileView
Profiling=1
Startup=FTestColorChooser
Version=3.11.90
VersionFile=1
Component=gb.image
Component=gb.gui
Component=gb.settings
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt5"
Environment="GB_GUI=gb.gtk3"
TabSize=2
Translate=1
Language=en
......
......@@ -189,8 +189,7 @@ Public Sub View_MouseDown()
'Debug Mouse.Left;; $iIndex
If Not Me.Enabled Or If Not Mouse.Left Or If $iIndex < 0 Then Return
$iCurrent = $iIndex
$hView.Refresh
SetCurrent($iIndex)
Raise Click
......@@ -291,6 +290,15 @@ Public Sub View_Arrange()
End
Private Sub SetCurrent(iCurrent As Integer)
If $iCurrent = iCurrent Then Return
$iCurrent = iCurrent
If $iCurrent >= 0 Then $hView.EnsureVisible(CUSTOM_D + (CUSTOM_W + CUSTOM_D) * $iCurrent - CUSTOM_D, 0, CUSTOM_W + CUSTOM_D * 2, $hView.ClientH)
$hView.Refresh
End
Private Function Index_Read() As Integer
Return $iCurrent
......@@ -303,8 +311,7 @@ Private Sub Index_Write(Value As Integer)
Value = -1
Endif
$iCurrent = Value
$hView.Refresh
SetCurrent(Value)
End
......@@ -320,11 +327,7 @@ End
Private Sub Current_Write(Value As Integer)
$iCurrent = $aColors.Find(Value)
If $iCurrent >= 0 Then
$hView.EnsureVisible(CUSTOM_D + (CUSTOM_W + CUSTOM_D) * ($iCurrent - 1) + CUSTOM_W \ 2, 1, 1, $hView.ClientH)
Endif
$hView.Refresh
SetCurrent($aColors.Find(Value))
End
......@@ -380,3 +383,9 @@ Public Sub mnuSort_Click()
UpdateColors
End
Public Sub View_MouseWheel()
Stop Event
End
......@@ -488,8 +488,8 @@ Public Sub dwgValue_MouseMove()
If Not GetParent().Enabled Then Return
V = Mouse.Y / dwgValue.H * 256
If Not (Mouse.Shift Xor $bSnap) Then V = Int((V + 16) / 32) * 32
V = 255 - Min(255, Max(0, V))
If Not (Mouse.Shift Xor $bSnap) Then V = ((V + 16) \ 32) * 32
V = Min(255, Max(0, 256 - V))
If V = $iVal Then Return
txtV.Value = V
......@@ -597,3 +597,13 @@ Public Sub panValue_Arrange()
txtA.W = txtR.W
End
Public Sub dwgValue_MouseWheel()
If Mouse.Delta > 0 Then
txtV.Value = Min(255, (txtV.Value + 16) And Not 15)
Else
txtV.Value = Max(0, (txtV.Value - 1) And Not 15)
Endif
End
......@@ -261,7 +261,7 @@ End
Private Sub GetIconSize() As Integer
If $hColumnView.Visible Then
Return 16
Return Stock.GetSize("small")
Else
Return $iIconSize
Endif
......@@ -318,6 +318,7 @@ Private Sub RefreshView()
SX = $hColumnView.ScrollX
SY = $hColumnView.ScrollY
If Not $bWatch Or If $bRefreshAll Then $hColumnView.Clear
$hColumnView.Sorted = False
hPictFile = Picture["icon:/small/file"]
hPictFolder = Picture["icon:/small/directory"]
Else
......@@ -432,7 +433,11 @@ Finally
$bRefreshIcon = False
$bRefreshAll = False
If Not $hColumnView.Visible Then $hIconView._End
If $hColumnView.Visible Then
$hColumnView.Sorted = True
Else
$hIconView._End
Endif
Try GetView().Scroll(SX, SY)
Dec Application.Busy
......
......@@ -14,6 +14,7 @@ Event Hide
Property Read Editor As Control
Property NoKeyboard As Boolean
Property ShowCursor As Boolean
Private $hTextBox As TextBox
Private $hComboBox As ComboBox
......@@ -27,6 +28,7 @@ Private $hWatcher As Watcher
Private $bNoKeyboard As Boolean
Private $hTimer As Timer
Private $bDoNotHideEditor As Boolean
Private $bShowCursor As Boolean
Public Sub _new()
......@@ -109,6 +111,8 @@ Private Sub HideEditor(Optional bNoSave As Boolean) As Boolean
Endif
Endif
UpdateShowCursor
Return bCancel
End
......@@ -140,10 +144,15 @@ Private Sub MoveEditor()
With Me[$iRow, $iCol]
X += .X
Y += .Y
W = Min(Me.ClientW - Me.Rows.W, .Width) - 1
H = Min(Me.ClientH - Me.Columns.H, .Height)
X += .X + 1
Y += .Y + 1
W = Min(Me.ClientW - Me.Rows.W, .Width) - 2
H = Min(Me.ClientH - Me.Columns.H, .Height) - 2
If Not Me.Grid Then
Dec W
Dec H
Endif
P = Max(Me.Padding, .Padding)
P = Max(0, P - 1)
......@@ -163,6 +172,8 @@ Private Sub MoveEditor()
$hPanel.Background = $hEditor.Background
Endif
UpdateShowCursor
$hPanel.Move(X, Y, W, H)
$hEditor.Move(P, P, W - P * 2, H - P * 2)
$hEditor.Show
......@@ -170,7 +181,6 @@ Private Sub MoveEditor()
$hPanel.Raise
$hEditor.Raise
End With
End
......@@ -527,3 +537,22 @@ Public Sub Clear()
Super.Clear
End
Private Function ShowCursor_Read() As Boolean
Return $bShowCursor
End
Private Sub UpdateShowCursor()
Super.ShowCursor = $bShowCursor 'And IsNull($hEditor)
End
Private Sub ShowCursor_Write(Value As Boolean)
$bShowCursor = Value
UpdateShowCursor
End
......@@ -26,6 +26,8 @@ Public Sub Form_Open()
tvwMain[Y, 1].Padding = 4
tvwMain[Y, 1].Background = Color.Yellow
Next
tvwMain.Rows.H = -1
End
......
......@@ -10,6 +10,7 @@
MoveScaled(0,0,29,27)
Expand = True
Mode = Select.Single
ShowCursor = True
Header = GridView.Horizontal
}
}
......
# Gambas Project File 3.0
Title=Common controls and classes for GUI components
Startup=FTestMouseWheel
Startup=FGridView
Version=3.11.90
VersionFile=1
Component=gb.image
Component=gb.gui
Arguments=[["-style=oxygen"],["-style=qtcurve"]]
CurrentArgument=0
Environment="GB_GUI=gb.gtk3\nLIBOVERLAY_SCROLLBAR=0"
Environment="GB_GUI=gb.qt5\nLIBOVERLAY_SCROLLBAR=0"
TabSize=2
Language=fr
Type=Component
......