[CONFIGURATION]

* NEW: Switch version to 3.0.90.

[DEVELOPMENT ENVIRONMENT]
* BUG: Fix form editor undo management.
* BUG: The menu editor changes are now correctly taken into account by the 
  undo management.

[GB.FORM]
* NEW: Little fix in TabPanel button layout.


git-svn-id: svn://localhost/gambas/trunk@4393 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-01-07 02:16:31 +00:00
parent 2a777ba169
commit 2b560f91ec
9 changed files with 68 additions and 34 deletions

View File

@ -64,12 +64,12 @@ AC_DEFUN([GB_PRINT_MESSAGES],
AC_DEFUN([GB_INIT_AUTOMAKE],
[
AM_INIT_AUTOMAKE($1, 3.0.0)
AM_INIT_AUTOMAKE($1, 3.0.90)
##AM_SILENT_RULES([yes])
AM_CONFIG_HEADER([config.h])
AC_DEFINE(GAMBAS_FULL_VERSION, 0x03000000, [Full Gambas version])
AC_DEFINE(GAMBAS_FULL_VERSION, 0x03000090, [Full Gambas version])
AC_DEFINE(GAMBAS_PCODE_VERSION, 0x03010000, [Gambas bytecode version])
AC_DEFINE(GAMBAS_PCODE_VERSION_MIN, 0x03000000, [Gambas bytecode version])
AC_DEFINE(GAMBAS_PCODE_VERSION_MIN, 0x03000000, [Minimum Gambas bytecode version])
GB_CLEAR_MESSAGES
])

View File

@ -366,8 +366,8 @@ msgstr ""
#: CWaitingAnimation.class:56 FColorChooser.form:60 FCommit.form:229
#: FConflict.class:191 FConnectionEditor.class:295 FCreateFile.form:436
#: FDebugInfo.form:218 FEditor.class:2379 FExportData.class:126
#: FFieldChooser.form:138 FFontChooser.form:40 FForm.class:3119
#: FDebugInfo.form:218 FEditor.class:2381 FExportData.class:126
#: FFieldChooser.form:138 FFontChooser.form:40 FForm.class:3129
#: FGotoLine.form:23 FHelpBrowser.form:61 FIconEditor.class:1415
#: FList.form:121 FMain.class:200 FMakeInstall.class:327 FMenu.form:378
#: FNewConnection.form:243 FNewTable.form:86 FNewTranslation.form:21
@ -1433,14 +1433,14 @@ msgstr ""
msgid "Procedure list"
msgstr ""
#: FEditor.class:2379 FIconEditor.class:2048 FTextEditor.class:495
#: FEditor.class:2381 FIconEditor.class:2048 FTextEditor.class:495
msgid ""
"The file has been modified.\n"
"\n"
"All your changes will be lost."
msgstr ""
#: FEditor.class:2808
#: FEditor.class:2810
msgid "(Declarations)"
msgstr ""
@ -1723,11 +1723,11 @@ msgstr ""
msgid "Bad form file"
msgstr ""
#: FForm.class:1286
#: FForm.class:1296
msgid "Component missing for control &1"
msgstr ""
#: FForm.class:3119
#: FForm.class:3129
msgid ""
"The form has been modified.\n"
"\n"
@ -2957,23 +2957,23 @@ msgstr ""
msgid "Ignore"
msgstr ""
#: FMenu.class:297
#: FMenu.class:300
msgid "Please enter a menu name."
msgstr ""
#: FMenu.class:303
#: FMenu.class:306
msgid "Bad menu name !"
msgstr ""
#: FMenu.class:309
#: FMenu.class:312
msgid "Bad group name !"
msgstr ""
#: FMenu.class:569
#: FMenu.class:572
msgid "This menu is too deep !"
msgstr ""
#: FMenu.class:944 Project.module:5089
#: FMenu.class:947 Project.module:5089
msgid "modified"
msgstr ""

View File

@ -7,10 +7,12 @@ End Struct
Private Const DEBUG_ME As Boolean = False
Private Enum CONTEXT_NONE, CONTEXT_UNDO, CONTEXT_REDO
Private $aUndo As New UndoCommand[]
Private $aRedo As New UndoCommand[]
Private $iDisabled As Integer
Private $bInvert As Boolean
Private $iContext As Integer
Private Const CMD_BEGIN As String = "[["
Private Const CMD_END As String = "]]"
@ -41,12 +43,13 @@ Public Sub Add(sCommand As String, Optional aArg As Variant[])
hCommand.Command = sCommand
hCommand.Arg = aArg
If $bInvert Then
If $iContext = CONTEXT_UNDO Then
$aRedo.Add(hCommand)
If DEBUG_ME Then Print "Redo: ";
Else
$aUndo.Add(hCommand)
If DEBUG_ME Then Print "Undo: ";
If $iContext = CONTEXT_NONE Then $aRedo.Clear
Endif
If DEBUG_ME Then Dump(hCommand)
@ -67,7 +70,7 @@ Public Sub End()
If $iDisabled Then Return
If $bInvert Then
If $iContext = CONTEXT_UNDO Then
aCmd = $aRedo
Else
aCmd = $aUndo
@ -90,12 +93,14 @@ Public Sub Undo(hEditor As Object, Optional bRedo As Boolean)
Dim aCmd As UndoCommand[]
If $iDisabled Then Return
If $iContext Then Return
If bRedo Then
aCmd = $aRedo
$iContext = CONTEXT_REDO
Else
aCmd = $aUndo
$bInvert = Not $bInvert
$iContext = CONTEXT_UNDO
Endif
Begin()
@ -127,13 +132,14 @@ Public Sub Undo(hEditor As Object, Optional bRedo As Boolean)
End()
If Not bRedo Then $bInvert = Not $bInvert
$iContext = CONTEXT_NONE
End
Public Sub Redo(hEditor As Object)
If $iDisabled Then Return
If $iContext Then Return
Undo(hEditor, True)
End

View File

@ -678,11 +678,13 @@ Private Function InsertFunction(sProc As String, sType As String, bPublic As Boo
sPublic = If(bPublic, "Public", "Private")
sStatic = If(bStatic, "Static ", "")
Editor.Goto(iLine, 0)
If sType Then
Editor.Insert("\n" & sStatic & sPublic & " FUNCTION " & sProc & "(" & sSign & ") AS " & sType & "\n\n" & Space$(Project.TabSize) & "\n\nEND\n", iLine, 0)
Editor.Insert("\n" & sStatic & sPublic & " FUNCTION " & sProc & "(" & sSign & ") AS " & sType & "\n\n" & Space$(Project.TabSize) & "\n\nEND\n")
Else
Editor.Insert("\n" & sStatic & sPublic & " SUB " & sProc & "(" & sSign & ")\n\n" & Space$(Project.TabSize) & "\n\nEND\n", iLine, 0)
Editor.Insert("\n" & sStatic & sPublic & " SUB " & sProc & "(" & sSign & ")\n\n" & Space$(Project.TabSize) & "\n\nEND\n")
Endif
Editor.End

View File

@ -962,6 +962,7 @@ Public Sub Select(hForm As FForm, Optional bMaster As Boolean)
Dim hPanel As Panel
If IsNull(Parent) Then Return
If Kind = "Menu" Then Return
If Selected Then
UnSelect(hForm)

View File

@ -896,13 +896,18 @@ Public Sub Control_MouseDown()
Me.SetFocus
Project.SetCurrentPopup(mnuForm)
$hUndo.Begin
'DrawControlFrame(Null)
X = Mouse.X
Y = Mouse.Y
$hCurrent = Control[Last.Tag]
If $hCurrent = RootControl And If Y < RootControl.Control.ClientY Then
$hCurrent = Null
Return
Endif
$sTool = FToolBox.GetTool()
$X = Last.X
@ -910,6 +915,8 @@ Public Sub Control_MouseDown()
$MX = Last.ScreenX + X
$MY = Last.ScreenY + Y
$hUndo.Begin
'IF $hCurrent.Kind = "GridView" THEN
' PRINT "MouseDown: $X ="; $X; " $Y ="; $Y; " $MX ="; $MX; " $MY ="; $MY
' PRINT "X ="; X; " Y ="; Y
@ -1002,6 +1009,7 @@ Public Sub Control_MouseMove()
'Debug Last;; Mouse.ScreenX - hForm.Control.ScreenX;; Mouse.ScreenY - hForm.Control.ScreenY
If Not Mouse.Left Then Return
If Not $hCurrent Then Return
'PRINT "Control_MouseMove Mode ="; $iMode
@ -1123,6 +1131,8 @@ Public Sub Control_MouseUp()
Dim hPrevious As CControl
Dim sFocus As String
If Not $hCurrent Then Return
'PRINT "Control_MouseUp Mode ="; $iMode
If $iMode = MODE_CREATE Then
@ -1375,7 +1385,7 @@ Public Sub RemoveControl(sName As String)
$hUndo.Add("PutSelection", [sCtrl, hCCtrl.Parent.Name])
Endif
Control[sName].Delete
hCCtrl.Delete
Modify
'PRINT "< RemoveControl "; sName; " "; Control[sName]
@ -3701,3 +3711,15 @@ Public Sub Form_Close()
$hUndo = Null
End
Public Sub ClearMenus()
AllMenus.Clear
End
Public Sub RestoreMenus()
$hUndo.Add("ClearMenus")
End

View File

@ -203,12 +203,13 @@ Private Sub SaveAllMenu()
Dim iLevel As Integer
Dim sText As String
$hForm.GetUndo().Begin
For Each hCtrl In $hForm.AllMenus
'cDelete.Add(hCtrl)
hCtrl.Delete
$hForm.RemoveControl(hCtrl.Name)
Next
If $hForm.AllMenus.Count Then $hForm.Modify
$hForm.GetUndo().Add("RestoreMenus")
$hForm.AllMenus.Clear
hCtrl = $hForm.Control[$hForm.Name]
@ -255,6 +256,8 @@ Private Sub SaveAllMenu()
$hForm.UpdateBorder
$hForm.GetUndo().End
$bModified = False
End

View File

@ -1,5 +1,5 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.0.0
# Compiled with Gambas 3.0.90
Title=More controls for graphical components
Startup=FMain
Version=3.0.0

View File

@ -126,14 +126,14 @@ Public Sub UpdateLayout()
Select Case $iOrientation
Case Align.Left, Align.Right
S = Me.Parent.Font.TextWidth($sText) + 8
If $hPicture Then S += $hPicture.W
If bClosable Then S += BUTTON_SIZE
S = Me.Parent.Font.TextWidth($sText) + 16
If $hPicture Then S += $hPicture.W - 4
If bClosable Then S += BUTTON_SIZE - 4
Me.H = S
Case Else
S = Me.Parent.Font.TextWidth($sText) + 8
If $hPicture Then S += $hPicture.W
If bClosable Then S += BUTTON_SIZE
S = Me.Parent.Font.TextWidth($sText) + 16
If $hPicture Then S += $hPicture.W - 4
If bClosable Then S += BUTTON_SIZE - 4
Me.W = S
End Select