[DEVELOPMENT ENVIRONMENT]

* NEW: Disable main toolbar buttons instead of hiding them. This is more 
  practical to use.
* BUG: Fix a warning message when displaying auto-completion.

[GB.FORM.MDI]
* NEW: Toolbar.Configure is a new method that is a synonymous of like 
  Action.ConfigureToolbar.
* BUG: Toolbar buttons are always correctly initialized the first time a 
  toolbar is shown now.
* BUG: Toolbars do not flicker anymore when their configuration dialog is 
  shown.


git-svn-id: svn://localhost/gambas/trunk@1851 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2009-02-03 02:07:44 +00:00
parent bea17ca87c
commit 8a671a8b07
8 changed files with 410 additions and 30 deletions

View file

@ -1937,15 +1937,17 @@ Private Function GetExpressionSignature(aExpr As String[], aType As Integer[]) A
sType = GetExpressionType(aExpr, aType, False)
'IF NOT $hSymbol THEN
If sPattern = "(" Then
If bNew Then
Try $hSymbol = CComponent.GetClassSymbols(sType)["_new"]
Else
Try $hSymbol = CComponent.GetClassSymbols(sType)["_call"]
If sType Then
If sPattern = "(" Then
If bNew Then
Try $hSymbol = CComponent.GetClassSymbols(sType)["_new"]
Else
Try $hSymbol = CComponent.GetClassSymbols(sType)["_call"]
Endif
Else If sPattern = "[" Then
$hSymbol = Null
Try $hSymbol = CComponent.GetClassSymbols(sType)["_get"]
Endif
Else If sPattern = "[" Then
$hSymbol = Null
Try $hSymbol = CComponent.GetClassSymbols(sType)["_get"]
Endif
' IF $hSymbol THEN

View file

@ -586,7 +586,8 @@ End
Public Sub UpdateTranslate()
Action["translate"].Visible = Project.Localize And Not (Project.ReadOnly Or Project.Running)
Action["translate"].Visible = Project.Localize And Not Project.ReadOnly
Action["translate"].Enabled = Not Project.Running
'Action["component"].Visible = Project.CreateComponent 'AND NOT (Project.ReadOnly OR Project.Running)
End
@ -798,16 +799,18 @@ End
Private Sub UpdateMenu()
Dim bVisible As Boolean
Dim bEnabled As Boolean
Dim sAction As String
bVisible = Not (Project.ReadOnly Or Project.Running)
bVisible = Not Project.ReadOnly
bEnabled = Not Project.Running
UpdateTranslate
Action["exec"].Visible = bVisible
Action["install"].Visible = bVisible
Action["compile"].Visible = bVisible
Action["compile-all"].Visible = bVisible
Action["property"].Visible = bVisible
For Each sAction In ["exec", "install", "compile", "compile-all", "property"]
Action[sAction].Visible = bVisible
Action[sAction].Enabled = bEnabled
Next
mnuStartup.Visible = bVisible
mnuRenameFile.Visible = bVisible

View file

@ -72,6 +72,10 @@ _new
m
Configure
m
#Workspace
UserControl
C

View file

@ -1,5 +1,5 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.0 (r1805)
# Compiled with Gambas 2.99.0 (r1814)
Startup=FTest
StackTrace=1
Version=2.99.0

View file

@ -1,7 +1,7 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,68,64)
MoveScaled(0,0,140,64)
Text = ("")
{ ToolButton1 ToolButton
MoveScaled(25,19,16,6)
@ -10,4 +10,367 @@
Picture = Picture["icon:/small/linux"]
Toggle = True
}
{ ToolBar1 ToolBar
MoveScaled(1,1,127,4)
Expand = True
Key = "main"
Text = ("")
{ ToolButton2 ToolButton
MoveScaled(0,0,4,4)
ToolTip = ("New project")
Action = "new-project"
Text = ("")
Picture = Picture["icon:/small/new"]
}
{ ToolButton3 ToolButton
MoveScaled(4,0,4,4)
ToolTip = ("Open project")
Action = "open-project"
Text = ("")
Picture = Picture["icon:/small/open"]
}
{ btnSave ToolButton
MoveScaled(8,0,4,4)
ToolTip = ("Save project")
Action = "save-project"
Text = ("")
Picture = Picture["icon:/small/save"]
}
{ ToolButton15 ToolButton
MoveScaled(12,0,4,4)
ToolTip = ("Save project as")
Action = "save-project-as"
Text = ("")
Picture = Picture["icon:/small/save-as"]
}
{ btnProperty ToolButton
MoveScaled(16,0,4,4)
ToolTip = ("Project properties")
Action = "project-property"
Text = ("")
Picture = Picture["icon:/small/properties"]
}
{ ToolButton7 ToolButton
MoveScaled(20,0,4,4)
Visible = False
ToolTip = ("Refresh project")
Action = "refresh-project"
Text = ("")
Picture = Picture["icon:/small/refresh"]
}
{ ToolButton12 ToolButton
MoveScaled(24,0,4,4)
ToolTip = ("Preferences")
Action = "option"
Text = ("")
Picture = Picture["icon:/small/options"]
Toggle = True
}
{ ToolButton9 ToolButton
MoveScaled(28,0,4,4)
Visible = False
ToolTip = ("Shortcuts")
Action = "shortcut"
Text = ("")
Picture = Picture["icon:/small/shortcut"]
}
{ Separator3 Separator
MoveScaled(32,0,1,4)
}
{ btnTranslate ToolButton
MoveScaled(34,0,4,4)
ToolTip = ("Translate")
Action = "translate"
Text = ("")
Picture = Picture["icon:/small/language"]
}
{ ToolButton4 ToolButton
MoveScaled(38,0,4,4)
Visible = False
ToolTip = ("Make source archive")
Action = "archive"
Text = ("")
Picture = Picture["icon:/small/archive"]
}
{ ToolButton5 ToolButton
MoveScaled(42,0,4,4)
ToolTip = ("Make executable")
Action = "exec"
Text = ("")
Picture = Picture["icon:/small/exec"]
}
{ ToolButton14 ToolButton
MoveScaled(46,0,4,4)
Visible = False
ToolTip = ("Make installation package")
Action = "install"
Text = ("")
Picture = Picture["icon:/small/package"]
}
{ Separator2 Separator
MoveScaled(50,0,1,4)
}
{ ToolButton6 ToolButton
MoveScaled(53,0,4,4)
Visible = False
ToolTip = ("Project")
Action = "project"
Text = ("")
Toggle = True
Value = True
}
{ ToolButton8 ToolButton
MoveScaled(57,0,4,4)
Visible = False
ToolTip = ("Properties sheet")
Action = "property"
Text = ("")
Picture = Picture["icon:/small/edit"]
Toggle = True
}
{ ToolButton10 ToolButton
MoveScaled(61,0,4,4)
Visible = False
ToolTip = ("Toolbox")
Action = "control"
Text = ("")
Picture = Picture["icon:/small/tools"]
Toggle = True
}
{ btnShowConsole ToolButton
MoveScaled(65,0,4,4)
Visible = False
ToolTip = ("Console")
Action = "console"
Text = ("")
Picture = Picture["icon:/small/terminal"]
Toggle = True
}
{ ToolButton11 ToolButton
MoveScaled(69,0,4,4)
ToolTip = ("Find & replace")
Action = "find"
Text = ("")
Picture = Picture["icon:/small/find"]
Toggle = True
}
{ Separator4 Separator
MoveScaled(74,0,1,4)
}
{ btnCompile ToolButton
MoveScaled(75,0,4,4)
ToolTip = ("Compile")
Action = "compile"
Text = ("")
Picture = Picture["icon:/small/make"]
}
{ btnCompileAll ToolButton
MoveScaled(79,0,4,4)
ToolTip = ("Compile all")
Action = "compile-all"
Text = ("")
Picture = Picture["icon:/small/make-all"]
}
{ btnGo ToolButton
MoveScaled(83,0,4,4)
ToolTip = ("Run")
Action = "start"
Text = ("")
Picture = Picture["icon:/small/play"]
}
{ btnPause ToolButton
MoveScaled(87,0,4,4)
ToolTip = ("Pause")
Action = "pause"
Text = ("")
Picture = Picture["icon:/small/pause"]
}
{ btnStop ToolButton
MoveScaled(91,0,4,4)
ToolTip = ("Stop")
Action = "stop"
Text = ("")
Picture = Picture["icon:/small/stop"]
}
{ btnStep ToolButton
MoveScaled(95,0,4,4)
ToolTip = ("Step")
Action = "step"
Text = ("")
Picture = Picture["icon:/small/end"]
}
{ btnForward ToolButton
MoveScaled(99,0,4,4)
ToolTip = ("Forward")
Action = "forward"
Text = ("")
Picture = Picture["icon:/small/forward"]
}
{ btnFrom ToolButton
MoveScaled(103,0,4,4)
ToolTip = ("Finish current function")
Action = "return"
Text = ("")
Picture = Picture["icon:/small/top"]
}
{ btnUntil ToolButton mnuUntil
Name = "btnUntil"
MoveScaled(107,0,4,4)
ToolTip = ("Run until current line")
Action = "until"
Text = ("")
Picture = Picture["icon:/small/last"]
}
{ btnWatch ToolButton mnuWatch
Name = "btnWatch"
MoveScaled(111,0,4,4)
ToolTip = ("Watch expression")
Action = "watch"
Text = ("")
Picture = Picture["icon:/small/watch"]
}
{ btnBreakpoint ToolButton
MoveScaled(115,0,4,4)
ToolTip = ("Toggle breakpoint")
Action = "break"
Text = ("")
Picture = Picture["icon:/small/flag"]
Toggle = True
}
{ btnShowMenu ToolButton
MoveScaled(119,0,4,4)
ToolTip = ("Show menu bar")
Action = "hide-menubar"
Text = ("")
}
}
}
# Gambas Action File 3.0
{ Actions
{ Action archive
Text = "Make source archive"
Picture = "icon:/small/archive"
}
{ Action break
Text = "Toggle breakpoint"
Picture = "icon:/small/flag"
}
{ Action compile
Text = "Compile"
Picture = "icon:/small/make"
}
{ Action compile-all
Text = "Compile all"
Picture = "icon:/small/make-all"
}
{ Action console
Text = "Console"
Picture = "icon:/small/terminal"
}
{ Action control
Text = "Toolbox"
Picture = "icon:/small/tools"
}
{ Action exec
Text = "Make executable"
Picture = "icon:/small/exec"
}
{ Action find
Text = "Find & replace"
Picture = "icon:/small/find"
}
{ Action forward
Text = "Forward"
Picture = "icon:/small/forward"
}
{ Action hide-menubar
Text = "Show menu bar"
Picture = "$ToolButton"
}
{ Action install
Text = "Make installation package"
Picture = "icon:/small/package"
}
{ Action new-project
Text = "New project"
Picture = "icon:/small/new"
}
{ Action open-project
Text = "Open project"
Picture = "icon:/small/open"
}
{ Action option
Text = "Preferences"
Picture = "icon:/small/options"
}
{ Action pause
Text = "Pause"
Picture = "icon:/small/pause"
}
{ Action project
Text = "Project"
Picture = "$ToolButton"
}
{ Action project-property
Text = "Project properties"
Picture = "icon:/small/properties"
}
{ Action property
Text = "Properties sheet"
Picture = "icon:/small/edit"
}
{ Action refresh-project
Text = "Refresh project"
Picture = "icon:/small/refresh"
}
{ Action return
Text = "Finish current function"
Picture = "icon:/small/top"
}
{ Action save-project
Text = "Save project"
Picture = "icon:/small/save"
}
{ Action save-project-as
Text = "Save project as"
Picture = "icon:/small/save-as"
}
{ Action shortcut
Text = "Shortcuts"
Picture = "icon:/small/shortcut"
}
{ Action start
Text = "Run"
Picture = "icon:/small/play"
}
{ Action step
Text = "Step"
Picture = "icon:/small/end"
}
{ Action stop
Text = "Stop"
Picture = "icon:/small/stop"
}
{ Action translate
Text = "Translate"
Picture = "icon:/small/language"
}
{ Action until
Text = "Run until current line"
Picture = "icon:/small/last"
}
{ Action watch
Text = "Watch expression"
Picture = "icon:/small/watch"
}
}
{ Toolbars
{ Toolbar main
Text = ""
List = "new-project,open-project,save-project,save-project-as,project-property,refresh-project,option,shortcut,translate,archive,exec,install,project,property,control,console,find,compile,compile-all,start,pause,stop,step,forward,return,until,watch,break,hide-menubar"
Default = "new-project,open-project,save-project,save-project-as,project-property,option,|,translate,exec,|,find,|,compile,compile-all,start,pause,stop,step,forward,return,until,watch,break,hide-menubar"
}
}

View file

@ -359,8 +359,8 @@ End
Public Sub dwgHandle_MouseUp()
If $bDesign Then Return
$bPressed = False
If $bInside Then
$bPressed = False
dwgHandle.Refresh
If ToolbarKey Then Action.ConfigureToolbar(Me.Parent)
Endif
@ -485,10 +485,10 @@ Public Sub SetConfigureMode(bConfigure As Boolean)
hChild.Drop = $bConfigure
Next
Me.Drop = $bConfigure
panToolBar.Enabled = Not $bConfigure
'Debug "**** panToolbar.Enabled = "; panToolBar.Enabled
dwgHandle.Enabled = Not $bConfigure
panToolBar.Enabled = Not $bConfigure
dwgHandle.Enabled = Not $bConfigure
Lock()
If $bConfigure Then
$aHidden = New Control[]
@ -986,9 +986,10 @@ Public Sub LoadConfig(Optional bInit As Boolean)
hCtrl = FindControl(sAction)
If hCtrl Then
'Print "--> Reparent to panToolbar"
bVisible = hCtrl.Visible
'bVisible = hCtrl.Visible
hCtrl.Reparent(panToolBar)
hCtrl.Raise
If bInit Then hCtrl.Show
'If hCtrl.Visible <> bVisible Then Debug "**** VISIBLE CHANGED FOR "; sAction
Endif
Endif
@ -1127,6 +1128,7 @@ End
Public Sub SetIconSize(iSize As Integer)
If $iIconSize = iSize Then Return
$iIconSize = iSize
SaveConfig
LoadConfig

View file

@ -9,28 +9,28 @@
Margin = True
{ lblTitle Label
MoveScaled(1,1,28,3)
Font = Font["Bold"]
Font = Font["Bold,+4"]
AutoResize = True
Text = ("Main toolbar")
}
{ HBox1 HBox
MoveScaled(1,5,53,4)
MoveScaled(1,9,53,4)
{ Label1 Label
MoveScaled(1,0,10,4)
Expand = True
AutoResize = True
Text = ("Icon size")
}
{ Panel2 Panel
MoveScaled(20,0,2,4)
}
{ cmbSize ComboBox
MoveScaled(31,0,22,4)
Expand = True
Text = ("")
ReadOnly = True
List = [("Small"), ("Medium"), ("Large")]
}
}
{ Label2 Label
MoveScaled(1,10,28,3)
Font = Font["Bold"]
Text = ("Actions")
}
{ panAction Panel
MoveScaled(1,15,53,30)
Drop = True

View file

@ -31,6 +31,12 @@ Public Sub _new()
End
Public Sub Configure()
Action.ConfigureToolbar(Me)
End
' PRIVATE FUNCTION Arrangement_Read() AS Integer
'
' RETURN Arrange.LeftRight