[DEVELOPMENT ENVIRONMENT]
* BUG: Fix background of CoordBox controls. * BUG: Image editor: Fix text tool. * NEW: Image editor: Text alignment. * BUG: Image editor: Scaling selection is done from the top left corner by default, and from the selection center only if you press the SHIFT key. * NEW: Image editor: The mouse wheel now zooms the image. * BUG: Project property dialog: Fix component list layout. * NEW: Some new backgrounds. [GB.FORM] * NEW: TabPanel: Now there are a left and a right arrow to navigate through the tabs. git-svn-id: svn://localhost/gambas/trunk@6088 867c0c6c-44f3-4631-809d-bfa615b0a4ec
|
@ -919,7 +919,7 @@ msgstr "Ce fichier entre en conflit avec la révision #&1.\nVous devez résoudre
|
|||
msgid "Unable to load file:"
|
||||
msgstr "Impossible de charger le fichier :"
|
||||
|
||||
#: FConflict.class:158 FCreateFile.form:237 FDebugInfo.class:70
|
||||
#: FImageEditor.form:556
|
||||
msgid "Text"
|
||||
msgstr "Texte"
|
||||
|
||||
|
@ -1651,7 +1651,7 @@ msgstr "La chaîne recherchée est introuvable."
|
|||
msgid "Stack backtrace"
|
||||
msgstr "Pile des appels"
|
||||
|
||||
#: FEditor.class:2348 FImageEditor.class:351 FTextEditor.class:613
|
||||
#: FEditor.class:2348 FImageEditor.class:352 FTextEditor.class:613
|
||||
msgid "The file has been modified.\n\nAll your changes will be lost."
|
||||
msgstr "Le fichier a été modifié.\n\nToutes les modifications seront perdues."
|
||||
|
||||
|
@ -1679,7 +1679,7 @@ msgstr "Ouvrir le formulaire"
|
|||
msgid "Startup class"
|
||||
msgstr "Classe de démarrage"
|
||||
|
||||
#: FEditor.form:167 FImageEditor.form:150 FTextEditor.form:132
|
||||
#: FEditor.form:167 FImageEditor.form:151 FTextEditor.form:132
|
||||
msgid "Select All"
|
||||
msgstr "Tout sélectionner"
|
||||
|
||||
|
@ -1739,7 +1739,7 @@ msgstr "Formater le code"
|
|||
msgid "Sort procedures"
|
||||
msgstr "Trier les procédures"
|
||||
|
||||
#: FEditor.form:281 FImageEditor.form:283 FMain.form:543 FTextEditor.form:202
|
||||
#: FEditor.form:281 FImageEditor.form:284 FMain.form:543 FTextEditor.form:202
|
||||
msgid "View"
|
||||
msgstr "Affichage"
|
||||
|
||||
|
@ -2135,11 +2135,11 @@ msgstr "Aller en avant"
|
|||
msgid "Show help tree"
|
||||
msgstr "Afficher l'arborescence de l'aide"
|
||||
|
||||
#: FHelpBrowser.form:85 FImageEditor.form:288
|
||||
#: FHelpBrowser.form:85 FImageEditor.form:289
|
||||
msgid "Zoom in"
|
||||
msgstr "Zoom avant"
|
||||
|
||||
#: FHelpBrowser.form:91 FImageEditor.form:296
|
||||
#: FHelpBrowser.form:91 FImageEditor.form:297
|
||||
msgid "Zoom out"
|
||||
msgstr "Zoom arrière"
|
||||
|
||||
|
@ -2155,135 +2155,135 @@ msgstr "Imprimer"
|
|||
msgid "Modify documentation"
|
||||
msgstr "Modifier la documentation"
|
||||
|
||||
#: FImageEditor.form:156
|
||||
#: FImageEditor.form:157
|
||||
msgid "Hide selection"
|
||||
msgstr "Cacher la sélection"
|
||||
|
||||
#: FImageEditor.form:161 MTheme.module:6
|
||||
#: FImageEditor.form:162 MTheme.module:6
|
||||
msgid "Selection"
|
||||
msgstr "Sélection"
|
||||
|
||||
#: FImageEditor.form:166
|
||||
#: FImageEditor.form:167
|
||||
msgid "Invert selection"
|
||||
msgstr "Inverser la sélection"
|
||||
|
||||
#: FImageEditor.form:174
|
||||
#: FImageEditor.form:175
|
||||
msgid "Duplicate selection"
|
||||
msgstr "Dupliquer la sélection"
|
||||
|
||||
#: FImageEditor.form:182 FImageOffsetSelection.form:12
|
||||
#: FImageEditor.form:183 FImageOffsetSelection.form:12
|
||||
msgid "Offset selection"
|
||||
msgstr "Agrandir ou rétrécir la sélection"
|
||||
|
||||
#: FImageEditor.form:189
|
||||
#: FImageEditor.form:190
|
||||
msgid "Shape grid"
|
||||
msgstr "Grille de la forme"
|
||||
|
||||
#: FImageEditor.form:227
|
||||
#: FImageEditor.form:228
|
||||
msgid "Action"
|
||||
msgstr "Action"
|
||||
|
||||
#: FImageEditor.form:232
|
||||
#: FImageEditor.form:233
|
||||
msgid "Crop"
|
||||
msgstr "Découper"
|
||||
|
||||
#: FImageEditor.form:240 FImageProperty.form:279
|
||||
#: FImageEditor.form:241 FImageProperty.form:289
|
||||
msgid "Horizontal flip"
|
||||
msgstr "Miroir horizontal"
|
||||
|
||||
#: FImageEditor.form:247 FImageProperty.form:273
|
||||
#: FImageEditor.form:248 FImageProperty.form:283
|
||||
msgid "Vertical flip"
|
||||
msgstr "Miroir vertical"
|
||||
|
||||
#: FImageEditor.form:254 FImageProperty.form:267
|
||||
#: FImageEditor.form:255 FImageProperty.form:277
|
||||
msgid "Rotate counter-clockwise"
|
||||
msgstr "Rotation de 90° vers la gauche"
|
||||
|
||||
#: FImageEditor.form:262 FImageProperty.form:261
|
||||
#: FImageEditor.form:263 FImageProperty.form:271
|
||||
msgid "Rotate clockwise"
|
||||
msgstr "Rotation de 90° vers la droite"
|
||||
|
||||
#: FImageEditor.form:270
|
||||
#: FImageEditor.form:271
|
||||
msgid "Resize"
|
||||
msgstr "Redimensionner"
|
||||
|
||||
#: FImageEditor.form:277
|
||||
#: FImageEditor.form:278
|
||||
msgid "Rotate"
|
||||
msgstr "Rotation"
|
||||
|
||||
#: FImageEditor.form:304
|
||||
#: FImageEditor.form:305
|
||||
msgid "Zoom normal"
|
||||
msgstr "Zoom normal"
|
||||
|
||||
#: FImageEditor.form:312
|
||||
#: FImageEditor.form:313
|
||||
msgid "Zoom fit"
|
||||
msgstr "Zoom ajusté"
|
||||
|
||||
#: FImageEditor.form:347
|
||||
#: FImageEditor.form:348
|
||||
msgid "Save as JPEG"
|
||||
msgstr "Enregistrer comme JPEG"
|
||||
|
||||
#: FImageEditor.form:353
|
||||
#: FImageEditor.form:354
|
||||
msgid "Save as PNG"
|
||||
msgstr "Enregistrer comme PNG"
|
||||
|
||||
#: FImageEditor.form:359
|
||||
#: FImageEditor.form:360
|
||||
msgid "Save as BMP"
|
||||
msgstr "Enregistrer comme BMP"
|
||||
|
||||
#: FImageEditor.form:366
|
||||
#: FImageEditor.form:367
|
||||
msgid "Save as TIFF"
|
||||
msgstr "Enregistrer comme TIFF"
|
||||
|
||||
#: FImageEditor.form:373
|
||||
#: FImageEditor.form:374
|
||||
msgid "Image editor"
|
||||
msgstr "Editeur d'image"
|
||||
|
||||
#: FImageEditor.form:447
|
||||
#: FImageEditor.form:448
|
||||
msgid "Drawing grid"
|
||||
msgstr "Grille de dessin"
|
||||
|
||||
#: FImageEditor.form:490
|
||||
#: FImageEditor.form:491
|
||||
msgid "Move"
|
||||
msgstr "Déplacer"
|
||||
|
||||
#: FImageEditor.form:501
|
||||
#: FImageEditor.form:502
|
||||
msgid "Draw"
|
||||
msgstr "Dessiner"
|
||||
|
||||
#: FImageEditor.form:511
|
||||
#: FImageEditor.form:512
|
||||
msgid "Erase"
|
||||
msgstr "Gommer"
|
||||
|
||||
#: FImageEditor.form:535
|
||||
#: FImageEditor.form:536
|
||||
msgid "Rectangle"
|
||||
msgstr "Rectangle"
|
||||
|
||||
#: FImageEditor.form:545
|
||||
#: FImageEditor.form:546
|
||||
msgid "Ellipse"
|
||||
msgstr "Ellipse"
|
||||
|
||||
#: FImageEditor.form:555
|
||||
#: FImageEditor.form:566
|
||||
msgid "Magic wand"
|
||||
msgstr "Baguette magique"
|
||||
|
||||
#: FImageEditor.form:565
|
||||
#: FImageEditor.form:576
|
||||
msgid "Edit selection"
|
||||
msgstr "Modifier la sélection"
|
||||
|
||||
#: FImageEditor.form:609
|
||||
#: FImageEditor.form:620
|
||||
msgid "Stroke"
|
||||
msgstr "Tracer"
|
||||
|
||||
#: FImageEditor.form:616
|
||||
#: FImageEditor.form:627
|
||||
msgid "Fill"
|
||||
msgstr "Remplir"
|
||||
|
||||
#: FImageEditor.form:672
|
||||
#: FImageEditor.form:683
|
||||
msgid "Resize or stretch image"
|
||||
msgstr "Redimensionner ou étirer l'image"
|
||||
|
||||
#: FImageEditor.form:681 FImageRotate.form:11
|
||||
#: FImageEditor.form:692 FImageRotate.form:11
|
||||
msgid "Rotate image"
|
||||
msgstr "Rotation de l'image"
|
||||
|
||||
|
@ -2323,110 +2323,126 @@ msgstr "Pentagone"
|
|||
msgid "Hexagon"
|
||||
msgstr "Hexagone"
|
||||
|
||||
#: FImageProperty.form:116 FReportBrushChooser.form:49
|
||||
#: FImageProperty.form:126 FReportBrushChooser.form:49
|
||||
msgid "Color"
|
||||
msgstr "Couleur"
|
||||
|
||||
#: FImageProperty.form:147
|
||||
#: FImageProperty.form:157
|
||||
msgid "Gradient"
|
||||
msgstr "Dégradé"
|
||||
|
||||
#: FImageProperty.form:163 FReportBrushChooser.form:49
|
||||
#: FImageProperty.form:173 FReportBrushChooser.form:49
|
||||
msgid "Linear gradient"
|
||||
msgstr "Dégradé linéaire"
|
||||
|
||||
#: FImageProperty.form:170 FReportBrushChooser.form:49
|
||||
#: FImageProperty.form:180 FReportBrushChooser.form:49
|
||||
msgid "Radial gradient"
|
||||
msgstr "Dégradé circulaire"
|
||||
|
||||
#: FImageProperty.form:194 FReportBrushChooser.form:111
|
||||
#: FImageProperty.form:204 FReportBrushChooser.form:111
|
||||
msgid "Add gradient stop"
|
||||
msgstr "Ajouter une couleur de dégradé"
|
||||
|
||||
#: FImageProperty.form:200 FReportBrushChooser.form:117
|
||||
#: FImageProperty.form:210 FReportBrushChooser.form:117
|
||||
msgid "Remove gradient stop"
|
||||
msgstr "Supprimer une couleur de dégradé"
|
||||
|
||||
#: FImageProperty.form:206 FReportBrushChooser.form:123
|
||||
#: FImageProperty.form:216 FReportBrushChooser.form:123
|
||||
msgid "Select gradient stop color..."
|
||||
msgstr "Sélectionnez la couleur de dégradé..."
|
||||
|
||||
#: FImageProperty.form:212 FReportBrushChooser.form:129
|
||||
#: FImageProperty.form:222 FReportBrushChooser.form:129
|
||||
msgid "Invert gradient"
|
||||
msgstr "Inverser le dégradé"
|
||||
|
||||
#: FImageProperty.form:234 FReportBrushChooser.form:145
|
||||
#: FImageProperty.form:244 FReportBrushChooser.form:145
|
||||
msgid "Radius"
|
||||
msgstr "Rayon"
|
||||
|
||||
#: FImageProperty.form:301
|
||||
#: FImageProperty.form:311
|
||||
msgid "Clipboard"
|
||||
msgstr "Presse-papier"
|
||||
|
||||
#: FImageProperty.form:313
|
||||
#: FImageProperty.form:323
|
||||
msgid "Shapes"
|
||||
msgstr "Formes"
|
||||
|
||||
#: FImageProperty.form:341
|
||||
#: FImageProperty.form:351
|
||||
msgid "Opacity"
|
||||
msgstr "Opacité"
|
||||
|
||||
#: FImageProperty.form:360 FSelectIcon.form:54 FTranslate.class:70
|
||||
#: FImageProperty.form:370 FSelectIcon.form:54 FTranslate.class:70
|
||||
msgid "Size"
|
||||
msgstr "Taille"
|
||||
|
||||
#: FImageProperty.form:377
|
||||
#: FImageProperty.form:387
|
||||
msgid "Tolerance"
|
||||
msgstr "Tolérance"
|
||||
|
||||
#: FImageProperty.form:405
|
||||
#: FImageProperty.form:415
|
||||
msgid "Brightness"
|
||||
msgstr "Luminosité"
|
||||
|
||||
#: FImageProperty.form:423
|
||||
#: FImageProperty.form:433
|
||||
msgid "Contrast"
|
||||
msgstr "Contraste"
|
||||
|
||||
#: FImageProperty.form:441
|
||||
#: FImageProperty.form:451
|
||||
msgid "Gamma"
|
||||
msgstr "Gamma"
|
||||
|
||||
#: FImageProperty.form:459
|
||||
#: FImageProperty.form:469
|
||||
msgid "Lightness"
|
||||
msgstr "Clarté"
|
||||
|
||||
#: FImageProperty.form:477
|
||||
#: FImageProperty.form:487
|
||||
msgid "Hue"
|
||||
msgstr "Teinte"
|
||||
|
||||
#: FImageProperty.form:495
|
||||
#: FImageProperty.form:505
|
||||
msgid "Saturation"
|
||||
msgstr "Saturation"
|
||||
|
||||
#: FImageProperty.form:513
|
||||
#: FImageProperty.form:523
|
||||
msgid "Blur"
|
||||
msgstr "Flou"
|
||||
|
||||
#: FImageProperty.form:535 FImportTable.form:187
|
||||
#: FImageProperty.form:545 FImportTable.form:187
|
||||
msgid "Preview"
|
||||
msgstr "Aperçu"
|
||||
|
||||
#: FImageProperty.form:547 FOption.form:1069 FProjectProperty.form:686
|
||||
#: FImageProperty.form:557 FOption.form:1069 FProjectProperty.form:686
|
||||
msgid "Reset"
|
||||
msgstr "Réinitialiser"
|
||||
|
||||
#: FImageProperty.form:554 FMain.form:365 FPatch.form:86
|
||||
#: FImageProperty.form:564 FMain.form:365 FPatch.form:86
|
||||
msgid "Apply"
|
||||
msgstr "Appliquer"
|
||||
|
||||
#: FImageProperty.form:572
|
||||
#: FImageProperty.form:582
|
||||
msgid "Grid resolution"
|
||||
msgstr "Résolution de la grille"
|
||||
|
||||
#: FImageProperty.form:586
|
||||
#: FImageProperty.form:596
|
||||
msgid "Subdivision"
|
||||
msgstr "Sous-divisions"
|
||||
|
||||
#: FImageProperty.form:625
|
||||
msgid "Font"
|
||||
msgstr "Police"
|
||||
|
||||
#: FImageProperty.form:630
|
||||
msgid "Left align"
|
||||
msgstr "Aligner à gauche"
|
||||
|
||||
#: FImageProperty.form:639
|
||||
msgid "Center align"
|
||||
msgstr "Aligner au centre"
|
||||
|
||||
#: FImageProperty.form:647
|
||||
msgid "Right align"
|
||||
msgstr "Aligner à droite"
|
||||
|
||||
#: FImageQuality.form:10
|
||||
msgid "Image quality"
|
||||
msgstr "-"
|
||||
|
|
|
@ -164,14 +164,16 @@ End
|
|||
Public Sub Background_Draw()
|
||||
|
||||
Dim FW As Integer
|
||||
Dim iCol As Integer
|
||||
|
||||
If $bBorder Then FW = Style.FrameWidth
|
||||
|
||||
If Me.Background <> Color.Default Then Draw.FillRect(FW, FW, Draw.W - FW * 2, Draw.H - FW * 2, Me.Background)
|
||||
iCol = Me.Background
|
||||
If iCol = Color.Default Then iCol = Color.TextBackground
|
||||
|
||||
If $bBorder Then
|
||||
Draw.Style.Box(0, 0, $hBackground.W, $hBackground.H)
|
||||
Endif
|
||||
Draw.FillRect(FW, FW, Draw.W - FW * 2, Draw.H - FW * 2, iCol)
|
||||
|
||||
If $bBorder Then Draw.Style.Box(0, 0, $hBackground.W, $hBackground.H)
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ Public Sub Paint(hImage As Image, iAction As Integer, Optional bAll As Boolean)
|
|||
Dim I As Integer
|
||||
Dim iMode As Integer
|
||||
Dim fDashOffset As Float
|
||||
Dim hExtent As RectF
|
||||
|
||||
'Dim hExtent As RectF
|
||||
|
||||
fDashOffset = Paint.DashOffset
|
||||
|
||||
|
@ -118,33 +117,33 @@ Public Sub Paint(hImage As Image, iAction As Integer, Optional bAll As Boolean)
|
|||
|
||||
Endif
|
||||
|
||||
If iAction = ACTION_SELECT Then
|
||||
|
||||
For I = 0 To Shapes.Max
|
||||
If Current < 0 Or If Current = I Or If bAll Then
|
||||
If Shapes[I].IsText Then
|
||||
hExtent = Shapes[I].GetExtents()
|
||||
Paint.Rectangle(hExtent.X, hExtent.Y, hExtent.Width, hExtent.Height)
|
||||
|
||||
Paint.AntiAlias = False
|
||||
Paint.LineJoin = Paint.LineJoinMiter
|
||||
|
||||
Paint.Background = Color.Yellow
|
||||
Paint.Dash = Null
|
||||
|
||||
Paint.Stroke(True)
|
||||
|
||||
Paint.Background = Color.Black 'Color.SetAlpha(Color.Black, 128)
|
||||
Paint.Dash = [2.0, 2.0]
|
||||
Paint.DashOffset = 0
|
||||
|
||||
Paint.Stroke()
|
||||
|
||||
Endif
|
||||
Endif
|
||||
Next
|
||||
|
||||
Endif
|
||||
' If iAction = ACTION_SELECT Then
|
||||
'
|
||||
' For I = 0 To Shapes.Max
|
||||
' If Current < 0 Or If Current = I Or If bAll Then
|
||||
' If Shapes[I].IsText Then
|
||||
' hExtent = Shapes[I].GetExtents()
|
||||
' Paint.Rectangle(hExtent.X, hExtent.Y, hExtent.Width, hExtent.Height)
|
||||
'
|
||||
' Paint.AntiAlias = False
|
||||
' Paint.LineJoin = Paint.LineJoinMiter
|
||||
'
|
||||
' Paint.Background = Color.Yellow
|
||||
' Paint.Dash = Null
|
||||
'
|
||||
' Paint.Stroke(True)
|
||||
'
|
||||
' Paint.Background = Color.Black 'Color.SetAlpha(Color.Black, 128)
|
||||
' Paint.Dash = [2.0, 2.0]
|
||||
' Paint.DashOffset = 0
|
||||
'
|
||||
' Paint.Stroke()
|
||||
'
|
||||
' Endif
|
||||
' Endif
|
||||
' Next
|
||||
'
|
||||
' Endif
|
||||
|
||||
|
||||
If iAction = ACTION_HANDLE Then
|
||||
|
@ -245,7 +244,7 @@ Public Sub Paint(hImage As Image, iAction As Integer, Optional bAll As Boolean)
|
|||
Paint.Stroke(True)
|
||||
|
||||
Paint.Background = Color.Black 'Color.SetAlpha(Color.Black, 128)
|
||||
Paint.Dash = [2.0, 2.0]
|
||||
Paint.Dash = [4.0, 4.0]
|
||||
Paint.DashOffset = fDashOffset
|
||||
'
|
||||
' If _Invert Then
|
||||
|
@ -392,6 +391,7 @@ Public Sub Text(X As Integer, Y As Integer, sText As String, sFont As String, iA
|
|||
Dim hPoly As PointF[]
|
||||
Dim hShape As CImageShape
|
||||
Dim hPoint As PointF
|
||||
Dim hExtents As PaintExtents
|
||||
|
||||
'If W = 0 Or If H = 0 Then Return
|
||||
|
||||
|
@ -400,7 +400,8 @@ Public Sub Text(X As Integer, Y As Integer, sText As String, sFont As String, iA
|
|||
hImage = New Image(1, 1)
|
||||
Paint.Begin(hImage)
|
||||
Paint.Font = Font[sFont]
|
||||
Paint.Text(sText, X, Y) ', W, H, iAlign)
|
||||
hExtents = Paint.TextExtents(sText)
|
||||
Paint.Text(sText, X, Y, hExtents.Width, hExtents.Height, Align.TopNormal + iAlign) ', W, H, iAlign)
|
||||
hOutline = Paint.PathOutline
|
||||
|
||||
For Each hPoly In hOutline
|
||||
|
@ -654,14 +655,22 @@ Public Sub Rotate(fAngle As Float)
|
|||
|
||||
End
|
||||
|
||||
Public Sub Scale(SX As Float, SY As Float)
|
||||
Public Sub Scale(SX As Float, SY As Float, Optional bTopLeft As Boolean)
|
||||
|
||||
Dim hMatrix As New PaintMatrix
|
||||
Dim hExt As RectF = GetExtents()
|
||||
|
||||
hMatrix.Translate(hExt.X + hExt.W / 2, hExt.Y + hExt.H / 2)
|
||||
If bTopLeft Then
|
||||
hMatrix.Translate(hExt.X, hExt.Y)
|
||||
Else
|
||||
hMatrix.Translate(hExt.X + hExt.W / 2, hExt.Y + hExt.H / 2)
|
||||
Endif
|
||||
hMatrix.Scale(SX, SY)
|
||||
hMatrix.Translate(- (hExt.X + hExt.W / 2), - (hExt.Y + hExt.H / 2))
|
||||
If bTopLeft Then
|
||||
hMatrix.Translate(- hExt.X, - hExt.Y)
|
||||
Else
|
||||
hMatrix.Translate(- (hExt.X + hExt.W / 2), - (hExt.Y + hExt.H / 2))
|
||||
Endif
|
||||
Apply(hMatrix)
|
||||
|
||||
End
|
||||
|
|
|
@ -1009,7 +1009,7 @@ Public Sub imvImage_MouseMove()
|
|||
|
||||
Case "text"
|
||||
|
||||
$hLastPoint = $hCurrentPoint
|
||||
$hLastPoint = GetImagePos() '$hCurrentPoint
|
||||
FImageProperty.RefreshTextOption
|
||||
|
||||
Case "ellipse"
|
||||
|
@ -1052,9 +1052,6 @@ Public Sub imvImage_MouseMove()
|
|||
|
||||
Else If $iChangeAction Then
|
||||
|
||||
XC = $hChangeRect.X + $hChangeRect.W / 2
|
||||
YC = $hChangeRect.Y + $hChangeRect.H / 2
|
||||
|
||||
If $sTool = "change" Then
|
||||
$hSelect = $aUndo[$aUndo.Max].Copy()
|
||||
hSelect = $hSelect
|
||||
|
@ -1066,13 +1063,26 @@ Public Sub imvImage_MouseMove()
|
|||
Select Case $iChangeAction
|
||||
|
||||
Case CHANGE_RESIZE
|
||||
If $bCtrl Then
|
||||
hSelect.Scale(($hCurrentPoint.X - XC) / ($hLastPoint.X - XC), ($hCurrentPoint.X - XC) / ($hLastPoint.X - XC))
|
||||
|
||||
If $bShift Then
|
||||
XC = $hChangeRect.X + $hChangeRect.W / 2
|
||||
YC = $hChangeRect.Y + $hChangeRect.H / 2
|
||||
Else
|
||||
hSelect.Scale(($hCurrentPoint.X - XC) / ($hLastPoint.X - XC), ($hCurrentPoint.Y - YC) / ($hLastPoint.Y - YC))
|
||||
XC = $hChangeRect.X
|
||||
YC = $hChangeRect.Y
|
||||
Endif
|
||||
|
||||
If $bCtrl Then
|
||||
hSelect.Scale(($hCurrentPoint.X - XC) / ($hLastPoint.X - XC), ($hCurrentPoint.X - XC) / ($hLastPoint.X - XC), Not $bShift)
|
||||
Else
|
||||
hSelect.Scale(($hCurrentPoint.X - XC) / ($hLastPoint.X - XC), ($hCurrentPoint.Y - YC) / ($hLastPoint.Y - YC), Not $bShift)
|
||||
Endif
|
||||
|
||||
Case CHANGE_ROTATE
|
||||
|
||||
XC = $hChangeRect.X + $hChangeRect.W / 2
|
||||
YC = $hChangeRect.Y + $hChangeRect.H / 2
|
||||
|
||||
A = ($hLastPoint.X - XC) * ($hCurrentPoint.X - XC) + ($hLastPoint.Y - YC) * ($hCurrentPoint.Y - YC)
|
||||
Try A /= Hyp($hLastPoint.X - XC, $hLastPoint.Y - YC) * Hyp($hCurrentPoint.X - XC, $hCurrentPoint.Y - YC)
|
||||
If Not Error Then
|
||||
|
@ -1252,7 +1262,7 @@ Public Sub imvImage_MouseUp()
|
|||
Endif
|
||||
|
||||
Case "change"
|
||||
If $iChangeAction = CHANGE_NOTHING Then $hSelect.SelectAll
|
||||
If $iChangeAction = CHANGE_NOTHING And If $hSelect Then $hSelect.SelectAll
|
||||
If $hLastPoint <> $hCurrentPoint Then
|
||||
RefreshSelection
|
||||
Else If $iChangeAction <> CHANGE_SELECT Then
|
||||
|
@ -1458,8 +1468,9 @@ Public Sub imvImage_Draw(hZoom As Image)
|
|||
|
||||
Endif
|
||||
|
||||
Paint.LineWidth = 2 / imvImage.Zoom
|
||||
Paint.LineWidth = 1 / imvImage.Zoom
|
||||
Paint.DashOffset = - $fDashOffset
|
||||
|
||||
$hSelect.Paint($hImage, CImageSelection.ACTION_SELECT, True)
|
||||
|
||||
' CImageSelection.PaintingSelection = True
|
||||
|
@ -1711,8 +1722,8 @@ End
|
|||
|
||||
Public Sub timSelect_Timer()
|
||||
|
||||
$fDashOffset += 0.5
|
||||
If $fDashOffset >= 4 Then $fDashOffset = 0
|
||||
Inc $fDashOffset
|
||||
If $fDashOffset >= 8 Then $fDashOffset = 0
|
||||
imvImage.Refresh
|
||||
|
||||
End
|
||||
|
@ -2752,10 +2763,21 @@ Public Sub btnHide_Click()
|
|||
|
||||
End
|
||||
|
||||
Public Sub UpdateText(sText As String, sFont As String)
|
||||
Public Sub UpdateText(sText As String, sFont As String, iAlign As Integer)
|
||||
|
||||
$hSelect = $hTextSelect.Copy()
|
||||
$hSelect.Text($hLastPoint.X, $hLastPoint.Y, sText, sFont, Align.Left)
|
||||
$hSelect.Text($hLastPoint.X, $hLastPoint.Y, sText, sFont, iAlign)
|
||||
imvImage.Refresh
|
||||
|
||||
End
|
||||
|
||||
Public Sub imvImage_MouseWheel()
|
||||
|
||||
If Mouse.Forward Then
|
||||
btnZoomIn_Click
|
||||
Else
|
||||
btnZoomOut_Click
|
||||
Endif
|
||||
Stop Event
|
||||
|
||||
End
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
{ mnuHideSelection Menu
|
||||
Action = ".hide-selection"
|
||||
Text = ("Hide selection")
|
||||
Picture = Picture["img/draw/hide.png"]
|
||||
Shortcut = "Esc"
|
||||
}
|
||||
{ mnuSelection Menu
|
||||
|
@ -148,17 +149,19 @@
|
|||
Picture = Picture["img/draw/rotate-right.png"]
|
||||
Shortcut = "Ctrl+>"
|
||||
}
|
||||
{ Menu3 Menu
|
||||
}
|
||||
{ mnuResize Menu btnResize
|
||||
Name = "mnuResize"
|
||||
Action = ".resize"
|
||||
Text = ("Resize") & "..."
|
||||
Picture = Picture["icon:/small/zoom-fit"]
|
||||
Picture = Picture["img/draw/resize.png"]
|
||||
}
|
||||
{ mnuRotate Menu btnRotate
|
||||
Name = "mnuRotate"
|
||||
Action = ".rotate"
|
||||
Text = ("Rotate") & "..."
|
||||
Picture = Picture["icon:/small/rotate-right"]
|
||||
Picture = Picture["img/draw/rotate.png"]
|
||||
}
|
||||
}
|
||||
{ mnuZoom Menu
|
||||
|
@ -302,31 +305,49 @@
|
|||
Picture = Picture["icon:/small/zoom-fit"]
|
||||
}
|
||||
{ btnGrid ToolButton
|
||||
MoveScaled(38,0,4,4)
|
||||
MoveScaled(37,0,4,4)
|
||||
ToolTip = ("Drawing grid")
|
||||
Action = ".draw-grid"
|
||||
AutoResize = True
|
||||
Picture = Picture["img/draw/grid.png"]
|
||||
Toggle = True
|
||||
}
|
||||
{ btnResize ToolButton
|
||||
MoveScaled(40,0,11,4)
|
||||
Visible = False
|
||||
ToolTip = ("Resize or stretch image")
|
||||
Action = ".resize"
|
||||
AutoResize = True
|
||||
Text = ("Resize") & "..."
|
||||
Picture = Picture["img/draw/resize.png"]
|
||||
}
|
||||
{ btnRotate ToolButton
|
||||
MoveScaled(50,0,11,4)
|
||||
Visible = False
|
||||
ToolTip = ("Rotate image")
|
||||
Action = ".rotate"
|
||||
AutoResize = True
|
||||
Text = ("Rotate") & "..."
|
||||
Picture = Picture["img/draw/rotate.png"]
|
||||
}
|
||||
{ Separator4 Separator
|
||||
MoveScaled(41,0,1.1429,4)
|
||||
MoveScaled(61,0,1.1429,4)
|
||||
}
|
||||
{ btnCopy ToolButton
|
||||
MoveScaled(42,0,4,4)
|
||||
MoveScaled(62,0,4,4)
|
||||
ToolTip = ("Copy")
|
||||
Action = ".copy"
|
||||
Picture = Picture["icon:/small/copy"]
|
||||
}
|
||||
{ btnCut ToolButton
|
||||
MoveScaled(45,0,4,4)
|
||||
MoveScaled(65,0,4,4)
|
||||
ToolTip = ("Cut")
|
||||
Action = ".cut"
|
||||
Picture = Picture["icon:/small/cut"]
|
||||
}
|
||||
{ btnPaste ToolButton btnTool
|
||||
Name = "btnPaste"
|
||||
MoveScaled(48,0,4,4)
|
||||
MoveScaled(68,0,4,4)
|
||||
Tag = "paste"
|
||||
ToolTip = ("Paste")
|
||||
Action = ".tool-paste"
|
||||
|
@ -334,11 +355,11 @@
|
|||
Toggle = True
|
||||
}
|
||||
{ Separator2 Separator
|
||||
MoveScaled(52,0,1.1429,4)
|
||||
MoveScaled(72,0,1.1429,4)
|
||||
}
|
||||
{ btnMove ToolButton btnTool
|
||||
Name = "btnMove"
|
||||
MoveScaled(54,0,4,4)
|
||||
MoveScaled(74,0,4,4)
|
||||
Tag = "move"
|
||||
ToolTip = ("Move")
|
||||
Action = ".tool-move"
|
||||
|
@ -348,7 +369,7 @@
|
|||
}
|
||||
{ btnDraw ToolButton btnTool
|
||||
Name = "btnDraw"
|
||||
MoveScaled(57,0,4,4)
|
||||
MoveScaled(77,0,4,4)
|
||||
Tag = "draw"
|
||||
ToolTip = ("Draw")
|
||||
Action = ".tool-draw"
|
||||
|
@ -357,19 +378,16 @@
|
|||
}
|
||||
{ btnErase ToolButton btnTool
|
||||
Name = "btnErase"
|
||||
MoveScaled(60,0,4,4)
|
||||
MoveScaled(80,0,4,4)
|
||||
Tag = "erase"
|
||||
ToolTip = ("Erase")
|
||||
Action = ".tool-erase"
|
||||
Picture = Picture["icon:/small/erase"]
|
||||
Toggle = True
|
||||
}
|
||||
{ Separator6 Separator
|
||||
MoveScaled(65,0,1.1429,4)
|
||||
}
|
||||
{ btnLine ToolButton btnTool
|
||||
Name = "btnLine"
|
||||
MoveScaled(66,0,4,4)
|
||||
MoveScaled(83,0,4,4)
|
||||
Tag = "line"
|
||||
ToolTip = ("Line")
|
||||
Action = ".tool-line"
|
||||
|
@ -378,7 +396,7 @@
|
|||
}
|
||||
{ btnRectangle ToolButton btnTool
|
||||
Name = "btnRectangle"
|
||||
MoveScaled(69,0,4,4)
|
||||
MoveScaled(86,0,4,4)
|
||||
Tag = "rectangle"
|
||||
ToolTip = ("Rectangle")
|
||||
Action = ".tool-rectangle"
|
||||
|
@ -387,7 +405,7 @@
|
|||
}
|
||||
{ btnEllipse ToolButton btnTool
|
||||
Name = "btnEllipse"
|
||||
MoveScaled(72,0,4,4)
|
||||
MoveScaled(89,0,4,4)
|
||||
Tag = "ellipse"
|
||||
ToolTip = ("Ellipse")
|
||||
Action = ".tool-ellipse"
|
||||
|
@ -396,7 +414,7 @@
|
|||
}
|
||||
{ btnText ToolButton btnTool
|
||||
Name = "btnText"
|
||||
MoveScaled(75,0,4,4)
|
||||
MoveScaled(92,0,4,4)
|
||||
Tag = "text"
|
||||
ToolTip = ("Text")
|
||||
Action = ".tool-text"
|
||||
|
@ -405,7 +423,7 @@
|
|||
}
|
||||
{ btnMagic ToolButton btnTool
|
||||
Name = "btnMagic"
|
||||
MoveScaled(79,0,4,4)
|
||||
MoveScaled(96,0,4,4)
|
||||
Tag = "magic"
|
||||
ToolTip = ("Magic wand")
|
||||
Action = ".tool-magic"
|
||||
|
@ -414,7 +432,7 @@
|
|||
}
|
||||
{ btnEditSelection ToolButton btnTool
|
||||
Name = "btnEditSelection"
|
||||
MoveScaled(83,0,4,4)
|
||||
MoveScaled(100,0,4,4)
|
||||
Tag = "change"
|
||||
ToolTip = ("Edit selection")
|
||||
Action = ".tool-change"
|
||||
|
@ -422,105 +440,86 @@
|
|||
Toggle = True
|
||||
}
|
||||
{ Separator8 Separator
|
||||
MoveScaled(87,0,1,4)
|
||||
MoveScaled(104,0,1,4)
|
||||
}
|
||||
{ btnHide ToolButton
|
||||
MoveScaled(89,0,4,4)
|
||||
MoveScaled(106,0,4,4)
|
||||
ToolTip = ("Hide selection")
|
||||
Action = ".hide"
|
||||
Picture = Picture["img/draw/hide.png"]
|
||||
}
|
||||
{ btnInvert ToolButton
|
||||
MoveScaled(92,0,4,4)
|
||||
MoveScaled(109,0,4,4)
|
||||
ToolTip = ("Invert selection")
|
||||
Action = ".invert"
|
||||
Picture = Picture["img/draw/invert.png"]
|
||||
}
|
||||
{ btnDuplicate ToolButton
|
||||
MoveScaled(95,0,4,4)
|
||||
MoveScaled(112,0,4,4)
|
||||
ToolTip = ("Duplicate selection")
|
||||
Action = ".duplicate"
|
||||
Picture = Picture["img/draw/duplicate.png"]
|
||||
}
|
||||
{ btnOffset ToolButton
|
||||
MoveScaled(99,0,4,4)
|
||||
MoveScaled(116,0,4,4)
|
||||
ToolTip = ("Offset selection")
|
||||
Action = ".offset"
|
||||
Picture = Picture["img/draw/offset.png"]
|
||||
}
|
||||
{ Separator5 Separator
|
||||
MoveScaled(104,0,1,4)
|
||||
MoveScaled(121,0,1,4)
|
||||
}
|
||||
{ btnStroke ToolButton
|
||||
MoveScaled(105,0,4,4)
|
||||
MoveScaled(122,0,4,4)
|
||||
ToolTip = ("Stroke")
|
||||
Action = ".stroke"
|
||||
Picture = Picture["img/draw/draw-brush.png"]
|
||||
}
|
||||
{ btnFill ToolButton
|
||||
MoveScaled(109,0,4,4)
|
||||
MoveScaled(126,0,4,4)
|
||||
ToolTip = ("Fill")
|
||||
Action = ".fill"
|
||||
Picture = Picture["icon:/small/fill"]
|
||||
}
|
||||
{ btnClear ToolButton
|
||||
MoveScaled(113,0,4,4)
|
||||
MoveScaled(130,0,4,4)
|
||||
ToolTip = ("Clear")
|
||||
Action = ".clear"
|
||||
Picture = Picture["img/draw/draw-eraser.png"]
|
||||
}
|
||||
{ Separator7 Separator
|
||||
MoveScaled(117,0,1.1429,4)
|
||||
MoveScaled(134,0,1.1429,4)
|
||||
}
|
||||
{ btnCrop ToolButton
|
||||
MoveScaled(118,0,4,4)
|
||||
Visible = False
|
||||
MoveScaled(135,0,4,4)
|
||||
ToolTip = ("Crop")
|
||||
Action = ".crop"
|
||||
Picture = Picture["img/draw/crop.png"]
|
||||
}
|
||||
{ btnFlipH ToolButton
|
||||
MoveScaled(121,0,4,4)
|
||||
Visible = False
|
||||
MoveScaled(138,0,4,4)
|
||||
ToolTip = ("Horizontal flip")
|
||||
Action = ".flip-h"
|
||||
Picture = Picture["img/draw/hflip.png"]
|
||||
}
|
||||
{ btnFlipV ToolButton
|
||||
MoveScaled(124,0,4,4)
|
||||
Visible = False
|
||||
MoveScaled(141,0,4,4)
|
||||
ToolTip = ("Vertical flip")
|
||||
Action = ".flip-v"
|
||||
Picture = Picture["img/draw/vflip.png"]
|
||||
}
|
||||
{ btnRotateR ToolButton
|
||||
MoveScaled(127,0,4,4)
|
||||
MoveScaled(144,0,4,4)
|
||||
ToolTip = ("Rotate clockwise")
|
||||
Action = ".rotate-r"
|
||||
Picture = Picture["img/draw/rotate-right.png"]
|
||||
}
|
||||
{ btnRotateL ToolButton
|
||||
MoveScaled(130,0,4,4)
|
||||
MoveScaled(147,0,4,4)
|
||||
ToolTip = ("Rotate counter-clockwise")
|
||||
Action = ".rotate-l"
|
||||
Picture = Picture["img/draw/rotate-left.png"]
|
||||
}
|
||||
{ btnResize ToolButton
|
||||
MoveScaled(134,0,11,4)
|
||||
ToolTip = ("Resize or stretch image")
|
||||
Action = ".resize"
|
||||
AutoResize = True
|
||||
Text = ("Resize") & "..."
|
||||
Picture = Picture["icon:/small/zoom-fit"]
|
||||
}
|
||||
{ btnRotate ToolButton
|
||||
MoveScaled(144,0,11,4)
|
||||
ToolTip = ("Rotate image")
|
||||
Action = ".rotate"
|
||||
AutoResize = True
|
||||
Text = ("Rotate") & "..."
|
||||
Picture = Picture["icon:/small/rotate-right"]
|
||||
}
|
||||
}
|
||||
{ Separator1 Separator
|
||||
MoveScaled(68,9,18,0)
|
||||
|
@ -544,8 +543,8 @@
|
|||
}
|
||||
}
|
||||
{ timSelect #Timer
|
||||
#MoveScaled(106,20)
|
||||
Delay = 50
|
||||
#MoveScaled(108,20)
|
||||
Delay = 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -607,6 +606,7 @@
|
|||
{ Action hide-selection
|
||||
Text = "Hide selection"
|
||||
Shortcut = "Esc"
|
||||
Picture = "img/draw/hide.png"
|
||||
}
|
||||
{ Action invert
|
||||
Text = "Invert selection"
|
||||
|
@ -636,12 +636,12 @@
|
|||
{ Action resize
|
||||
Text = "Resize"
|
||||
Shortcut = ""
|
||||
Picture = "icon:/small/zoom-fit"
|
||||
Picture = "img/draw/resize.png"
|
||||
}
|
||||
{ Action rotate
|
||||
Text = "Rotate"
|
||||
Shortcut = ""
|
||||
Picture = "icon:/small/rotate-right"
|
||||
Picture = "img/draw/rotate.png"
|
||||
}
|
||||
{ Action rotate-l
|
||||
Text = "Rotate counter-clockwise"
|
||||
|
@ -752,7 +752,7 @@
|
|||
{ Toolbars
|
||||
{ Toolbar image
|
||||
Text = "Image editor"
|
||||
List = "save,reload,undo,redo,zoom-in,zoom,zoom-out,zoom-normal,zoom-fit,draw-grid,copy,cut,tool-paste,tool-move,tool-draw,tool-erase,tool-line,tool-rectangle,tool-ellipse,tool-text,tool-magic,tool-change,hide,invert,duplicate,offset,stroke,fill,clear,crop,flip-h,flip-v,rotate-r,rotate-l,resize,rotate"
|
||||
Default = "save,reload,undo,redo,|,zoom-in,zoom,zoom-out,zoom-normal,zoom-fit,draw-grid,|,copy,cut,tool-paste,|,tool-move,tool-draw,tool-erase,|,tool-line,tool-rectangle,tool-ellipse,tool-text,tool-magic,tool-change,|,hide,invert,duplicate,offset,|,stroke,fill,clear,|,rotate-r,rotate-l,resize,rotate"
|
||||
List = "save,reload,undo,redo,zoom-in,zoom,zoom-out,zoom-normal,zoom-fit,draw-grid,resize,rotate,copy,cut,tool-paste,tool-move,tool-draw,tool-erase,tool-line,tool-rectangle,tool-ellipse,tool-text,tool-magic,tool-change,hide,invert,duplicate,offset,stroke,fill,clear,crop,flip-h,flip-v,rotate-r,rotate-l"
|
||||
Default = "save,reload,undo,redo,|,zoom-in,zoom,zoom-out,zoom-normal,zoom-fit,draw-grid,|,copy,cut,tool-paste,|,tool-move,tool-draw,tool-erase,tool-line,tool-rectangle,tool-ellipse,tool-text,tool-magic,tool-change,|,hide,invert,duplicate,offset,|,stroke,fill,clear,|,crop,flip-h,flip-v,rotate-r,rotate-l"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1277,7 +1277,17 @@ End
|
|||
|
||||
Public Sub RefreshTextOption()
|
||||
|
||||
GetCurrent().UpdateText(txtText.Text, fchText.Value)
|
||||
Dim iAlign As Integer
|
||||
|
||||
If btnAlignCenter.Value Then
|
||||
iAlign = Align.Center
|
||||
Else If btnAlignRight.Value Then
|
||||
iAlign = Align.Right
|
||||
Else
|
||||
iAlign = Align.Left
|
||||
Endif
|
||||
|
||||
GetCurrent().UpdateText(txtText.Text, fchText.Value, iAlign)
|
||||
|
||||
End
|
||||
|
||||
|
@ -1293,3 +1303,22 @@ Public Sub fchText_Change()
|
|||
RefreshTextOption
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnAlignLeft_Click()
|
||||
|
||||
RefreshTextOption
|
||||
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnAlignCenter_Click()
|
||||
|
||||
RefreshTextOption
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnAlignRight_Click()
|
||||
|
||||
RefreshTextOption
|
||||
|
||||
End
|
||||
|
|
|
@ -431,12 +431,46 @@
|
|||
MoveScaled(3,126,60,22)
|
||||
Visible = False
|
||||
Margin = True
|
||||
{ fchText FontChooser
|
||||
MoveScaled(1,1,57,8)
|
||||
Border = False
|
||||
{ Panel11 HBox
|
||||
MoveScaled(1,1,58,8)
|
||||
{ HPanel11 HPanel
|
||||
MoveScaled(1,0,12,8)
|
||||
{ Label14 Label
|
||||
MoveScaled(1,0,6,4)
|
||||
Expand = True
|
||||
Text = ("Font")
|
||||
}
|
||||
{ btnAlignLeft ToolButton
|
||||
MoveScaled(0,4,4,4)
|
||||
ToolTip = ("Left align")
|
||||
Picture = Picture["icon:/small/text-left"]
|
||||
Radio = True
|
||||
Toggle = True
|
||||
Value = True
|
||||
}
|
||||
{ btnAlignCenter ToolButton
|
||||
MoveScaled(4,4,4,4)
|
||||
ToolTip = ("Center align")
|
||||
Picture = Picture["icon:/small/text-center"]
|
||||
Radio = True
|
||||
Toggle = True
|
||||
}
|
||||
{ btnAlignRight ToolButton
|
||||
MoveScaled(8,4,4,4)
|
||||
ToolTip = ("Right align")
|
||||
Picture = Picture["icon:/small/text-right"]
|
||||
Radio = True
|
||||
Toggle = True
|
||||
}
|
||||
}
|
||||
{ fchText FontChooser
|
||||
MoveScaled(19,0,38,8)
|
||||
Expand = True
|
||||
Border = False
|
||||
}
|
||||
}
|
||||
{ txtText TextArea
|
||||
MoveScaled(1,11,54,7)
|
||||
MoveScaled(1,15,54,7)
|
||||
Expand = True
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
Name = "Menu21"
|
||||
#Translate = False
|
||||
Text = "QT4"
|
||||
Tag = "gb.qt"
|
||||
Tag = "gb.qt4"
|
||||
}
|
||||
{ Menu27 Menu mnuSetGUI
|
||||
Name = "Menu27"
|
||||
|
|
|
@ -409,7 +409,6 @@ Private Sub RefreshComponents()
|
|||
Endif
|
||||
|
||||
gvwComponent.Rows.Count = $aComp.Count
|
||||
gvwComponent.Columns[1].Width = -1
|
||||
|
||||
tabProject_Arrange
|
||||
|
||||
|
@ -1248,6 +1247,8 @@ Public Sub tabProject_Arrange()
|
|||
gvwLibrary.Rows[I].H = -1
|
||||
Next
|
||||
|
||||
gvwComponent.Columns[1].Width = -1
|
||||
|
||||
End
|
||||
|
||||
Public Sub gvwComponent_MouseMove()
|
||||
|
|
BIN
app/src/gambas3/img/background/cross.png
Normal file
After Width: | Height: | Size: 147 B |
|
@ -14,6 +14,8 @@ smoke
|
|||
hose
|
||||
star
|
||||
point
|
||||
cross
|
||||
circle
|
||||
vline
|
||||
hline
|
||||
hline
|
||||
square
|
BIN
app/src/gambas3/img/background/square.png
Normal file
After Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 390 B |
BIN
app/src/gambas3/img/draw/resize.png
Normal file
After Width: | Height: | Size: 325 B |
BIN
app/src/gambas3/img/draw/rotate.png
Normal file
After Width: | Height: | Size: 458 B |
|
@ -2142,10 +2142,54 @@ EnsureCurrentVisible_Timer
|
|||
m
|
||||
|
||||
|
||||
_GetFirstIndex
|
||||
m
|
||||
i
|
||||
|
||||
TabBar_Arrange
|
||||
m
|
||||
|
||||
|
||||
Arrow_Enter
|
||||
m
|
||||
|
||||
|
||||
Arrow_Leave
|
||||
m
|
||||
|
||||
|
||||
Arrow_Draw
|
||||
m
|
||||
|
||||
|
||||
_GetBackground
|
||||
m
|
||||
i
|
||||
|
||||
Arrow_MouseDown
|
||||
m
|
||||
|
||||
|
||||
_MoveNext
|
||||
m
|
||||
|
||||
|
||||
_MovePrevious
|
||||
m
|
||||
|
||||
|
||||
Arrow_MouseUp
|
||||
m
|
||||
|
||||
|
||||
TimerRepeat_Timer
|
||||
m
|
||||
|
||||
|
||||
Arrow_DblClick
|
||||
m
|
||||
|
||||
|
||||
Remove
|
||||
m
|
||||
|
||||
|
@ -2170,22 +2214,6 @@ TabBarContainer_Draw
|
|||
m
|
||||
|
||||
|
||||
TabBar_Draw
|
||||
m
|
||||
|
||||
|
||||
_GetBackground
|
||||
m
|
||||
i
|
||||
|
||||
TabBar_MouseDown
|
||||
m
|
||||
|
||||
|
||||
TabBar_DblClick
|
||||
m
|
||||
|
||||
|
||||
Panel_Draw
|
||||
m
|
||||
|
||||
|
@ -2194,22 +2222,10 @@ _SetVisible
|
|||
m
|
||||
|
||||
(Index)i(bVisible)b
|
||||
_MoveNext
|
||||
m
|
||||
|
||||
|
||||
_MovePrevious
|
||||
m
|
||||
|
||||
|
||||
_IsVisible
|
||||
m
|
||||
b
|
||||
(Index)i
|
||||
_GetFirstIndex
|
||||
m
|
||||
i
|
||||
|
||||
_Close
|
||||
m
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.5.90
|
||||
Title=More controls for graphical components
|
||||
Startup=FFont
|
||||
Startup=FTabPanel
|
||||
Version=3.5.90
|
||||
VersionFile=1
|
||||
Component=gb.image
|
||||
|
@ -9,7 +9,7 @@ Component=gb.gui
|
|||
Component=gb.form
|
||||
Component=gb.settings
|
||||
Authors="Benoît Minisini"
|
||||
Environment="GB_GUI=gb.qt"
|
||||
Environment="GB_GUI=gb.gtk"
|
||||
TabSize=2
|
||||
Translate=1
|
||||
Language=en
|
||||
|
|
|
@ -28,7 +28,7 @@ Private $hTabBarContainer As DrawingArea
|
|||
'Private $hLeftArrow As DrawingArea
|
||||
'Private $hRightArrow As DrawingArea
|
||||
Private $X As Integer
|
||||
Private $bArrow As Boolean
|
||||
'Private $bArrow As Boolean
|
||||
|
||||
Private $aCont As New _TabPanelContainer[]
|
||||
Private $aButton As New _TabPanelButton[]
|
||||
|
@ -40,9 +40,15 @@ Private $iCurrent As Integer = -1
|
|||
Private $hPanel As DrawingArea
|
||||
|
||||
Private $hTimerEnsureVisible As Timer
|
||||
Private $hTimerRepeat As Timer
|
||||
Private $iRepeatInc As Integer
|
||||
Private $iRepeatStart As Integer
|
||||
|
||||
Private Const ARROW_WIDTH As Integer = 12
|
||||
|
||||
Private $hRightArrow As DrawingArea
|
||||
Private $hLeftArrow As DrawingArea
|
||||
|
||||
Public Sub _new()
|
||||
|
||||
$hTabBar = New DrawingArea(Me) As "TabBar"
|
||||
|
@ -58,6 +64,13 @@ Public Sub _new()
|
|||
|
||||
$hTabBarContainer = New DrawingArea($hTabBar) As "TabBarContainer"
|
||||
$hTabBarContainer.Focus = True
|
||||
|
||||
$hRightArrow = New DrawingArea($hTabBar) As "Arrow"
|
||||
$hRightArrow.Ignore = True
|
||||
$hRightArrow.Mouse = Mouse.Pointing
|
||||
$hLeftArrow = New DrawingArea($hTabBar) As "Arrow"
|
||||
$hLeftArrow.Ignore = True
|
||||
$hLeftArrow.Mouse = Mouse.Pointing
|
||||
|
||||
$hPanel = New DrawingArea(Me) As "Panel"
|
||||
$hPanel.Expand = True
|
||||
|
@ -83,6 +96,7 @@ End
|
|||
Public Sub EnsureCurrentVisible_Timer()
|
||||
|
||||
Dim X, W As Integer
|
||||
Dim iLeftIndex, iRightIndex As Integer
|
||||
|
||||
$hTimerEnsureVisible = Null
|
||||
|
||||
|
@ -103,8 +117,8 @@ Public Sub EnsureCurrentVisible_Timer()
|
|||
|
||||
If X < ARROW_WIDTH Then
|
||||
W += ARROW_WIDTH - X
|
||||
Else If X >= ($hTabBar.W - .W) Then
|
||||
W -= X - ($hTabBar.W - .W)
|
||||
Else If X >= ($hTabBar.W - .W - ARROW_WIDTH) Then
|
||||
W -= X - ($hTabBar.W - .W - ARROW_WIDTH)
|
||||
Endif
|
||||
|
||||
'M = .X + W - $hTabBar.W + ARROW_WIDTH
|
||||
|
@ -119,20 +133,11 @@ Public Sub EnsureCurrentVisible_Timer()
|
|||
'$X = Max($hTabBar.W - $hTabBarContainer.W, $X)
|
||||
'$X = Min(ARROW_WIDTH, $X)
|
||||
|
||||
If $aButton.Count Then
|
||||
With $aButton[$aButton.Max]
|
||||
$bArrow = ($X + .X) < 0
|
||||
End With
|
||||
Else
|
||||
$bArrow = False
|
||||
Endif
|
||||
|
||||
Else
|
||||
|
||||
If Me.W <= ($aButton[$iCurrent].W + ARROW_WIDTH) Then
|
||||
|
||||
$X = - $aButton[$iCurrent].X
|
||||
$bArrow = False
|
||||
|
||||
Else
|
||||
|
||||
|
@ -144,8 +149,8 @@ Public Sub EnsureCurrentVisible_Timer()
|
|||
X = $hTabBarContainer.X + .X
|
||||
W = .W
|
||||
|
||||
If X < 4 Then
|
||||
$X = $X + 4 - X
|
||||
If X < ARROW_WIDTH Then
|
||||
$X = $X + ARROW_WIDTH - X
|
||||
X = $X + .X
|
||||
Endif
|
||||
|
||||
|
@ -155,10 +160,6 @@ Public Sub EnsureCurrentVisible_Timer()
|
|||
$X -= ARROW_WIDTH
|
||||
Endif
|
||||
|
||||
'M = .X + W - $hTabBar.W + ARROW_WIDTH
|
||||
'If $iCurrent < $aButton.Max Then M += ARROW_WIDTH
|
||||
'$X = Max($X, - M)
|
||||
|
||||
End With
|
||||
|
||||
Endif
|
||||
|
@ -170,22 +171,45 @@ Public Sub EnsureCurrentVisible_Timer()
|
|||
|
||||
W = Me.W - $X
|
||||
|
||||
If $aButton.Count Then
|
||||
With $aButton[$aButton.Max]
|
||||
$bArrow = ($X + .X + .W) > $hTabBar.W
|
||||
End With
|
||||
Else
|
||||
$bArrow = False
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
If $bArrow Then
|
||||
W -= ARROW_WIDTH
|
||||
If System.RightToLeft Then $X += ARROW_WIDTH
|
||||
Endif
|
||||
'$bArrow = False
|
||||
|
||||
' If $bArrow Then
|
||||
' W -= ARROW_WIDTH
|
||||
' If System.RightToLeft Then $X += ARROW_WIDTH
|
||||
' Endif
|
||||
|
||||
$hTabBarContainer.Move($X, 0, W, $hTabBar.H)
|
||||
|
||||
If $hTabBar.W >= (ARROW_WIDTH * 3) And If $aButton.Count Then
|
||||
If System.RightToLeft Then
|
||||
iLeftIndex = GetLastIndex()
|
||||
iRightIndex = _GetFirstIndex()
|
||||
Else
|
||||
iLeftIndex = _GetFirstIndex()
|
||||
iRightIndex = GetLastIndex()
|
||||
Endif
|
||||
$hLeftArrow.Visible = $X < (- $aButton[iLeftIndex].X) '+ $aButton[iIndex].X + $aButton[iIndex].W) > $hTabBar.W
|
||||
$hRightArrow.Visible = ($X + $aButton[iRightIndex].X + $aButton[iRightIndex].W) > $hTabBar.W
|
||||
Else
|
||||
$hLeftArrow.Hide
|
||||
$hRightArrow.Hide
|
||||
Endif
|
||||
|
||||
CheckMouse
|
||||
|
||||
End
|
||||
|
||||
Private Sub CheckMouse()
|
||||
|
||||
Dim hButton As _TabPanelButton
|
||||
|
||||
If Not $bClosable Then Return
|
||||
|
||||
For Each hButton In $aButton
|
||||
hButton.Update
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
|
@ -223,8 +247,88 @@ Public Sub TabBar_Arrange()
|
|||
|
||||
_EnsureCurrentVisible
|
||||
|
||||
$hRightArrow.Move($hTabBar.W - ARROW_WIDTH, 0, ARROW_WIDTH, $hTabBar.H)
|
||||
$hLeftArrow.Move(0, 0, ARROW_WIDTH, $hTabBar.H)
|
||||
|
||||
End
|
||||
|
||||
Public Sub Arrow_Enter()
|
||||
|
||||
Last.Refresh
|
||||
|
||||
End
|
||||
|
||||
Public Sub Arrow_Leave()
|
||||
|
||||
Last.Refresh
|
||||
$hTimerRepeat = Null
|
||||
|
||||
End
|
||||
|
||||
Public Sub Arrow_Draw()
|
||||
|
||||
Paint.FillRect(0, 0, Paint.W, Paint.H - 1, _GetBackground())
|
||||
Style.PaintArrow(0, 0, Paint.W, Paint.H, If(Last = $hLeftArrow, Align.Left, Align.Right), Style.StateOf(Last))
|
||||
|
||||
End
|
||||
|
||||
Public Sub Arrow_MouseDown()
|
||||
|
||||
If Mouse.Left Then
|
||||
|
||||
If Last = $hRightArrow Xor System.RightToLeft Then
|
||||
Try _MoveNext()
|
||||
$iRepeatInc = 1
|
||||
Else
|
||||
Try _MovePrevious()
|
||||
$iRepeatInc = -1
|
||||
Endif
|
||||
|
||||
$hTimerRepeat = New Timer As "TimerRepeat"
|
||||
$hTimerRepeat.Delay = 100
|
||||
$hTimerRepeat.Start
|
||||
$iRepeatStart = 0
|
||||
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub Arrow_MouseUp()
|
||||
|
||||
$hTimerRepeat = Null
|
||||
|
||||
End
|
||||
|
||||
Public Sub TimerRepeat_Timer()
|
||||
|
||||
If $iRepeatStart < 3 Then
|
||||
Inc $iRepeatStart
|
||||
Else
|
||||
If $iRepeatInc > 0 Then
|
||||
Try _MoveNext()
|
||||
Else
|
||||
Try _MovePrevious()
|
||||
Endif
|
||||
If Error Then $hTimerRepeat = Null
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Arrow_DblClick()
|
||||
|
||||
If Mouse.Left Then
|
||||
If Last = $hRightArrow Then
|
||||
Try Me.Index = GetLastIndex()
|
||||
Else
|
||||
Try Me.Index = _GetFirstIndex()
|
||||
Endif
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
|
||||
|
||||
Private Function Count_Read() As Integer
|
||||
|
||||
Return $aCont.Count
|
||||
|
@ -486,77 +590,6 @@ Public Sub TabBarContainer_Draw()
|
|||
|
||||
End
|
||||
|
||||
Public Sub TabBar_Draw()
|
||||
|
||||
Dim X As Integer
|
||||
|
||||
If $bArrow Then
|
||||
|
||||
If System.RightToLeft Then
|
||||
|
||||
X = ARROW_WIDTH
|
||||
|
||||
If $bHighlight Then
|
||||
Draw.FillRect(0, 0, ARROW_WIDTH, $hTabBar.H, _GetBackground())
|
||||
Endif
|
||||
|
||||
Draw.Foreground = Color.LightForeground
|
||||
Draw.Style.Arrow(0, 0, 8, $hTabBar.H, Align.Left)
|
||||
Select Case $iOrientation
|
||||
Case Align.Top
|
||||
Draw.Line(X, $hTabBarContainer.H - 1, 0, $hTabBar.H - 1)
|
||||
Case Align.Bottom
|
||||
Draw.Line(X, 0, 0, 0)
|
||||
End Select
|
||||
|
||||
Else
|
||||
|
||||
X = $hTabBar.W - ARROW_WIDTH
|
||||
|
||||
If $bHighlight Then
|
||||
Draw.FillRect(X, 0, ARROW_WIDTH, $hTabBar.H, _GetBackground())
|
||||
Endif
|
||||
|
||||
Draw.Foreground = Color.LightForeground
|
||||
Draw.Style.Arrow($hTabBar.W - 8, 0, 8, $hTabBar.H, Align.Right)
|
||||
Select Case $iOrientation
|
||||
Case Align.Top
|
||||
Draw.Line(X, $hTabBarContainer.H - 1, $hTabBar.W - 1, $hTabBar.H - 1)
|
||||
Case Align.Bottom
|
||||
Draw.Line(X, 0, $hTabBar.W - 1, 0)
|
||||
End Select
|
||||
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub TabBar_MouseDown()
|
||||
|
||||
If Mouse.Left And If $bArrow Then
|
||||
If System.RightToLeft Then
|
||||
If Mouse.X < 6 Then Try Inc Me.Index
|
||||
Else
|
||||
If Mouse.X >= ($hTabBar.W - 6) Then Try Inc Me.Index
|
||||
Endif
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub TabBar_DblClick()
|
||||
|
||||
If Mouse.Left And If $bArrow Then
|
||||
If System.RightToLeft Then
|
||||
If Mouse.X < 6 Then Try Me.Index = Me.Count - 1
|
||||
Else
|
||||
If Mouse.X >= ($hTabBar.W - 6) Then Try Me.Index = Me.Count - 1
|
||||
Endif
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Panel_Draw()
|
||||
|
||||
If $bBorder Then
|
||||
|
|
|
@ -208,6 +208,7 @@ Private Sub Selected_Write(Value As Boolean)
|
|||
|
||||
$bSelected = Value
|
||||
SetMouse
|
||||
DrawingArea_MouseMove
|
||||
$hDrawingArea.Refresh
|
||||
|
||||
End
|
||||
|
@ -296,21 +297,39 @@ End
|
|||
Public Sub DrawingArea_MouseMove()
|
||||
|
||||
Dim bInClose As Boolean
|
||||
Dim X As Integer
|
||||
Dim bShowClose As Boolean
|
||||
|
||||
If System.RightToLeft Then
|
||||
bInClose = (Mouse.ScreenX - Me.ScreenX) < BUTTON_SIZE
|
||||
Else
|
||||
bInClose = (Mouse.ScreenX - Me.ScreenX) > (Me.W - BUTTON_SIZE - 1)
|
||||
X = Mouse.ScreenX - Me.ScreenX
|
||||
|
||||
If X >= 0 And If X < Me.W Then
|
||||
bShowClose = GetParent().Closable
|
||||
|
||||
If bShowClose Then
|
||||
If System.RightToLeft Then
|
||||
bInClose = (X >= 0) And (X < BUTTON_SIZE)
|
||||
Else
|
||||
bInClose = (X >= (Me.W - BUTTON_SIZE)) And (X < Me.W)
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
If bInClose <> $bInClose Then
|
||||
If bInClose <> $bInClose Or If bShowClose <> $bShowClose Then
|
||||
$bInClose = bInClose
|
||||
$bShowClose = bShowClose
|
||||
SetMouse
|
||||
$hDrawingArea.Refresh
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub Update()
|
||||
|
||||
DrawingArea_MouseMove
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Function RichText_Read() As String
|
||||
|
||||
If $bRichText Then Return $sText
|
||||
|
|
|
@ -22,4 +22,10 @@ Public Sub Form_Open()
|
|||
TabPanel2[I].Text = "Tab " & (I + 1)
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
Public Sub Form_DblClick()
|
||||
|
||||
|
||||
|
||||
End
|
||||
|
|
|
@ -11,18 +11,20 @@
|
|||
MoveScaled(5,7,36,23)
|
||||
#Translate = False
|
||||
Expand = True
|
||||
Closable = True
|
||||
Highlight = True
|
||||
Index = 0
|
||||
Text = ""
|
||||
Index = 0
|
||||
}
|
||||
{ TabPanel1 TabPanel
|
||||
MoveScaled(4,33,53,23)
|
||||
MoveScaled(4,33,30,23)
|
||||
#Translate = False
|
||||
Background = &HFFFF00&
|
||||
Expand = True
|
||||
Border = False
|
||||
Count = 3
|
||||
Count = 5
|
||||
Closable = True
|
||||
Highlight = True
|
||||
Index = 0
|
||||
Text = "Tab 1"
|
||||
|
@ -30,6 +32,10 @@
|
|||
Text = "Tab 2"
|
||||
Index = 2
|
||||
Text = "Tab 3"
|
||||
Index = 3
|
||||
Text = "Tab 4"
|
||||
Index = 4
|
||||
Text = "Tab 5"
|
||||
Index = 0
|
||||
}
|
||||
{ TabStrip1 TabStrip
|
||||
|
@ -37,11 +43,11 @@
|
|||
Background = &HFF7F7F&
|
||||
Count = 4
|
||||
Index = 0
|
||||
Text = ("TabStrip1")
|
||||
Text = ("&TabStrip1")
|
||||
Index = 1
|
||||
Text = ("")
|
||||
Text = ("&Bonbon")
|
||||
Index = 2
|
||||
Text = ("")
|
||||
Text = ("&Charles")
|
||||
Index = 3
|
||||
Text = ("")
|
||||
Index = 0
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Title=BeastScroll
|
||||
Startup=MMain
|
||||
Icon=logo.png
|
||||
Version=3.5.0
|
||||
Version=3.5.90
|
||||
VersionFile=1
|
||||
Component=gb.image
|
||||
Component=gb.image.io
|
||||
|
|
|
@ -36,7 +36,7 @@ Public Sub Main()
|
|||
.Show()
|
||||
End With
|
||||
|
||||
music.Load("b-title.mod")
|
||||
Music.Load("b-title.mod")
|
||||
|
||||
ciel = image.Load("bgd1_ciel.png")
|
||||
nuage1 = image.Load("sprite_nuages1.png")
|
||||
|
@ -64,13 +64,13 @@ Public Sub Main()
|
|||
scroll5b = Rnd(0, 640)
|
||||
scroll6 = 0
|
||||
|
||||
music.Play(-1, 1)
|
||||
Music.Play(-1, 1)
|
||||
|
||||
End
|
||||
|
||||
Public Sub Screen_Draw()
|
||||
|
||||
Dim hImage As Image
|
||||
'Dim hImage As Image
|
||||
|
||||
'Screen.Clear
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Title=GambasGears
|
||||
Startup=Module1
|
||||
Icon=gears.png
|
||||
Version=3.5.0
|
||||
Version=3.5.90
|
||||
VersionFile=1
|
||||
Component=gb.image
|
||||
Component=gb.image.io
|
||||
|
|
|
@ -98,7 +98,7 @@ SearchString=True
|
|||
[OpenFile]
|
||||
File[1]=".src/FMain.form"
|
||||
Active=2
|
||||
File[2]=".src/FMain.class:17.0"
|
||||
File[2]=".src/FMain.class:77.15"
|
||||
Count=2
|
||||
|
||||
[Watches]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Title=TunnelSDL
|
||||
Startup=MMain
|
||||
Icon=tunnelsdl.png
|
||||
Version=3.5.0
|
||||
Version=3.5.90
|
||||
VersionFile=1
|
||||
Component=gb.image
|
||||
Component=gb.image.io
|
||||
|
|
|
@ -2,7 +2,7 @@ MMain
|
|||
TunnelSDL
|
||||
0
|
||||
0
|
||||
3.5.0
|
||||
3.5.90
|
||||
|
||||
gb.image
|
||||
gb.image.io
|
||||
|
|