[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
#: 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
#: FMakeExecutable.class:152 FMakeInstall.class:278 FMenu.class:1081
#: FNewTranslation.class:70 FOpenProject.class:408 FPropertyProject.class:1150
@ -620,27 +620,27 @@ msgstr "Mot de passe"
msgid "Changes description"
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
msgid "Cut"
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
msgid "Copy"
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
msgid "Paste"
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
msgid "Undo"
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
msgid "Redo"
msgstr "Rétablir"
@ -781,7 +781,7 @@ msgstr "Module"
msgid "Class"
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"
msgstr "Formulaire"
@ -1092,7 +1092,7 @@ msgstr ""
"\n"
"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
msgid "Reload"
msgstr "Recharger"
@ -1177,7 +1177,7 @@ msgstr "Séparation horizontale"
msgid "Vertical split"
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
msgid "Save"
msgstr "Enregistrer"
@ -1270,7 +1270,7 @@ msgstr "Choisissez une police"
msgid "Bad form file"
msgstr "Le fichier formulaire contient une erreur"
#: FForm.class:2594
#: FForm.class:2636
msgid ""
"The form has been modified.\n"
"\n"
@ -1280,167 +1280,167 @@ msgstr ""
"\n"
"Tous vos changements seront perdus."
#: FForm.class:2976 FIconEditor.class:2249
#: FForm.class:3022 FIconEditor.class:2249
msgid "Select"
msgstr "Sélectionner"
#: FForm.class:2981
#: FForm.class:3027
msgid "Event"
msgstr "Evènement"
#: FForm.class:2987
#: FForm.class:3033
msgid "Change into"
msgstr "Transformer en"
#: FForm.class:2993
#: FForm.class:3039
msgid "Open code"
msgstr "Ouvrir le code"
#: FForm.class:3004
#: FForm.class:3050
msgid "Move tab"
msgstr "Déplacer l'onglet"
#: FForm.class:3009
#: FForm.class:3055
msgid "&First"
msgstr "&Début"
#: FForm.class:3016 FTips.class:220
#: FForm.class:3062 FTips.class:220
msgid "&Previous"
msgstr "&Précédent"
#: FForm.class:3023 FMenu.class:808 FTips.class:226
#: FForm.class:3069 FMenu.class:808 FTips.class:226
msgid "&Next"
msgstr "&Suivant"
#: FForm.class:3030
#: FForm.class:3076
msgid "&Last"
msgstr "&Fin"
#: FForm.class:3041
#: FForm.class:3087
msgid "Select all"
msgstr "Sélectionner tout"
#: FForm.class:3046
#: FForm.class:3092
msgid "Unselect all"
msgstr "Déselectionner tout"
#: FForm.class:3077 FMain.class:202 FTranslate.class:551
#: FForm.class:3123 FMain.class:202 FTranslate.class:551
msgid "Delete"
msgstr "Supprimer"
#: FForm.class:3087
#: FForm.class:3133
msgid "Arrangement"
msgstr "Disposition"
#: FForm.class:3091
#: FForm.class:3137
msgid "Bring to foreground"
msgstr "Au premier plan"
#: FForm.class:3098
#: FForm.class:3144
msgid "Send to background"
msgstr "A l'arrière-plan"
#: FForm.class:3109
#: FForm.class:3155
msgid "Horizontal"
msgstr "Horizontal"
#: FForm.class:3116
#: FForm.class:3162
msgid "Rows"
msgstr "Lignes"
#: FForm.class:3123
#: FForm.class:3169
msgid "Vertical"
msgstr "Vertical"
#: FForm.class:3130
#: FForm.class:3176
msgid "Columns"
msgstr "Colonnes"
#: FForm.class:3137
#: FForm.class:3183
msgid "Alignment"
msgstr "Alignement"
#: FForm.class:3141
#: FForm.class:3187
msgid "Align to &left"
msgstr "Aligner sur la &gauche"
#: FForm.class:3147
#: FForm.class:3193
msgid "Align to &right"
msgstr "Aligner sur la &droite"
#: FForm.class:3153
#: FForm.class:3199
msgid "Align to &top"
msgstr "Aligner sur le &haut"
#: FForm.class:3159
#: FForm.class:3205
msgid "Align to &bottom"
msgstr "Aligner sur le &bas"
#: FForm.class:3169
#: FForm.class:3215
msgid "Same &width"
msgstr "Même &largeur"
#: FForm.class:3175
#: FForm.class:3221
msgid "Same &height"
msgstr "Même hau&teur"
#: FForm.class:3186
#: FForm.class:3232
msgid "Menu editor..."
msgstr "Editeur de menu..."
#: FForm.class:3237
#: FForm.class:3283
msgid "Code"
msgstr "Code"
#: FForm.class:3245
#: FForm.class:3291
msgid "Lock form"
msgstr "Verrouiller le formulaire"
#: FForm.class:3308 FMenu.class:26
#: FForm.class:3354 FMenu.class:26
msgid "Menu editor"
msgstr "Editeur de menu"
#: FForm.class:3316
#: FForm.class:3362
msgid "Toggle grid"
msgstr "Bascule l'affichage de la grille"
#: FForm.class:3346
#: FForm.class:3392
msgid "Align to top"
msgstr "Aligner sur le haut"
#: FForm.class:3354
#: FForm.class:3400
msgid "Align to bottom"
msgstr "Aligner sur le bas"
#: FForm.class:3362
#: FForm.class:3408
msgid "Align to left"
msgstr "Aligner sur la gauche"
#: FForm.class:3370
#: FForm.class:3416
msgid "Align to right"
msgstr "Aligner sur la droite"
#: FForm.class:3378
#: FForm.class:3424
msgid "Same width"
msgstr "Même largeur"
#: FForm.class:3386
#: FForm.class:3432
msgid "Same height"
msgstr "Même hauteur"
#: FForm.class:3431
#: FForm.class:3477
msgid "Move tab first"
msgstr "Déplacer l'onglet au début"
#: FForm.class:3439
#: FForm.class:3485
msgid "Move tab left"
msgstr "Déplacer l'onglet à gauche"
#: FForm.class:3447
#: FForm.class:3493
msgid "Move tab right"
msgstr "Déplacer l'onglet à droite"
#: FForm.class:3455
#: FForm.class:3501
msgid "Move tab last"
msgstr "Déplacer l'onglet à la fin"
@ -2074,7 +2074,7 @@ msgstr "Basculer un point d'arrêt"
msgid "Watch expression"
msgstr "Surveiller des expressions"
#: FMain.class:2355 FProperty.class:1044
#: FMain.class:2355 FProperty.class:1046
msgid "Properties"
msgstr "Propriétés"
@ -2602,7 +2602,7 @@ msgstr "Surligner la ligne courante"
msgid "Procedure separation"
msgstr "Séparation des procédures"
#: FOption.class:1001 FProperty.class:679
#: FOption.class:1001 FProperty.class:681
msgid "None"
msgstr "Aucun"
@ -2682,27 +2682,27 @@ msgstr "Le nom du groupe contient des caractères interdits."
msgid "Incorrect property value."
msgstr "Valeur de propriété incorrecte."
#: FProperty.class:559
#: FProperty.class:561
msgid "The name of the control."
msgstr "Le nom du controle."
#: FProperty.class:570
#: FProperty.class:572
msgid "The event group that the control belongs to."
msgstr "Le groupe d'évènements auquel le control appartient."
#: FProperty.class:583
#: FProperty.class:585
msgid ""
"If the form and controls dimensions must follow the size of the default font."
msgstr ""
"Si les dimensions du formulaire et des contrôles doivent suivre la taille de "
"la police par défaut."
#: FProperty.class:1054
#: FProperty.class:1056
msgid "Click on a form or a control to modify its properties..."
msgstr ""
"Cliquez sur un formulaire ou un contrôle pour modifier ses propriétés..."
#: FProperty.class:1072
#: FProperty.class:1074
msgid "Lock property"
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
Public Sub Load()
End
Public Sub Refresh()
edtEditor.TabSize = Project.TabSize

View file

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

View file

@ -493,8 +493,32 @@
}
}
{ panBorder DrawingArea
MoveScaled(21,12,24,24)
MoveScaled(22,12,24,24)
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
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
Next
@ -127,16 +127,16 @@ Private Sub SetReadOnly()
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
If hCtrl.Name = "tlbMove" Then Continue
hCtrl.Visible = NOT $bReadOnly
hCtrl.Visible = Not $bReadOnly
Next
End
Public Sub Form_Open()
Public Sub Load()
dwgPreview.Resize($hImage.W + 8, $hImage.H + 8)
panPreview.Dimension = dwgPreview.W + 8
@ -161,7 +161,7 @@ Public Sub dwgIcon_Draw()
Dim hZoom As Image
If NOT $hImage Then Return
If Not $hImage Then Return
Draw.LineStyle = Line.None
'Draw.FillStyle = Fill.CrossDiagonal
@ -210,7 +210,7 @@ Public Sub dwgPaste_Draw()
Dim W As Integer
Dim hTemp As Image
If NOT $hPaste Then Return
If Not $hPaste Then Return
Draw.FillX = Draw.FillX - $XS * $iScale
Draw.FillY = Draw.FillY - $YS * $iScale
@ -277,11 +277,11 @@ End
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
$YD = Y
'DrawTitle
If $XD <> COORD_HIDE AND $YD <> COORD_HIDE Then
If $XD <> COORD_HIDE And $YD <> COORD_HIDE Then
lblCoord.Text = $XD & ":" & $YD
Else
lblCoord.Text = ""
@ -317,7 +317,7 @@ Public Function Save() As Boolean
If Project.ReadOnly Then Return
If $bReadOnly Then Return
If NOT $bModify Then Return
If Not $bModify Then Return
'PRINT "Picture not saved"
@ -418,7 +418,7 @@ Public Sub dwgIcon_MouseMove()
RefreshCoord(X \ $iScale, Y \ $iScale)
If NOT (Mouse.Left OR Mouse.Right) Then Return
If Not (Mouse.Left Or Mouse.Right) Then Return
DrawGhost
@ -437,8 +437,8 @@ Public Sub dwgIcon_MouseMove()
svwIcon.Scroll($X - Mouse.ScreenX, $Y - Mouse.ScreenY)
Case "pen"
If X <> $X OR Y <> $Y Then
If $X < 0 AND $Y < 0 Then
If X <> $X Or Y <> $Y Then
If $X < 0 And $Y < 0 Then
DrawPoint(X, Y, $iColor)
Else
DrawLine($X, $Y, X, Y, $iColor)
@ -448,7 +448,7 @@ Public Sub dwgIcon_MouseMove()
Endif
Case "line", "rect", "circle", "select"
If X <> $X2 OR Y <> $Y2 Then
If X <> $X2 Or Y <> $Y2 Then
$X2 = X
$Y2 = Y
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)
Case "select"
If $X2 <> $X OR $Y2 <> $Y Then
If $X2 <> $X Or $Y2 <> $Y Then
$X = Max(0, Min($hImage.Width - 1, $X))
$Y = Max(0, Min($hImage.Height - 1, $Y))
$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
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
@ -560,7 +560,7 @@ End
Private Sub RefreshAllImage()
dwgIcon.Refresh(svwIcon.ScrollX, svwIcon.ScrollY, svwIcon.ClientW, svwIcon.ClientH)
If NOT $bNoPreview Then dwgPreview.Refresh
If Not $bNoPreview Then dwgPreview.Refresh
End
@ -568,10 +568,10 @@ End
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
$bModify = NOT bReset
$bModify = Not bReset
DrawTitle
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)
If (X + Y) AND 1 Then
If (X + Y) And 1 Then
C = C2
Endif
@ -653,7 +653,7 @@ Private Sub DrawLine(X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer,
DrawPoint(X, Y, C)
If X = X2 AND Y = Y2 Then Break
If X = X2 And Y = Y2 Then Break
bCalc = False
@ -799,13 +799,13 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
'WITH FIconTool
If $sTool = "select" AND NOT $bSelect Then Return
If $sTool = "select" And Not $bSelect Then Return
iS2 = $iScale \ 2
iSH = $iScale
iWH = iSH * 2 + 1
If NOT bNoBegin Then Draw.Begin(dwgIcon)
If Not bNoBegin Then Draw.Begin(dwgIcon)
Select Case $sTool
@ -838,7 +838,7 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
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)
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)
Endif
Endif
@ -852,16 +852,16 @@ Private Sub DrawGhost(Optional bNoBegin As Boolean)
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)
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)
Endif
Endif
End Select
If NOT bNoBegin Then
If Not bNoBegin Then
Draw.End
$bGhost = NOT $bGhost
$bGhost = Not $bGhost
Endif
'END WITH
@ -873,7 +873,7 @@ Private Sub BeginUndo()
If $iBeginUndo = 0 Then
$hUndo[$iUndo] = $hImage.Copy()
$iUndo = ($iUndo + 1) MOD MAX_UNDO
$iUndo = ($iUndo + 1) Mod MAX_UNDO
Endif
Inc $iBeginUndo
@ -970,7 +970,7 @@ End
Public Sub HideSelection()
If NOT dwgPaste.Visible Then Return
If Not dwgPaste.Visible Then Return
If $bPrivate Then
DoPaste
@ -1021,7 +1021,7 @@ Private Sub FloodFill(X As Integer, Y As Integer, C As Integer, iMode As Integer
'END WITH
CS = $hImage[X, Y]
If CS = C OR CS = C2 Then Return
If CS = C Or CS = C2 Then Return
Inc Application.Busy
@ -1124,10 +1124,10 @@ End
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)
If NOT dwgPaste.Visible Then
If Not dwgPaste.Visible Then
dwgPaste.Show
Else
dwgPaste.Refresh
@ -1214,7 +1214,7 @@ Public Sub DoPaste()
Dim bTrans As Boolean
If NOT dwgPaste.Visible Then
If Not dwgPaste.Visible Then
ShowPaste(True)
$bPrivate = False
Return
@ -1244,12 +1244,12 @@ Public Sub dwgPaste_MouseMove()
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
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
$YS = YP
@ -1402,7 +1402,7 @@ End
Public Sub Form_Close()
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"))
Case 1
Save
@ -1422,7 +1422,7 @@ Public Sub ZoomIn()
Dim iPos As Integer
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]
RefreshZoom
@ -1524,7 +1524,7 @@ Public Sub dwgColor_Draw()
Dim iColor As Integer
iColor = Last.Tag
If iColor >= 0 AND iColor < $cColor.Count Then
If iColor >= 0 And iColor < $cColor.Count Then
iColor = $cColor[iColor]
Else
iColor = -1
@ -1802,7 +1802,7 @@ End
Public Sub SetTool(hTool As ToolButton)
If NOT hTool Then Return
If Not hTool Then Return
' IF hTool = $hTool THEN
' $hTool.Value = TRUE

View file

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

View file

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

View file

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