From 57764a966b8199a6c3e666a1d6be34f3cb545aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Thu, 20 Sep 2012 13:55:47 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Indent & unident buttons now work in text editors. git-svn-id: svn://localhost/gambas/trunk@5178 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 8 ++++---- app/src/gambas3/.src/CCoolButton.class | 9 +++++++-- app/src/gambas3/.src/Editor/Other/FTextEditor.class | 13 +++++++++++++ app/src/gambas3/.src/Editor/Other/FTextEditor.form | 4 +++- app/src/gambas3/.src/Welcome/FWelcome.class | 3 +++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 76a9fa944..7157cedc9 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -326,7 +326,7 @@ msgstr "" msgid "Loading information on component &1..." msgstr "" -#: CInsertColor.class:106 FEditor.form:419 FTextEditor.form:348 +#: CInsertColor.class:106 FEditor.form:419 FTextEditor.form:350 msgid "Insert color" msgstr "" @@ -632,12 +632,12 @@ msgid "Redo" msgstr "" #: FCommit.form:121 FConflict.form:83 FEditor.form:453 FMenu.form:129 -#: FTextEditor.form:325 +#: FTextEditor.form:326 msgid "Indent" msgstr "" #: FCommit.form:127 FConflict.form:89 FEditor.form:461 FMenu.form:135 -#: FTextEditor.form:332 +#: FTextEditor.form:334 msgid "Unindent" msgstr "" @@ -1526,7 +1526,7 @@ msgstr "" msgid "Watch expression" msgstr "" -#: FEditor.form:555 FTextEditor.form:414 +#: FEditor.form:555 FTextEditor.form:416 msgid "Procedure list" msgstr "" diff --git a/app/src/gambas3/.src/CCoolButton.class b/app/src/gambas3/.src/CCoolButton.class index 1ed2e3679..df1e7e225 100644 --- a/app/src/gambas3/.src/CCoolButton.class +++ b/app/src/gambas3/.src/CCoolButton.class @@ -53,7 +53,7 @@ Public Sub Panel_Draw() Endif Draw.Picture($hPict, 8, ($hPanel.H - $hPict.H) \ 2) - If $bInside Then Draw.Foreground = Color.Gradient($hPanel.Foreground, $iHighlight) + 'If $bInside Then Draw.Foreground = Color.Gradient($hPanel.Foreground, $iHighlight) Draw.Text($sText, $hPict.W + 16, 0, $hPanel.W - $hPict.W - 24, $hPanel.H, Align.Normal) ' If $bArrow Then @@ -61,7 +61,7 @@ Public Sub Panel_Draw() ' 'Draw.Style.Arrow(Draw.W - 32, (Draw.H - 32) \ 2, 32, 32, Align.Right) ' Endif - If $hPanel.HasFocus Then + If $bInside Then Paint.Begin(Draw.Device) Paint.Rectangle(0, 0, Paint.W, Paint.H) Paint.Brush = Paint.Color(Color.SetAlpha($iHighlight, 192)) @@ -70,6 +70,11 @@ Public Sub Panel_Draw() Paint.End Endif + If $hPanel.HasFocus Then + Draw.Foreground = $iHighlight + Draw.Rect(2, 2, Draw.W - 4, Draw.H - 4) + Endif + End diff --git a/app/src/gambas3/.src/Editor/Other/FTextEditor.class b/app/src/gambas3/.src/Editor/Other/FTextEditor.class index 4abc82953..842f25d34 100644 --- a/app/src/gambas3/.src/Editor/Other/FTextEditor.class +++ b/app/src/gambas3/.src/Editor/Other/FTextEditor.class @@ -1082,3 +1082,16 @@ Public Sub Form_Open() SetReadOnly End + +Public Sub btnIndent_Click() + + Editor.Indent + +End + +Public Sub btnUnindent_Click() + + Editor.Unindent + +End + diff --git a/app/src/gambas3/.src/Editor/Other/FTextEditor.form b/app/src/gambas3/.src/Editor/Other/FTextEditor.form index dfcc77eb9..d94eea84a 100644 --- a/app/src/gambas3/.src/Editor/Other/FTextEditor.form +++ b/app/src/gambas3/.src/Editor/Other/FTextEditor.form @@ -218,12 +218,14 @@ } { btnIndent ToolButton MoveScaled(25,0,4,4) + Visible = False ToolTip = ("Indent") Action = ".indent" Picture = Picture["icon:/small/indent"] } { btnUnindent ToolButton MoveScaled(28,0,4,4) + Visible = False ToolTip = ("Unindent") Action = ".unindent" Picture = Picture["icon:/small/unindent"] @@ -453,6 +455,6 @@ { Toolbar text Text = "Text editor" List = "save,reload,cut,show-class,copy,paste,undo,redo,indent,unindent,bookmark,color,compress,uncompress,view-nosplit,view-hsplit,view-vsplit,proc" - Default = "save,reload,show-class,undo,redo,indent,unindent,bookmark,color,|,compress,uncompress,|,|,proc,$lblInfo" + Default = "save,reload,show-class,undo,redo,bookmark,color,|,compress,uncompress,|,|,proc,$lblInfo" } } diff --git a/app/src/gambas3/.src/Welcome/FWelcome.class b/app/src/gambas3/.src/Welcome/FWelcome.class index bf058dcc3..bbf4a9c06 100644 --- a/app/src/gambas3/.src/Welcome/FWelcome.class +++ b/app/src/gambas3/.src/Welcome/FWelcome.class @@ -103,6 +103,7 @@ End Public Sub btnNew_Click() $sPath = FCreateProject.Run() + txtFilter.SetFocus If $sPath Then Me.Close End @@ -111,6 +112,7 @@ End Public Sub btnOpen_Click() $sPath = FOpenProject.Run() + txtFilter.SetFocus If $sPath Then Me.Close End @@ -570,6 +572,7 @@ End Public Sub btnAbout_Click() FAbout.Run + txtFilter.SetFocus End