[DEVELOPMENT ENVIRONMENT]

* NEW: Form editor selection frame is now drawn with controls, because
  drawing directly on a form is not possible anymore with qt4.
* BUG: "Update all forms" menu entry works again.


git-svn-id: svn://localhost/gambas/trunk@1397 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2008-06-01 22:18:31 +00:00
parent d7f48d3487
commit a660249f58
10 changed files with 3341 additions and 3355 deletions

View file

@ -579,7 +579,7 @@ msgstr "Libre"
#: FColorChooser.class:203 FCommit.class:292 FConflict.class:191 #: FColorChooser.class:203 FCommit.class:292 FConflict.class:191
#: FCreateFile.class:826 FDebugInfo.class:342 FEditor.class:2080 #: FCreateFile.class:826 FDebugInfo.class:342 FEditor.class:2080
#: FFindList.class:159 FFind.class:115 FFontChooser.class:86 FForm.class:2594 #: FFindList.class:159 FFind.class:115 FFontChooser.class:86 FForm.class:2636
#: FGotoLine.class:63 FIconEditor.class:1387 FList.class:107 FMain.class:202 #: FGotoLine.class:63 FIconEditor.class:1387 FList.class:107 FMain.class:202
#: FMakeExecutable.class:152 FMakeInstall.class:278 FMenu.class:1081 #: FMakeExecutable.class:152 FMakeInstall.class:278 FMenu.class:1081
#: FNewTranslation.class:70 FOpenProject.class:408 FPropertyProject.class:1150 #: FNewTranslation.class:70 FOpenProject.class:408 FPropertyProject.class:1150
@ -620,27 +620,27 @@ msgstr "Mot de passe"
msgid "Changes description" msgid "Changes description"
msgstr "Description des modifications" msgstr "Description des modifications"
#: FCommit.class:208 FConflict.class:327 FEditor.class:2826 FForm.class:3056 #: FCommit.class:208 FConflict.class:327 FEditor.class:2826 FForm.class:3102
#: FIconEditor.class:2161 FOutput.class:396 FTextEditor.class:769 #: FIconEditor.class:2161 FOutput.class:396 FTextEditor.class:769
msgid "Cut" msgid "Cut"
msgstr "Couper" msgstr "Couper"
#: FCommit.class:215 FConflict.class:334 FEditor.class:2832 FForm.class:3063 #: FCommit.class:215 FConflict.class:334 FEditor.class:2832 FForm.class:3109
#: FIconEditor.class:2170 FOutput.class:403 FTextEditor.class:775 #: FIconEditor.class:2170 FOutput.class:403 FTextEditor.class:775
msgid "Copy" msgid "Copy"
msgstr "Copier" msgstr "Copier"
#: FCommit.class:222 FConflict.class:341 FEditor.class:2838 FForm.class:3070 #: FCommit.class:222 FConflict.class:341 FEditor.class:2838 FForm.class:3116
#: FIconEditor.class:2179 FOutput.class:410 FTextEditor.class:781 #: FIconEditor.class:2179 FOutput.class:410 FTextEditor.class:781
msgid "Paste" msgid "Paste"
msgstr "Coller" msgstr "Coller"
#: FCommit.class:229 FConflict.class:348 FEditor.class:2810 FForm.class:3292 #: FCommit.class:229 FConflict.class:348 FEditor.class:2810 FForm.class:3338
#: FIconEditor.class:2143 FOption.class:1075 FTextEditor.class:753 #: FIconEditor.class:2143 FOption.class:1075 FTextEditor.class:753
msgid "Undo" msgid "Undo"
msgstr "Annuler" msgstr "Annuler"
#: FCommit.class:236 FConflict.class:355 FEditor.class:2816 FForm.class:3301 #: FCommit.class:236 FConflict.class:355 FEditor.class:2816 FForm.class:3347
#: FTextEditor.class:759 #: FTextEditor.class:759
msgid "Redo" msgid "Redo"
msgstr "Rétablir" msgstr "Rétablir"
@ -781,7 +781,7 @@ msgstr "Module"
msgid "Class" msgid "Class"
msgstr "Classe" msgstr "Classe"
#: FCreateFile.class:585 FEditor.class:2962 FForm.class:2972 FInfo.class:84 #: FCreateFile.class:585 FEditor.class:2962 FForm.class:3018 FInfo.class:84
msgid "Form" msgid "Form"
msgstr "Formulaire" msgstr "Formulaire"
@ -1092,7 +1092,7 @@ msgstr ""
"\n" "\n"
"Toutes les modifications seront perdues." "Toutes les modifications seront perdues."
#: FEditor.class:2080 FForm.class:2594 FIconEditor.class:2026 #: FEditor.class:2080 FForm.class:2636 FIconEditor.class:2026
#: FTextEditor.class:588 FTranslate.class:645 #: FTextEditor.class:588 FTranslate.class:645
msgid "Reload" msgid "Reload"
msgstr "Recharger" msgstr "Recharger"
@ -1177,7 +1177,7 @@ msgstr "Séparation horizontale"
msgid "Vertical split" msgid "Vertical split"
msgstr "Séparation verticale" msgstr "Séparation verticale"
#: FEditor.class:2934 FForm.class:3202 FIconEditor.class:1406 #: FEditor.class:2934 FForm.class:3248 FIconEditor.class:1406
#: FTextEditor.class:856 #: FTextEditor.class:856
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
@ -1270,7 +1270,7 @@ msgstr "Choisissez une police"
msgid "Bad form file" msgid "Bad form file"
msgstr "Le fichier formulaire contient une erreur" msgstr "Le fichier formulaire contient une erreur"
#: FForm.class:2594 #: FForm.class:2636
msgid "" msgid ""
"The form has been modified.\n" "The form has been modified.\n"
"\n" "\n"
@ -1280,167 +1280,167 @@ msgstr ""
"\n" "\n"
"Tous vos changements seront perdus." "Tous vos changements seront perdus."
#: FForm.class:2976 FIconEditor.class:2249 #: FForm.class:3022 FIconEditor.class:2249
msgid "Select" msgid "Select"
msgstr "Sélectionner" msgstr "Sélectionner"
#: FForm.class:2981 #: FForm.class:3027
msgid "Event" msgid "Event"
msgstr "Evènement" msgstr "Evènement"
#: FForm.class:2987 #: FForm.class:3033
msgid "Change into" msgid "Change into"
msgstr "Transformer en" msgstr "Transformer en"
#: FForm.class:2993 #: FForm.class:3039
msgid "Open code" msgid "Open code"
msgstr "Ouvrir le code" msgstr "Ouvrir le code"
#: FForm.class:3004 #: FForm.class:3050
msgid "Move tab" msgid "Move tab"
msgstr "Déplacer l'onglet" msgstr "Déplacer l'onglet"
#: FForm.class:3009 #: FForm.class:3055
msgid "&First" msgid "&First"
msgstr "&Début" msgstr "&Début"
#: FForm.class:3016 FTips.class:220 #: FForm.class:3062 FTips.class:220
msgid "&Previous" msgid "&Previous"
msgstr "&Précédent" msgstr "&Précédent"
#: FForm.class:3023 FMenu.class:808 FTips.class:226 #: FForm.class:3069 FMenu.class:808 FTips.class:226
msgid "&Next" msgid "&Next"
msgstr "&Suivant" msgstr "&Suivant"
#: FForm.class:3030 #: FForm.class:3076
msgid "&Last" msgid "&Last"
msgstr "&Fin" msgstr "&Fin"
#: FForm.class:3041 #: FForm.class:3087
msgid "Select all" msgid "Select all"
msgstr "Sélectionner tout" msgstr "Sélectionner tout"
#: FForm.class:3046 #: FForm.class:3092
msgid "Unselect all" msgid "Unselect all"
msgstr "Déselectionner tout" msgstr "Déselectionner tout"
#: FForm.class:3077 FMain.class:202 FTranslate.class:551 #: FForm.class:3123 FMain.class:202 FTranslate.class:551
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
#: FForm.class:3087 #: FForm.class:3133
msgid "Arrangement" msgid "Arrangement"
msgstr "Disposition" msgstr "Disposition"
#: FForm.class:3091 #: FForm.class:3137
msgid "Bring to foreground" msgid "Bring to foreground"
msgstr "Au premier plan" msgstr "Au premier plan"
#: FForm.class:3098 #: FForm.class:3144
msgid "Send to background" msgid "Send to background"
msgstr "A l'arrière-plan" msgstr "A l'arrière-plan"
#: FForm.class:3109 #: FForm.class:3155
msgid "Horizontal" msgid "Horizontal"
msgstr "Horizontal" msgstr "Horizontal"
#: FForm.class:3116 #: FForm.class:3162
msgid "Rows" msgid "Rows"
msgstr "Lignes" msgstr "Lignes"
#: FForm.class:3123 #: FForm.class:3169
msgid "Vertical" msgid "Vertical"
msgstr "Vertical" msgstr "Vertical"
#: FForm.class:3130 #: FForm.class:3176
msgid "Columns" msgid "Columns"
msgstr "Colonnes" msgstr "Colonnes"
#: FForm.class:3137 #: FForm.class:3183
msgid "Alignment" msgid "Alignment"
msgstr "Alignement" msgstr "Alignement"
#: FForm.class:3141 #: FForm.class:3187
msgid "Align to &left" msgid "Align to &left"
msgstr "Aligner sur la &gauche" msgstr "Aligner sur la &gauche"
#: FForm.class:3147 #: FForm.class:3193
msgid "Align to &right" msgid "Align to &right"
msgstr "Aligner sur la &droite" msgstr "Aligner sur la &droite"
#: FForm.class:3153 #: FForm.class:3199
msgid "Align to &top" msgid "Align to &top"
msgstr "Aligner sur le &haut" msgstr "Aligner sur le &haut"
#: FForm.class:3159 #: FForm.class:3205
msgid "Align to &bottom" msgid "Align to &bottom"
msgstr "Aligner sur le &bas" msgstr "Aligner sur le &bas"
#: FForm.class:3169 #: FForm.class:3215
msgid "Same &width" msgid "Same &width"
msgstr "Même &largeur" msgstr "Même &largeur"
#: FForm.class:3175 #: FForm.class:3221
msgid "Same &height" msgid "Same &height"
msgstr "Même hau&teur" msgstr "Même hau&teur"
#: FForm.class:3186 #: FForm.class:3232
msgid "Menu editor..." msgid "Menu editor..."
msgstr "Editeur de menu..." msgstr "Editeur de menu..."
#: FForm.class:3237 #: FForm.class:3283
msgid "Code" msgid "Code"
msgstr "Code" msgstr "Code"
#: FForm.class:3245 #: FForm.class:3291
msgid "Lock form" msgid "Lock form"
msgstr "Verrouiller le formulaire" msgstr "Verrouiller le formulaire"
#: FForm.class:3308 FMenu.class:26 #: FForm.class:3354 FMenu.class:26
msgid "Menu editor" msgid "Menu editor"
msgstr "Editeur de menu" msgstr "Editeur de menu"
#: FForm.class:3316 #: FForm.class:3362
msgid "Toggle grid" msgid "Toggle grid"
msgstr "Bascule l'affichage de la grille" msgstr "Bascule l'affichage de la grille"
#: FForm.class:3346 #: FForm.class:3392
msgid "Align to top" msgid "Align to top"
msgstr "Aligner sur le haut" msgstr "Aligner sur le haut"
#: FForm.class:3354 #: FForm.class:3400
msgid "Align to bottom" msgid "Align to bottom"
msgstr "Aligner sur le bas" msgstr "Aligner sur le bas"
#: FForm.class:3362 #: FForm.class:3408
msgid "Align to left" msgid "Align to left"
msgstr "Aligner sur la gauche" msgstr "Aligner sur la gauche"
#: FForm.class:3370 #: FForm.class:3416
msgid "Align to right" msgid "Align to right"
msgstr "Aligner sur la droite" msgstr "Aligner sur la droite"
#: FForm.class:3378 #: FForm.class:3424
msgid "Same width" msgid "Same width"
msgstr "Même largeur" msgstr "Même largeur"
#: FForm.class:3386 #: FForm.class:3432
msgid "Same height" msgid "Same height"
msgstr "Même hauteur" msgstr "Même hauteur"
#: FForm.class:3431 #: FForm.class:3477
msgid "Move tab first" msgid "Move tab first"
msgstr "Déplacer l'onglet au début" msgstr "Déplacer l'onglet au début"
#: FForm.class:3439 #: FForm.class:3485
msgid "Move tab left" msgid "Move tab left"
msgstr "Déplacer l'onglet à gauche" msgstr "Déplacer l'onglet à gauche"
#: FForm.class:3447 #: FForm.class:3493
msgid "Move tab right" msgid "Move tab right"
msgstr "Déplacer l'onglet à droite" msgstr "Déplacer l'onglet à droite"
#: FForm.class:3455 #: FForm.class:3501
msgid "Move tab last" msgid "Move tab last"
msgstr "Déplacer l'onglet à la fin" msgstr "Déplacer l'onglet à la fin"
@ -2074,7 +2074,7 @@ msgstr "Basculer un point d'arrêt"
msgid "Watch expression" msgid "Watch expression"
msgstr "Surveiller des expressions" msgstr "Surveiller des expressions"
#: FMain.class:2355 FProperty.class:1044 #: FMain.class:2355 FProperty.class:1046
msgid "Properties" msgid "Properties"
msgstr "Propriétés" msgstr "Propriétés"
@ -2602,7 +2602,7 @@ msgstr "Surligner la ligne courante"
msgid "Procedure separation" msgid "Procedure separation"
msgstr "Séparation des procédures" msgstr "Séparation des procédures"
#: FOption.class:1001 FProperty.class:679 #: FOption.class:1001 FProperty.class:681
msgid "None" msgid "None"
msgstr "Aucun" msgstr "Aucun"
@ -2682,27 +2682,27 @@ msgstr "Le nom du groupe contient des caractères interdits."
msgid "Incorrect property value." msgid "Incorrect property value."
msgstr "Valeur de propriété incorrecte." msgstr "Valeur de propriété incorrecte."
#: FProperty.class:559 #: FProperty.class:561
msgid "The name of the control." msgid "The name of the control."
msgstr "Le nom du controle." msgstr "Le nom du controle."
#: FProperty.class:570 #: FProperty.class:572
msgid "The event group that the control belongs to." msgid "The event group that the control belongs to."
msgstr "Le groupe d'évènements auquel le control appartient." msgstr "Le groupe d'évènements auquel le control appartient."
#: FProperty.class:583 #: FProperty.class:585
msgid "" msgid ""
"If the form and controls dimensions must follow the size of the default font." "If the form and controls dimensions must follow the size of the default font."
msgstr "" msgstr ""
"Si les dimensions du formulaire et des contrôles doivent suivre la taille de " "Si les dimensions du formulaire et des contrôles doivent suivre la taille de "
"la police par défaut." "la police par défaut."
#: FProperty.class:1054 #: FProperty.class:1056
msgid "Click on a form or a control to modify its properties..." msgid "Click on a form or a control to modify its properties..."
msgstr "" msgstr ""
"Cliquez sur un formulaire ou un contrôle pour modifier ses propriétés..." "Cliquez sur un formulaire ou un contrôle pour modifier ses propriétés..."
#: FProperty.class:1072 #: FProperty.class:1074
msgid "Lock property" msgid "Lock property"
msgstr "Verrouiller la propriété" msgstr "Verrouiller la propriété"

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -108,6 +108,12 @@ Public Sub _new(sPath As String)
End End
Public Sub Load()
End
Public Sub Refresh() Public Sub Refresh()
edtEditor.TabSize = Project.TabSize edtEditor.TabSize = Project.TabSize

View file

@ -446,8 +446,6 @@ Public Function Save(Optional bForce As Boolean) As Boolean
File.Save(Path, $sSave) File.Save(Path, $sSave)
Project.SetFormIcon(Me)
'OPEN Path & ".test" FOR CREATE AS #hFic ' y a un truc bizarre avec CREATE ! 'OPEN Path & ".test" FOR CREATE AS #hFic ' y a un truc bizarre avec CREATE !
'PRINT #hFic, $sSave 'PRINT #hFic, $sSave
'CLOSE #hFic 'CLOSE #hFic
@ -1087,11 +1085,12 @@ Public Function CreateControl(sClass As String, hParent As CControl, Optional sN
' If the component is not loaded, then return null ' If the component is not loaded, then return null
If Not CComponent.Classes.Exist(sClass) Then If Not CComponent.Classes.Exist(sClass) Then
Error.Raise("Component missing") FGambas.Error("Component missing")
hCtrl = New CControl(sName, "DrawingArea", hParent, Me)
Else
hCtrl = New CControl(sName, sClass, hParent, Me)
Endif Endif
hCtrl = New CControl(sName, sClass, hParent, Me)
Control[sName] = hCtrl Control[sName] = hCtrl
If sClass = "Menu" Then If sClass = "Menu" Then
@ -1290,22 +1289,62 @@ Private Sub DrawRectSelect(W As Integer, H As Integer)
If W = $W And H = $H Then Return If W = $W And H = $H Then Return
Draw.Begin(Me) If W <> 0 And H <> 0 Then
Draw.Invert = True
Draw.ForeColor = Color.White $W = W
Draw.LineWidth = 1 $H = H
Draw.LineStyle = Line.Dot
X = $MX - Me.ScreenX X = $MX - panBorder.ScreenX
Y = $MY - Me.ScreenY Y = $MY - panBorder.ScreenY
If W < 0 Then
X += W
W = - W
Endif
If H < 0 Then
Y += H
H = - H
Endif
If $W <> 0 And $H <> 0 Then Draw.Rect(X, Y, $W, $H) panSelectN.Move(X, Y, W, 2)
If W <> 0 And H <> 0 Then Draw.Rect(X, Y, W, H) panSelectS.Move(X, Y + H - 2, W, 2)
panSelectW.Move(X, Y, 2, H)
panSelectE.Move(X + W - 2, Y, 2, H)
panSelectN.Raise
panSelectS.Raise
panSelectW.Raise
panSelectE.Raise
panSelectN.Show
panSelectS.Show
panSelectW.Show
panSelectE.Show
Draw.End Else
panSelectN.Hide
panSelectS.Hide
panSelectW.Hide
panSelectE.Hide
Endif
$W = W ' Draw.Begin(Me)
$H = H ' Draw.Invert = True
' Draw.ForeColor = Color.White
' Draw.LineWidth = 1
' Draw.LineStyle = Line.Dot
'
' X = $MX - Me.ScreenX
' Y = $MY - Me.ScreenY
'
' If $W <> 0 And $H <> 0 Then Draw.Rect(X, Y, $W, $H)
' If W <> 0 And H <> 0 Then Draw.Rect(X, Y, W, H)
'
' Draw.End
'
' $W = W
' $H = H
End End
@ -2223,19 +2262,14 @@ Public Sub OnProjectDebug()
End End
Public Sub Load()
Public Sub Form_Open()
'IF $bActivate THEN RETURN
Reload Reload
SetReadOnly SetReadOnly
Project.SetFormIcon(Me)
'$bActivate = TRUE
End End
Public Function FindControlFromType(sType As String) As String[] Public Function FindControlFromType(sType As String) As String[]
Dim hCtrl As CControl Dim hCtrl As CControl

View file

@ -493,8 +493,32 @@
} }
} }
{ panBorder DrawingArea { panBorder DrawingArea
MoveScaled(21,12,24,24) MoveScaled(22,12,24,24)
Background = Color.Background Background = Color.Background
{ panSelectN Panel
MoveScaled(10,6,1,1)
Visible = False
Background = Color.Foreground
Ignore = True
}
{ panSelectS Panel
MoveScaled(10,8,1,1)
Visible = False
Background = Color.Foreground
Ignore = True
}
{ panSelectW Panel
MoveScaled(8,6,1,1)
Visible = False
Background = Color.Foreground
Ignore = True
}
{ panSelectE Panel
MoveScaled(8,8,1,1)
Visible = False
Background = Color.Foreground
Ignore = True
}
} }
} }
} }

View file

@ -109,7 +109,7 @@ Public Sub _new(sPath As String)
$iScale = 1 $iScale = 1
For Each iScale In $aZoom For Each iScale In $aZoom
If ($hImage.Width * iScale) > (Project.Workspace.ClientWidth * 0.75) OR ($hImage.Height * iScale) > (Project.Workspace.ClientHeight * 0.75) Then Break If ($hImage.Width * iScale) > (Project.Workspace.ClientWidth * 0.75) Or ($hImage.Height * iScale) > (Project.Workspace.ClientHeight * 0.75) Then Break
$iScale = iScale $iScale = iScale
Next Next
@ -127,16 +127,16 @@ Private Sub SetReadOnly()
Dim hCtrl As Control Dim hCtrl As Control
$bReadOnly = Project.ReadOnly OR Project.Running OR Stat(Path).Type = gb.Link $bReadOnly = Project.ReadOnly Or Project.Running Or Stat(Path).Type = gb.Link
For Each hCtrl In panToolbar.Children For Each hCtrl In panToolbar.Children
If hCtrl.Name = "tlbMove" Then Continue If hCtrl.Name = "tlbMove" Then Continue
hCtrl.Visible = NOT $bReadOnly hCtrl.Visible = Not $bReadOnly
Next Next
End End
Public Sub Form_Open() Public Sub Load()
dwgPreview.Resize($hImage.W + 8, $hImage.H + 8) dwgPreview.Resize($hImage.W + 8, $hImage.H + 8)
panPreview.Dimension = dwgPreview.W + 8 panPreview.Dimension = dwgPreview.W + 8
@ -161,7 +161,7 @@ Public Sub dwgIcon_Draw()
Dim hZoom As Image Dim hZoom As Image
If NOT $hImage Then Return If Not $hImage Then Return
Draw.LineStyle = Line.None Draw.LineStyle = Line.None
'Draw.FillStyle = Fill.CrossDiagonal 'Draw.FillStyle = Fill.CrossDiagonal
@ -210,7 +210,7 @@ Public Sub dwgPaste_Draw()
Dim W As Integer Dim W As Integer
Dim hTemp As Image Dim hTemp As Image
If NOT $hPaste Then Return If Not $hPaste Then Return
Draw.FillX = Draw.FillX - $XS * $iScale Draw.FillX = Draw.FillX - $XS * $iScale
Draw.FillY = Draw.FillY - $YS * $iScale Draw.FillY = Draw.FillY - $YS * $iScale
@ -277,11 +277,11 @@ End
Private Sub RefreshCoord(X As Integer, Y As Integer) Private Sub RefreshCoord(X As Integer, Y As Integer)
If X <> $XD OR Y <> $YD Then If X <> $XD Or Y <> $YD Then
$XD = X $XD = X
$YD = Y $YD = Y
'DrawTitle 'DrawTitle
If $XD <> COORD_HIDE AND $YD <> COORD_HIDE Then If $XD <> COORD_HIDE And $YD <> COORD_HIDE Then
lblCoord.Text = $XD & ":" & $YD lblCoord.Text = $XD & ":" & $YD
Else Else
lblCoord.Text = "" lblCoord.Text = ""
@ -317,7 +317,7 @@ Public Function Save() As Boolean
If Project.ReadOnly Then Return If Project.ReadOnly Then Return
If $bReadOnly Then Return If $bReadOnly Then Return
If NOT $bModify Then Return If Not $bModify Then Return
'PRINT "Picture not saved" 'PRINT "Picture not saved"
@ -418,7 +418,7 @@ Public Sub dwgIcon_MouseMove()
RefreshCoord(X \ $iScale, Y \ $iScale) RefreshCoord(X \ $iScale, Y \ $iScale)
If NOT (Mouse.Left OR Mouse.Right) Then Return If Not (Mouse.Left Or Mouse.Right) Then Return
DrawGhost DrawGhost
@ -437,8 +437,8 @@ Public Sub dwgIcon_MouseMove()
svwIcon.Scroll($X - Mouse.ScreenX, $Y - Mouse.ScreenY) svwIcon.Scroll($X - Mouse.ScreenX, $Y - Mouse.ScreenY)
Case "pen" Case "pen"
If X <> $X OR Y <> $Y Then If X <> $X Or Y <> $Y Then
If $X < 0 AND $Y < 0 Then If $X < 0 And $Y < 0 Then
DrawPoint(X, Y, $iColor) DrawPoint(X, Y, $iColor)
Else Else
DrawLine($X, $Y, X, Y, $iColor) DrawLine($X, $Y, X, Y, $iColor)
@ -448,7 +448,7 @@ Public Sub dwgIcon_MouseMove()
Endif Endif
Case "line", "rect", "circle", "select" Case "line", "rect", "circle", "select"
If X <> $X2 OR Y <> $Y2 Then If X <> $X2 Or Y <> $Y2 Then
$X2 = X $X2 = X
$Y2 = Y $Y2 = Y
If $sTool = "select" Then If $sTool = "select" Then
@ -487,7 +487,7 @@ Public Sub dwgIcon_MouseUp()
DrawEllipse(Min($X, $X2), Min($Y, $Y2), Abs($X - $X2) + 1, Abs($Y - $Y2) + 1, $iColor) DrawEllipse(Min($X, $X2), Min($Y, $Y2), Abs($X - $X2) + 1, Abs($Y - $Y2) + 1, $iColor)
Case "select" Case "select"
If $X2 <> $X OR $Y2 <> $Y Then If $X2 <> $X Or $Y2 <> $Y Then
$X = Max(0, Min($hImage.Width - 1, $X)) $X = Max(0, Min($hImage.Width - 1, $X))
$Y = Max(0, Min($hImage.Height - 1, $Y)) $Y = Max(0, Min($hImage.Height - 1, $Y))
$X2 = Max(0, Min($hImage.Width - 1, $X2)) $X2 = Max(0, Min($hImage.Width - 1, $X2))
@ -552,7 +552,7 @@ Private Sub RefreshImage(X As Integer, Y As Integer, W As Integer, H As Integer)
H = H * $iScale H = H * $iScale
dwgIcon.Refresh(X - 1, Y - 1, W + 2, H + 2) dwgIcon.Refresh(X - 1, Y - 1, W + 2, H + 2)
If NOT $bNoPreview Then dwgPreview.Refresh(X - 1 + 4, Y - 1 + 4, W + 2, H + 2) If Not $bNoPreview Then dwgPreview.Refresh(X - 1 + 4, Y - 1 + 4, W + 2, H + 2)
End End
@ -560,7 +560,7 @@ End
Private Sub RefreshAllImage() Private Sub RefreshAllImage()
dwgIcon.Refresh(svwIcon.ScrollX, svwIcon.ScrollY, svwIcon.ClientW, svwIcon.ClientH) dwgIcon.Refresh(svwIcon.ScrollX, svwIcon.ScrollY, svwIcon.ClientW, svwIcon.ClientH)
If NOT $bNoPreview Then dwgPreview.Refresh If Not $bNoPreview Then dwgPreview.Refresh
End End
@ -568,10 +568,10 @@ End
Public Sub Modify(Optional bReset As Boolean) Public Sub Modify(Optional bReset As Boolean)
If Project.ReadOnly OR $bReadOnly Then Return If Project.ReadOnly Or $bReadOnly Then Return
If $bModify <> bReset Then Return If $bModify <> bReset Then Return
$bModify = NOT bReset $bModify = Not bReset
DrawTitle DrawTitle
If $bModify Then Inc Project.TimeStamp If $bModify Then Inc Project.TimeStamp
@ -598,7 +598,7 @@ End
Private Sub SetPixelAlt(X As Integer, Y As Integer, C As Integer, C2 As Integer) Private Sub SetPixelAlt(X As Integer, Y As Integer, C As Integer, C2 As Integer)
If (X + Y) AND 1 Then If (X + Y) And 1 Then
C = C2 C = C2
Endif Endif
@ -653,7 +653,7 @@ Private Sub DrawLine(X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer,
DrawPoint(X, Y, C) DrawPoint(X, Y, C)
If X = X2 AND Y = Y2 Then Break If X = X2 And Y = Y2 Then Break
bCalc = False bCalc = False
@ -799,13 +799,13 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
'WITH FIconTool 'WITH FIconTool
If $sTool = "select" AND NOT $bSelect Then Return If $sTool = "select" And Not $bSelect Then Return
iS2 = $iScale \ 2 iS2 = $iScale \ 2
iSH = $iScale iSH = $iScale
iWH = iSH * 2 + 1 iWH = iSH * 2 + 1
If NOT bNoBegin Then Draw.Begin(dwgIcon) If Not bNoBegin Then Draw.Begin(dwgIcon)
Select Case $sTool Select Case $sTool
@ -838,7 +838,7 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
Draw.ForeColor = Color.White Draw.ForeColor = Color.White
Draw.Rect(Min($X, $X2) * $iScale, Min($Y, $Y2) * $iScale, (Abs($X - $X2) + 1) * $iScale + 1, (Abs($Y - $Y2) + 1) * $iScale + 1) Draw.Rect(Min($X, $X2) * $iScale, Min($Y, $Y2) * $iScale, (Abs($X - $X2) + 1) * $iScale + 1, (Abs($Y - $Y2) + 1) * $iScale + 1)
If $iMode = 0 Then If $iMode = 0 Then
If Abs($X - $X2) > 1 AND Abs($Y - $Y2) > 1 Then If Abs($X - $X2) > 1 And Abs($Y - $Y2) > 1 Then
Draw.Rect((Min($X, $X2) + 1) * $iScale, (Min($Y, $Y2) + 1) * $iScale, (Abs($X - $X2) - 1) * $iScale + 1, (Abs($Y - $Y2) - 1) * $iScale + 1) Draw.Rect((Min($X, $X2) + 1) * $iScale, (Min($Y, $Y2) + 1) * $iScale, (Abs($X - $X2) - 1) * $iScale + 1, (Abs($Y - $Y2) - 1) * $iScale + 1)
Endif Endif
Endif Endif
@ -852,16 +852,16 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
Draw.ForeColor = Color.White Draw.ForeColor = Color.White
Draw.Ellipse(Min($X, $X2) * $iScale, Min($Y, $Y2) * $iScale, (Abs($X - $X2) + 1) * $iScale + 1, (Abs($Y - $Y2) + 1) * $iScale + 1) Draw.Ellipse(Min($X, $X2) * $iScale, Min($Y, $Y2) * $iScale, (Abs($X - $X2) + 1) * $iScale + 1, (Abs($Y - $Y2) + 1) * $iScale + 1)
If $iMode = 0 Then If $iMode = 0 Then
If Abs($X - $X2) > 1 AND Abs($Y - $Y2) > 1 Then If Abs($X - $X2) > 1 And Abs($Y - $Y2) > 1 Then
Draw.Ellipse((Min($X, $X2) + 1) * $iScale, (Min($Y, $Y2) + 1) * $iScale, (Abs($X - $X2) - 1) * $iScale + 1, (Abs($Y - $Y2) - 1) * $iScale + 1) Draw.Ellipse((Min($X, $X2) + 1) * $iScale, (Min($Y, $Y2) + 1) * $iScale, (Abs($X - $X2) - 1) * $iScale + 1, (Abs($Y - $Y2) - 1) * $iScale + 1)
Endif Endif
Endif Endif
End Select End Select
If NOT bNoBegin Then If Not bNoBegin Then
Draw.End Draw.End
$bGhost = NOT $bGhost $bGhost = Not $bGhost
Endif Endif
'END WITH 'END WITH
@ -873,7 +873,7 @@ Private Sub BeginUndo()
If $iBeginUndo = 0 Then If $iBeginUndo = 0 Then
$hUndo[$iUndo] = $hImage.Copy() $hUndo[$iUndo] = $hImage.Copy()
$iUndo = ($iUndo + 1) MOD MAX_UNDO $iUndo = ($iUndo + 1) Mod MAX_UNDO
Endif Endif
Inc $iBeginUndo Inc $iBeginUndo
@ -970,7 +970,7 @@ End
Public Sub HideSelection() Public Sub HideSelection()
If NOT dwgPaste.Visible Then Return If Not dwgPaste.Visible Then Return
If $bPrivate Then If $bPrivate Then
DoPaste DoPaste
@ -1021,7 +1021,7 @@ Private Sub FloodFill(X As Integer, Y As Integer, C As Integer, iMode As Integer
'END WITH 'END WITH
CS = $hImage[X, Y] CS = $hImage[X, Y]
If CS = C OR CS = C2 Then Return If CS = C Or CS = C2 Then Return
Inc Application.Busy Inc Application.Busy
@ -1124,10 +1124,10 @@ End
Public Sub RefreshPaste() Public Sub RefreshPaste()
If NOT $hPaste Then Return If Not $hPaste Then Return
dwgPaste.Move($XS * $iScale, $YS * $iScale, $hPaste.Width * $iScale, $hPaste.Height * $iScale) dwgPaste.Move($XS * $iScale, $YS * $iScale, $hPaste.Width * $iScale, $hPaste.Height * $iScale)
If NOT dwgPaste.Visible Then If Not dwgPaste.Visible Then
dwgPaste.Show dwgPaste.Show
Else Else
dwgPaste.Refresh dwgPaste.Refresh
@ -1214,7 +1214,7 @@ Public Sub DoPaste()
Dim bTrans As Boolean Dim bTrans As Boolean
If NOT dwgPaste.Visible Then If Not dwgPaste.Visible Then
ShowPaste(True) ShowPaste(True)
$bPrivate = False $bPrivate = False
Return Return
@ -1244,12 +1244,12 @@ Public Sub dwgPaste_MouseMove()
RefreshCoord(Mouse.X \ $iScale + $XS, Mouse.Y \ $iScale + $YS) RefreshCoord(Mouse.X \ $iScale + $XS, Mouse.Y \ $iScale + $YS)
If NOT Mouse.Left Then Return If Not Mouse.Left Then Return
XP = (Mouse.ScreenX - $X - dwgIcon.ScreenX) \ $iScale XP = (Mouse.ScreenX - $X - dwgIcon.ScreenX) \ $iScale
YP = (Mouse.ScreenY - $Y - dwgIcon.ScreenY) \ $iScale YP = (Mouse.ScreenY - $Y - dwgIcon.ScreenY) \ $iScale
If XP = $XS AND YP = $YS Then Return If XP = $XS And YP = $YS Then Return
$XS = XP $XS = XP
$YS = YP $YS = YP
@ -1402,7 +1402,7 @@ End
Public Sub Form_Close() Public Sub Form_Close()
If $bModify Then If $bModify Then
If NOT Project.AboutToQuit Then If Not Project.AboutToQuit Then
Select Case Message.Question(("This image has been modified.\nDo you want to save it ?"), ("Save"), ("Close"), ("Cancel")) Select Case Message.Question(("This image has been modified.\nDo you want to save it ?"), ("Save"), ("Close"), ("Cancel"))
Case 1 Case 1
Save Save
@ -1422,7 +1422,7 @@ Public Sub ZoomIn()
Dim iPos As Integer Dim iPos As Integer
iPos = $aZoom.Find($iScale) iPos = $aZoom.Find($iScale)
If iPos < 0 OR iPos >= ($aZoom.Count - 1) Then Return If iPos < 0 Or iPos >= ($aZoom.Count - 1) Then Return
$iScale = $aZoom[iPos + 1] $iScale = $aZoom[iPos + 1]
RefreshZoom RefreshZoom
@ -1524,7 +1524,7 @@ Public Sub dwgColor_Draw()
Dim iColor As Integer Dim iColor As Integer
iColor = Last.Tag iColor = Last.Tag
If iColor >= 0 AND iColor < $cColor.Count Then If iColor >= 0 And iColor < $cColor.Count Then
iColor = $cColor[iColor] iColor = $cColor[iColor]
Else Else
iColor = -1 iColor = -1
@ -1802,7 +1802,7 @@ End
Public Sub SetTool(hTool As ToolButton) Public Sub SetTool(hTool As ToolButton)
If NOT hTool Then Return If Not hTool Then Return
' IF hTool = $hTool THEN ' IF hTool = $hTool THEN
' $hTool.Value = TRUE ' $hTool.Value = TRUE

View file

@ -30,7 +30,7 @@ Public Sub _new(sPath As String)
End End
Public Sub Form_Open() Public Sub Load()
Dim sExt As String = LCase(File.Ext(Name)) Dim sExt As String = LCase(File.Ext(Name))

View file

@ -1167,9 +1167,12 @@ Public Function LoadFile(sPath As String) As Object
End Select End Select
Endif Endif
Files[sPath] = hForm Files[sPath] = hForm
If hForm Then hForm.Icon = GetFileIcon(sPath, 16) If hForm Then
hForm.Load
hForm.Icon = GetFileIcon(sPath, 16)
Endif
Dec Application.Busy Dec Application.Busy
@ -1240,6 +1243,10 @@ Public Sub ShowFile(hForm As Form)
End Select End Select
Catch
FGambas.Error(("Cannot open file.") & "\n\n" & Error.Text & "\n" & Error.Where)
End End
Public Sub OpenFile(sPath As String, Optional iLine As Integer) As Object Public Sub OpenFile(sPath As String, Optional iLine As Integer) As Object
@ -3605,40 +3612,40 @@ Public Sub CleanUp()
End End
Public Sub SetFormIcon(hForm As FForm) ' Public Sub SetFormIcon(hForm As FForm)
' ' '
' DIM hPict AS Picture ' ' DIM hPict AS Picture
' DIM eRap AS Float ' ' DIM eRap AS Float
' ' '
' 'hForm.Raise ' ' 'hForm.Raise
' hPict = hForm.Grab() ' ' hPict = hForm.Grab()
' hForm.Refresh ' ' hForm.Refresh
' eRap = hPict.Width / hPict.Height ' ' eRap = hPict.Width / hPict.Height
' IF eRap > 4 THEN ' ' IF eRap > 4 THEN
' eRap = 4 ' ' eRap = 4
' hPict = hPict.Copy(0, 0, hPict.Height * eRap, hPict.Height) ' ' hPict = hPict.Copy(0, 0, hPict.Height * eRap, hPict.Height)
' ELSE IF eRap < 0.5 THEN ' ' ELSE IF eRap < 0.5 THEN
' eRap = 0.5 ' ' eRap = 0.5
' hPict = hPict.Copy(0, 0, hPict.Width, hPict.Width / eRap) ' ' hPict = hPict.Copy(0, 0, hPict.Width, hPict.Width / eRap)
' ENDIF ' ' ENDIF
' IF eRap > 1 THEN ' ' IF eRap > 1 THEN
' hPict = hPict.Image.Stretch(32 * eRap, 32).Picture ' ' hPict = hPict.Image.Stretch(32 * eRap, 32).Picture
' ELSE ' ' ELSE
' hPict = hPict.Image.Stretch(32, 32 / eRap).Picture ' ' hPict = hPict.Image.Stretch(32, 32 / eRap).Picture
' ENDIF ' ' ENDIF
' ' '
' Draw.Begin(hPict) ' ' Draw.Begin(hPict)
' Draw.Foreground = &H808080& ' ' Draw.Foreground = &H808080&
' Draw.Rect(0, 0, hPict.Width, hPict.Height) ' ' Draw.Rect(0, 0, hPict.Width, hPict.Height)
' Draw.End ' ' Draw.End
' ' '
' ProjectTree[Project.Dir &/ hForm.Name & ".form"].Picture = hPict ' ' ProjectTree[Project.Dir &/ hForm.Name & ".form"].Picture = hPict
' ' '
' CATCH ' ' CATCH
' ' '
' PRINT Error.Text ' ' PRINT Error.Text
' ' '
End ' End
Public Function CheckProgram(sProg As String) As Boolean Public Function CheckProgram(sProg As String) As Boolean

View file

@ -322,3 +322,9 @@ david_villalobos_c@yahoo.com
Spain Spain
The <tt>gb.db.mysql</tt> MySQL specific component The <tt>gb.db.mysql</tt> MySQL specific component
------------------------------------------
Peter Mathijssen
pmathijssen@gmail.com>
Dutch translation