[DEVELOPMENT ENVIRONMENT]
* NEW: Component/Library dependencies now are chosen from a new component selection dialog. * BUG: Database editor: Support for requests beginning with "WITH" or "PRAGMA". [WIKI CGI SCRIPT] * NEW: New login panel. * BUG: Fix creatable class detection. [GB.FORM] * BUG: IconPanel: The mouse wheel cannot select hidden tabs anymore. * BUG: Wizard: Remove default padding for wizards having a border. [GB.GUI.BASE] * BUG: Border: Rewrite the painting routine. Simplify the clipping to help workaround Qt4 bugs. [GB.DB.SQLITE] * NEW: Mark the component as deprecated. [GB.DB.SQLITE3] * BUG: Support for PRAGMA requests. Start cleaning up the horrible C++ classes. [GB.QT4] * BUG: Simplify the clipping management, because the old one was based on the QPainterPath::intersected() Qt method that is buggy. Clipping mixed with world transform matrix has still to be checked. git-svn-id: svn://localhost/gambas/trunk@6815 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
e6a92c4fef
commit
6b10bb831d
34 changed files with 1130 additions and 360 deletions
|
@ -222,12 +222,13 @@ DIV.message {
|
|||
.command {
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#lang {
|
||||
float: right;
|
||||
font-size: 80%;
|
||||
margin-right: 4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.up {
|
||||
|
@ -443,15 +444,27 @@ DIV.syntax > P:first-child {
|
|||
}
|
||||
|
||||
.login {
|
||||
position: static;
|
||||
background: white; /*#DFC1A7;*/
|
||||
position: absolute;
|
||||
background: #E8E8E8;
|
||||
color: gray;
|
||||
border: #DF6B00 solid 4px;
|
||||
border-radius: 32px;
|
||||
border-bottom-left-radius: 32px;
|
||||
border-bottom-right-radius: 32px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 0 8px gray;
|
||||
margin-top: -4px;
|
||||
width: 24em;
|
||||
margin: 16px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.login-glue {
|
||||
position: absolute;
|
||||
margin: 0 auto;
|
||||
width: 24em;
|
||||
padding: 1px 22px;
|
||||
background: #E8E8E8;
|
||||
z-index: 10;
|
||||
margin-top: -24px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.label-login {
|
||||
|
@ -465,7 +478,7 @@ DIV.syntax > P:first-child {
|
|||
width: 12em;
|
||||
}
|
||||
|
||||
#ok {
|
||||
#ok,#cancel {
|
||||
margin-top: 8px;
|
||||
width: 8em;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2014-12-16 11:03 UTC\n"
|
||||
"POT-Creation-Date: 2015-01-06 04:23 UTC\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -127,7 +127,7 @@ msgstr "Méthodes"
|
|||
msgid "Events"
|
||||
msgstr "Evénements"
|
||||
|
||||
#: CComponent.class:793
|
||||
#: CComponent.class:811
|
||||
msgid "Classes"
|
||||
msgstr "Classes"
|
||||
|
||||
|
@ -135,7 +135,7 @@ msgstr "Classes"
|
|||
msgid "There are &1 classes and &2 symbols in all Gambas components."
|
||||
msgstr "Il y a &1 classes et &2 symboles dans l'ensemble des composants de Gambas."
|
||||
|
||||
#: Main.module:1025
|
||||
#: Main.module:1027
|
||||
msgid "You must be logged in to view the last changes."
|
||||
msgstr "Vous devez être connecté pour voir la liste des derniers changements."
|
||||
|
||||
|
@ -183,69 +183,73 @@ msgstr "Le page anglaise est plus récente."
|
|||
msgid "Gambas Documentation"
|
||||
msgstr "Documentation de Gambas"
|
||||
|
||||
#: Wiki.webpage:72
|
||||
#: Wiki.webpage:75
|
||||
msgid "Preview"
|
||||
msgstr ""
|
||||
|
||||
#: Wiki.webpage:73
|
||||
#: Wiki.webpage:76
|
||||
msgid "Save"
|
||||
msgstr "Enregistrer"
|
||||
|
||||
#: Wiki.webpage:74
|
||||
#: Wiki.webpage:77
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: Wiki.webpage:86
|
||||
#: Wiki.webpage:89
|
||||
msgid "<"
|
||||
msgstr "-"
|
||||
|
||||
#: Wiki.webpage:91
|
||||
#: Wiki.webpage:94
|
||||
msgid ">"
|
||||
msgstr "-"
|
||||
|
||||
#: Wiki.webpage:95
|
||||
#: Wiki.webpage:98
|
||||
msgid "Exit"
|
||||
msgstr "Sortir"
|
||||
|
||||
#: Wiki.webpage:97
|
||||
#: Wiki.webpage:100
|
||||
msgid "Edit"
|
||||
msgstr "Modifier"
|
||||
|
||||
#: Wiki.webpage:98
|
||||
#: Wiki.webpage:101
|
||||
msgid "Delete"
|
||||
msgstr "Supprimer"
|
||||
|
||||
#: Wiki.webpage:99
|
||||
#: Wiki.webpage:102
|
||||
msgid "Undo"
|
||||
msgstr "Revenir à la version précédente"
|
||||
|
||||
#: Wiki.webpage:101
|
||||
#: Wiki.webpage:104
|
||||
msgid "Historic"
|
||||
msgstr "Historique"
|
||||
|
||||
#: Wiki.webpage:105
|
||||
#: Wiki.webpage:108
|
||||
msgid "Create"
|
||||
msgstr "Créer"
|
||||
|
||||
#: Wiki.webpage:133
|
||||
msgid "Select the image file to upload..."
|
||||
msgstr "Sélectionnez l'image à importer..."
|
||||
|
||||
#: Wiki.webpage:164
|
||||
#: Wiki.webpage:115
|
||||
msgid "Logout"
|
||||
msgstr "Se déconnecter"
|
||||
|
||||
#: Wiki.webpage:166
|
||||
#: Wiki.webpage:117
|
||||
msgid "Login"
|
||||
msgstr "Utilisateur"
|
||||
|
||||
#: Wiki.webpage:168
|
||||
#: Wiki.webpage:118
|
||||
msgid "Register"
|
||||
msgstr "S'enregistrer"
|
||||
|
||||
#: Wiki.webpage:135
|
||||
msgid "Password"
|
||||
msgstr "Mot de passe"
|
||||
|
||||
#: Wiki.webpage:171
|
||||
msgid "Register"
|
||||
msgstr "S'enregistrer"
|
||||
#: Wiki.webpage:137
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
#: Wiki.webpage:166
|
||||
msgid "Select the image file to upload..."
|
||||
msgstr "Sélectionnez l'image à importer..."
|
||||
|
||||
#: WikiMarkdown.class:145
|
||||
msgid "Since"
|
||||
|
|
|
@ -33,8 +33,8 @@ TABLE.desc>TBODY>TR>TH{text-align:left;border:none;padding:6px 12px;}
|
|||
.unknown{color:red;margin-top:8px;}
|
||||
DIV.error{color:red;padding:2px 6px;background:url('<%/%>/error-bg.png');}
|
||||
DIV.message{color:red;font-style:italic;}
|
||||
.command{display:inline-block;margin-left:8px;}
|
||||
#lang{float:right;font-size:80%;margin-right:4px;}
|
||||
.command{display:inline-block;margin-left:8px;margin-top:2px;}
|
||||
#lang{font-size:80%;margin-right:4px;margin-left:4px;}
|
||||
.up{display:inline-block;vertical-align:middle;padding:2px;}
|
||||
.edit-frame{position:absolute;left:0;right:0;top:0;bottom:0;padding:4px;border-top:solid 2px #D8D8D8;}
|
||||
.edit{border:none;background:none;width:100%;height:100%;}
|
||||
|
@ -67,10 +67,11 @@ P:first-child,UL:first-child,OL:first-child,TABLE:first-child{margin-top:0;}
|
|||
H1:first-child{margin-top:0;}
|
||||
DIV.table:first-child{margin-top:0;}
|
||||
DIV.syntax>P:first-child{margin-top:-0.75em;}
|
||||
.login{position:static;background:white;color:gray;border:#DF6B00 solid 4px;border-radius:32px;padding:16px;box-shadow:0 0 8px gray;width:24em;margin:16px;}
|
||||
.login{position:absolute;background:#E8E8E8;color:gray;border-bottom-left-radius:32px;border-bottom-right-radius:32px;padding:16px;box-shadow:0 0 8px gray;margin-top:-4px;width:24em;z-index:-1;}
|
||||
.login-glue{position:absolute;margin:0 auto;width:24em;padding:1px 22px;background:#E8E8E8;z-index:10;margin-top:-24px;margin-left:-6px;}
|
||||
.label-login{display:inline-block;margin-left:0.5em;width:8em;height:1.5em;}
|
||||
#user{width:12em;}
|
||||
#ok{margin-top:8px;width:8em;}
|
||||
#ok,#cancel{margin-top:8px;width:8em;}
|
||||
#register{width:8em;}
|
||||
.hide-if-compact{display:none;}
|
||||
.show-if-compact{display:inherit;}
|
||||
|
|
|
@ -360,7 +360,7 @@ Public Function GetSymbols() As String[]
|
|||
|
||||
sCreatable = ""
|
||||
|
||||
If Creatable And If Not IsVirtual() Then
|
||||
If Creatable And If Not IsVirtual() And If bDynamic Then
|
||||
If Symbols.Exist("_new") Then
|
||||
'GetSymbolLink($hClass.Symbols["_new"], $hClass, ("creatable"))) & sBreak
|
||||
sCreatable = Subst(("This class is &1."), Main.GetSymbolLink(Me, "_new", ("creatable"))) & "\\"
|
||||
|
|
|
@ -456,7 +456,7 @@ Public Sub Main()
|
|||
Response.Redirect(Application.Root &/ "~register")
|
||||
Return
|
||||
|
||||
Else If Request["login"] And If Request["password"] Then
|
||||
Else If Request["login"] And If Request["password"] And If Request["ok"] Then
|
||||
|
||||
Session.Abandon
|
||||
|
||||
|
|
|
@ -25,6 +25,13 @@ H1 { display: none; }
|
|||
|
||||
<form name="form" method="post" enctype="multipart/form-data">
|
||||
|
||||
<%If Not Main.Edit And If Request["ident"] Then%>
|
||||
<%If Not Session.Id Then%>
|
||||
<input type="submit" name="ok" value="<%=("OK")%>" style="position:absolute;width:0px;height:0px;margin:0px;padding:0px;outline:none;border:none;">
|
||||
<%Endif%>
|
||||
<%Endif%>
|
||||
|
||||
|
||||
<%If Request.Exist("v") Then%>
|
||||
|
||||
<%If Not Request.Exist("nh") Then%>
|
||||
|
@ -55,19 +62,22 @@ H1 { display: none; }
|
|||
<%Else%>
|
||||
|
||||
<div class="header">
|
||||
|
||||
<div class="header-inside">
|
||||
|
||||
<div class="header-bar">
|
||||
<div class="up">
|
||||
<%If Main.Edit%>
|
||||
<%If Main.Edit Then%>
|
||||
<img src="<%/%>/edit.png">
|
||||
<%Else%>
|
||||
<a href="<%_PrintParent()%>"><img src="<%/%>/up.png"></a>
|
||||
<%Endif%>
|
||||
</div>
|
||||
<%If Main.Path Then%>
|
||||
<div class="title">
|
||||
<%_PrintLink%>
|
||||
</div>
|
||||
<%Endif%>
|
||||
<%If Main.Edit Then%>
|
||||
<div class="command">
|
||||
<input type="submit" id="preview" name="preview" value="<%=("Preview")%>">
|
||||
|
@ -108,11 +118,41 @@ H1 { display: none; }
|
|||
<%Endif%>
|
||||
</div>
|
||||
<%Endif%>
|
||||
<div style="float:right;">
|
||||
<%If Session.Id Then%>
|
||||
<div class="command"><input type="submit" name="logout" value="<%= ("Logout")%>"></div>
|
||||
<%Else%>
|
||||
<div class="command"><input type="submit" name="ident" value="<%=("Login")%>"></div>
|
||||
<div class="command"><input type="submit" name="register" value="<%=("Register")%>"></div>
|
||||
<%Endif%>
|
||||
<%_PrintLang%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%If Not Main.Edit And If Request["ident"] Then%>
|
||||
<div align="center" style="max-width: 24em;margin: 0 auto;">
|
||||
<!--<div class="login-glue"></div>-->
|
||||
<div class="login"><div>
|
||||
<%If Session.Id Then%>
|
||||
<div id="user" class="label-login" align="left"><%=Main.UserName%></div>
|
||||
<div class="command"><input type="submit" name="logout" value="<%=("Logout")%>"></div>
|
||||
<%Else%>
|
||||
<div class="label-login" align="left"><%=("Login")%> </div>
|
||||
<input type="text" name="login" id="login" maxlength="16">
|
||||
<div class="label-login" align="left"><%=("Password")%> </div>
|
||||
<input type="password" name="password" id="password" maxlength="16">
|
||||
<div class="command"><input type="submit" name="ok" id="ok" value="<%=("OK")%>"></div>
|
||||
<div class="command"><input type="submit" id="cancel" value="<%=("Cancel")%>"></div>
|
||||
<%Endif%>
|
||||
</div></div>
|
||||
</div>
|
||||
<%Endif%>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%If Main.Edit Then%>
|
||||
<div class="page-edit">
|
||||
<%Else%>
|
||||
|
@ -157,24 +197,6 @@ H1 { display: none; }
|
|||
<%Endif%>
|
||||
<%Endif%>
|
||||
|
||||
<%If Not Main.Path And If Not Main.Edit Then%>
|
||||
<div align="center">
|
||||
<div class="login"><div>
|
||||
<%If Session.Id Then%>
|
||||
<div id="user" class="label-login" align="left"><%= Main.UserName%></div>
|
||||
<div class="command"><input type="submit" name="logout" value="<%= ("Logout")%>"></div>
|
||||
<%Else%>
|
||||
<div class="label-login" align="left"><%=("Login")%> </div>
|
||||
<input type="text" name="login" id="login" maxlength="16">
|
||||
<div class="label-login" align="left"><%=("Password")%> </div>
|
||||
<input type="password" name="password" id="password" maxlength="16">
|
||||
<div class="command"><input type="submit" id="ok" value="OK"></div>
|
||||
<div class="command"><input type="submit" id="register" name="register" value="<%= ("Register")%>"></div>
|
||||
<%Endif%>
|
||||
</div></div>
|
||||
</div>
|
||||
<%Endif%>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
|
@ -318,7 +318,7 @@ Catch
|
|||
|
||||
Application.Busy = 0
|
||||
Me.Enabled = False
|
||||
Message.Error(("Unable to connect to database.") & "\n\n" & Error.Text)
|
||||
Message.Error(("Unable to connect to database.") & "\n\n" & Error.Text & "\n\n" & Error.Backtrace.Join("\n"))
|
||||
Return True
|
||||
|
||||
End
|
||||
|
@ -610,6 +610,7 @@ Public Sub btnRunQuery_Click()
|
|||
|
||||
Dim sReq As String = Trim(edtRequest.Text)
|
||||
Dim iPos As Integer
|
||||
Dim sStart As String
|
||||
|
||||
While Left(sReq, 2) = "/*"
|
||||
iPos = InStr(sReq, "*/")
|
||||
|
@ -621,7 +622,10 @@ Public Sub btnRunQuery_Click()
|
|||
|
||||
Inc Application.Busy
|
||||
|
||||
If sReq Like "SELECT *" Then
|
||||
iPos = InStr(sReq, " ")
|
||||
If iPos Then sStart = UCase(Left$(sReq, iPos - 1))
|
||||
|
||||
If ["SELECT", "WITH", "PRAGMA"].Exist(sStart) Then
|
||||
Try datRequest.Table = sReq
|
||||
Else
|
||||
Try $hConn.Exec(sReq)
|
||||
|
|
180
app/src/gambas3/.src/Project/Component/ComponentChooser.class
Normal file
180
app/src/gambas3/.src/Project/Component/ComponentChooser.class
Normal file
|
@ -0,0 +1,180 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
|
||||
Inherits UserControl
|
||||
|
||||
Public Const _Properties As String = "*,Border=True"
|
||||
Public Const _DefaultEvent As String = "Activate"
|
||||
Public Const _DefaultSize As String = "36,36"
|
||||
Public Const _Group As String = "Chooser"
|
||||
|
||||
Event Select
|
||||
Event Activate
|
||||
|
||||
Property Border As Boolean
|
||||
Property Components As String[]
|
||||
Property Current As String
|
||||
|
||||
Static Private $aBorder As Border[]
|
||||
|
||||
Private $hGridView As GridView
|
||||
Private $aComp As New String[]
|
||||
|
||||
Public Sub _new()
|
||||
|
||||
Dim I As Integer
|
||||
|
||||
$hGridView = New GridView(Me) As "GridView"
|
||||
$hGridView.Mode = Select.Single
|
||||
$hGridView.Grid = False
|
||||
|
||||
If Not $aBorder Then
|
||||
|
||||
$aBorder = New Border[6]
|
||||
$aBorder[0] = New Border("right-style:none;padding:6;margin:8 0 0 8;top-left-radius:5;bottom-left-radius:5;width:4;")
|
||||
$aBorder[1] = New Border("style:solid none;padding:6;margin:8 0 0 0;width:4")
|
||||
$aBorder[2] = New Border("left-style:none;padding:6;margin:8 8 0 0;top-right-radius:5;bottom-right-radius:5;width:4")
|
||||
|
||||
For I = 0 To 2
|
||||
$aBorder[I].Color = Color.Gradient(Color.LightForeground, Color.TextBackground)
|
||||
$aBorder[I + 3] = $aBorder[I].Copy()
|
||||
$aBorder[I + 3].BottomMargin = 8
|
||||
Next
|
||||
|
||||
Endif
|
||||
|
||||
$hGridView.Columns.Count = 3
|
||||
$hGridView.Columns[0].Expand = False
|
||||
$hGridView.Columns[1].Expand = True
|
||||
$hGridView.Columns[2].Width = 40
|
||||
$hGridView.Columns[2].Expand = False
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Function Components_Read() As String[]
|
||||
|
||||
Return $aComp
|
||||
|
||||
End
|
||||
|
||||
Private Sub Components_Write(Value As String[])
|
||||
|
||||
If Not Value Then Value = New String[]
|
||||
$aComp = Value
|
||||
|
||||
$hGridView.UnSelectAll
|
||||
$hGridView.Rows.Count = $aComp.Count
|
||||
$hGridView.Columns[0].W = -1
|
||||
GridView_Arrange
|
||||
|
||||
End
|
||||
|
||||
Public Sub GridView_Data(Row As Integer, Column As Integer)
|
||||
|
||||
'Dim hCompItem As ComponentItem = $cComp[$aComp[Row]]
|
||||
Dim hComp As CComponent = CComponent.All[$aComp[Row]]
|
||||
|
||||
With $hGridView.Data
|
||||
|
||||
Select Case Column
|
||||
|
||||
Case 0
|
||||
.Text = hComp.Key
|
||||
.Font.Bold = True
|
||||
If hComp.State = CComponent.UNSTABLE Then
|
||||
.Font.Italic = True
|
||||
Else If hComp.State = CComponent.DEPRECATED Then
|
||||
.Foreground = Color.LightForeground
|
||||
'.Font.Strikeout = True
|
||||
Endif
|
||||
|
||||
Case 1
|
||||
.WordWrap = True
|
||||
.RichText = hComp.Name
|
||||
If hComp.State = CComponent.UNSTABLE Then
|
||||
.Font.Italic = True
|
||||
Else If hComp.State = CComponent.DEPRECATED Then
|
||||
.Foreground = Color.LightForeground
|
||||
'.Font.Strikeout = True
|
||||
Endif
|
||||
|
||||
Case 2
|
||||
Select Case hComp.State
|
||||
Case CComponent.STABLE_NOT_FINISHED
|
||||
.Picture = Picture["img/16/unfinished.png"]
|
||||
Case CComponent.UNSTABLE
|
||||
.Picture = Picture["img/16/experimental.png"]
|
||||
Case CComponent.STABLE
|
||||
.Picture = Picture["img/16/finished.png"]
|
||||
Case CComponent.DEPRECATED
|
||||
.Picture = Picture["img/16/deprecated.png"]
|
||||
End Select
|
||||
|
||||
End Select
|
||||
|
||||
.Alignment = Align.TopNormal
|
||||
'.Background = If(Even(Row), Color.Gradient(Color.LightForeground, Color.TextBackground, 0.9), Color.TextBackground)
|
||||
.Background = Color.Gradient(Color.LightForeground, Color.TextBackground, 0.95)
|
||||
|
||||
If Row = $aComp.Max Then
|
||||
.Border = $aBorder[Column + 3]
|
||||
Else
|
||||
.Border = $aBorder[Column]
|
||||
Endif
|
||||
|
||||
End With
|
||||
|
||||
End
|
||||
|
||||
Private Function Current_Read() As String
|
||||
|
||||
Try Return $aComp[$hGridView.Row]
|
||||
|
||||
End
|
||||
|
||||
Private Sub Current_Write(Value As String)
|
||||
|
||||
$hGridView.Row = $aComp.Find(Value)
|
||||
|
||||
End
|
||||
|
||||
Public Sub GridView_Arrange()
|
||||
|
||||
Dim I As Integer
|
||||
|
||||
$hGridView.Columns[1].Width = -1
|
||||
|
||||
For I = 0 To $aComp.Max
|
||||
$hGridView.Rows[I].H = -1
|
||||
'Debug I;; gvwComponent.Rows[I].H
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Function Border_Read() As Boolean
|
||||
|
||||
Return $hGridView.Border
|
||||
|
||||
End
|
||||
|
||||
Private Sub Border_Write(Value As Boolean)
|
||||
|
||||
$hGridView.Border = Value
|
||||
|
||||
End
|
||||
|
||||
Public Sub GridView_Select()
|
||||
|
||||
Raise Select
|
||||
|
||||
End
|
||||
|
||||
Public Sub GridView_Activate()
|
||||
|
||||
Raise Activate
|
||||
|
||||
End
|
||||
|
156
app/src/gambas3/.src/Project/Component/FSelectComponent.class
Normal file
156
app/src/gambas3/.src/Project/Component/FSelectComponent.class
Normal file
|
@ -0,0 +1,156 @@
|
|||
' Gambas class file
|
||||
|
||||
Static Public Component As String
|
||||
|
||||
Static Private $aRemove As String[]
|
||||
|
||||
Public Sub Run(Optional aRemove As String[]) As Boolean
|
||||
|
||||
$aRemove = aRemove
|
||||
Return Not FSelectComponent.ShowDialog()
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub Form_Open()
|
||||
|
||||
panSearchProject.H = Desktop.Scale * 3.5
|
||||
btnClearFilter.W = panSearchProject.H
|
||||
|
||||
RefreshList
|
||||
|
||||
End
|
||||
|
||||
Private Sub RefreshList()
|
||||
|
||||
Dim aComp As New String[]
|
||||
Dim hComp As CComponent
|
||||
Dim sComp As String
|
||||
Dim sFilter As String
|
||||
|
||||
sFilter = txtFilterComponent.Text
|
||||
|
||||
For Each hComp In CComponent.All
|
||||
sComp = hComp.Key
|
||||
If hComp.Hidden Then Continue
|
||||
If hComp.Key = CComponent.PROJECT_NAME Then Continue
|
||||
If hComp.Key = Project.Name Then Continue
|
||||
If hComp.Key = "gb" Then Continue
|
||||
If $aRemove And If $aRemove.Exist(sComp) Then Continue
|
||||
If hComp.State = CComponent.DEPRECATED And If Not chkShowDeprecated.Value Then Continue
|
||||
If sFilter And If Not hComp.Match(sFilter) Then Continue
|
||||
aComp.Add(sComp)
|
||||
Next
|
||||
|
||||
aComp.Sort
|
||||
|
||||
choComponent.Components = aComp
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub chkShowDeprecated_Click()
|
||||
|
||||
RefreshList
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnOK_Click()
|
||||
|
||||
Component = choComponent.Current
|
||||
If Component Then Me.Close(True)
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnCancel_Click()
|
||||
|
||||
Me.Close
|
||||
|
||||
End
|
||||
|
||||
Public Sub Form_Close()
|
||||
|
||||
$aRemove = Null
|
||||
|
||||
End
|
||||
|
||||
Public Sub panSearchProject_Arrange()
|
||||
|
||||
picFilter.W = picFilter.H
|
||||
|
||||
End
|
||||
|
||||
Public Sub timFilterComponent_Timer()
|
||||
|
||||
RefreshList
|
||||
timFilterComponent.Stop
|
||||
|
||||
End
|
||||
|
||||
Public Sub txtFilterComponent_Change()
|
||||
|
||||
timFilterComponent.Start
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub choComponent_Activate()
|
||||
|
||||
MHelp.InitWebViewWith(webAboutComponent, MHelp.TYPE_COMPONENT, choComponent.Current,, "v&nh&l=" & MHelp.GetLanguage())
|
||||
wizComponent.MoveNext
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnForward_Click()
|
||||
|
||||
webAboutComponent.Forward
|
||||
|
||||
End
|
||||
|
||||
Public Sub webAboutComponent_Click((Frame) As WebFrame)
|
||||
|
||||
btnForward.Enabled = webAboutComponent.History.Index < webAboutComponent.History.Max
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnStop_Click()
|
||||
|
||||
webAboutComponent.Stop
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnReload_Click()
|
||||
|
||||
webAboutComponent.Reload
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnZoomIn_Click()
|
||||
|
||||
webAboutComponent.TextZoom = Round(webAboutComponent.TextZoom * 1.25, -2)
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnZoomOut_Click()
|
||||
|
||||
webAboutComponent.TextZoom = Round(webAboutComponent.TextZoom / 1.25, -2)
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnZoomNormal_Click()
|
||||
|
||||
webAboutComponent.TextZoom = 0.8
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub btnBack_Click()
|
||||
|
||||
If webAboutComponent.History.Index Then
|
||||
webAboutComponent.Back
|
||||
Else
|
||||
webAboutComponent.Stop
|
||||
wizComponent.MovePrevious
|
||||
Endif
|
||||
|
||||
End
|
142
app/src/gambas3/.src/Project/Component/FSelectComponent.form
Normal file
142
app/src/gambas3/.src/Project/Component/FSelectComponent.form
Normal file
|
@ -0,0 +1,142 @@
|
|||
# Gambas Form File 3.0
|
||||
|
||||
{ Form Form
|
||||
MoveScaled(0,0,84,67)
|
||||
Text = ("Select a component")
|
||||
Arrangement = Arrange.Vertical
|
||||
{ wizComponent Wizard
|
||||
MoveScaled(1,1,82,56)
|
||||
Background = Color.TextBackground
|
||||
Expand = True
|
||||
Arrangement = Arrange.Vertical
|
||||
Count = 2
|
||||
ShowTitle = False
|
||||
ShowButton = False
|
||||
Border = False
|
||||
Animated = True
|
||||
Index = 0
|
||||
Text = ("")
|
||||
{ panSearchProject Panel
|
||||
MoveScaled(1,1,65,3)
|
||||
Arrangement = Arrange.Horizontal
|
||||
{ picFilter PictureBox
|
||||
MoveScaled(0,0,3,3)
|
||||
Picture = Picture["img/32/filter.png"]
|
||||
Stretch = True
|
||||
AutoResize = True
|
||||
}
|
||||
{ txtFilterComponent TextBox
|
||||
MoveScaled(5,0,18,3)
|
||||
Foreground = Color.LightForeground
|
||||
Expand = True
|
||||
Border = False
|
||||
}
|
||||
{ btnClearFilter ToolButton
|
||||
MoveScaled(25,0,3,3)
|
||||
ToolTip = ("Reset filter")
|
||||
Picture = Picture["icon:/small/clear"]
|
||||
}
|
||||
}
|
||||
{ timFilterComponent #Timer
|
||||
#MoveScaled(69,4)
|
||||
Delay = 500
|
||||
}
|
||||
{ Separator4 Separator
|
||||
MoveScaled(29,6,21,0)
|
||||
}
|
||||
{ choComponent ComponentChooser
|
||||
MoveScaled(2,11,71,39)
|
||||
Expand = True
|
||||
Border = False
|
||||
}
|
||||
Index = 1
|
||||
Text = ("")
|
||||
{ panHelp VBox
|
||||
MoveScaled(0,0,81,18)
|
||||
Background = Color.TextBackground
|
||||
Expand = True
|
||||
{ Panel8 HBox
|
||||
MoveScaled(1,0,79,4)
|
||||
{ btnBack Button
|
||||
MoveScaled(0,0,4,4)
|
||||
Picture = Picture["icon:/small/previous"]
|
||||
Border = False
|
||||
}
|
||||
{ btnForward Button
|
||||
MoveScaled(4,0,4,4)
|
||||
Picture = Picture["icon:/small/next"]
|
||||
Border = False
|
||||
}
|
||||
{ btnStop ToolButton
|
||||
MoveScaled(8,0,4,4)
|
||||
ToolTip = ("Cancel")
|
||||
Picture = Picture["icon:/small/delete"]
|
||||
}
|
||||
{ btnReload ToolButton
|
||||
MoveScaled(12,0,4,4)
|
||||
ToolTip = ("Reload")
|
||||
Picture = Picture["icon:/small/refresh"]
|
||||
}
|
||||
{ Separator10 Separator
|
||||
MoveScaled(17,0,0,4)
|
||||
Visible = False
|
||||
}
|
||||
{ btnZoomIn ToolButton
|
||||
MoveScaled(18,0,4,4)
|
||||
ToolTip = ("Zoom in")
|
||||
Picture = Picture["icon:/small/zoom-in"]
|
||||
}
|
||||
{ btnZoomOut ToolButton
|
||||
MoveScaled(22,0,4,4)
|
||||
ToolTip = ("Zoom out")
|
||||
Picture = Picture["icon:/small/zoom-out"]
|
||||
}
|
||||
{ btnZoomNormal ToolButton
|
||||
MoveScaled(26,0,4,4)
|
||||
ToolTip = ("No zoom")
|
||||
Picture = Picture["icon:/small/zoom-normal"]
|
||||
}
|
||||
{ Panel3 Panel
|
||||
MoveScaled(51,0,7,4)
|
||||
Expand = True
|
||||
}
|
||||
}
|
||||
{ Separator2 Separator
|
||||
MoveScaled(0,9,24,0)
|
||||
Visible = False
|
||||
}
|
||||
{ webAboutComponent HelpView
|
||||
MoveScaled(4,10,46,7)
|
||||
Expand = True
|
||||
}
|
||||
}
|
||||
Index = 0
|
||||
}
|
||||
{ Separator1 Separator
|
||||
MoveScaled(29,58,21,0)
|
||||
}
|
||||
{ Panel10 HBox
|
||||
MoveScaled(1,60,77,6)
|
||||
Spacing = True
|
||||
Margin = True
|
||||
{ chkShowDeprecated CheckBox
|
||||
MoveScaled(0,0,32,3)
|
||||
AutoResize = True
|
||||
Text = ("Show deprecated components")
|
||||
}
|
||||
{ Panel11 Panel
|
||||
MoveScaled(36,0,1,3)
|
||||
Expand = True
|
||||
}
|
||||
{ btnOK Button
|
||||
MoveScaled(39,0,17,4)
|
||||
Text = ("OK")
|
||||
Default = True
|
||||
}
|
||||
{ btnCancel Button
|
||||
MoveScaled(57,0,18,4)
|
||||
Text = ("Cancel")
|
||||
Cancel = True
|
||||
}
|
||||
}
|
||||
}
|
|
@ -110,11 +110,13 @@ Public Sub Form_Open()
|
|||
' $hBorderLibrary.BottomPadding = Desktop.Scale
|
||||
|
||||
$aBorderComponent = New Border[8]
|
||||
$aBorderComponent[0] = New Border("right-style:none;color:lightforeground;padding:0;margin:8 0 0 8;top-left-radius:4;bottom-left-radius:4")
|
||||
$aBorderComponent[1] = New Border("style:solid none;color:lightforeground;padding:0;margin:8 0 0 0")
|
||||
$aBorderComponent[0] = New Border("right-style:none;padding:6;margin:8 0 0 8;top-left-radius:5;bottom-left-radius:5;width:4;")
|
||||
$aBorderComponent[1] = New Border("style:solid none;padding:6;margin:8 0 0 0;width:4")
|
||||
$aBorderComponent[2] = $aBorderComponent[1]
|
||||
$aBorderComponent[3] = New Border("left-style:none;color:lightforeground;padding:0;margin:8 8 0 0;top-right-radius:4;bottom-right-radius:4")
|
||||
$aBorderComponent[3] = New Border("left-style:none;padding:6;margin:8 8 0 0;top-right-radius:5;bottom-right-radius:5;width:4")
|
||||
|
||||
For I = 0 To 3
|
||||
$aBorderComponent[I].Color = Color.Gradient(Color.LightForeground, Color.TextBackground)
|
||||
$aBorderComponent[I + 4] = $aBorderComponent[I].Copy()
|
||||
$aBorderComponent[I + 4].BottomMargin = 8
|
||||
Next
|
||||
|
@ -123,7 +125,7 @@ Public Sub Form_Open()
|
|||
$hUncheck = Picture["img/16/unchecked.png"]
|
||||
|
||||
gvwComponent.Columns.Count = 4
|
||||
gvwComponent.Columns[0].Width = 32
|
||||
gvwComponent.Columns[0].Width = 40
|
||||
gvwComponent.Columns[0].Expand = False
|
||||
gvwComponent.Columns[1].Expand = False
|
||||
gvwComponent.Columns[2].Expand = True
|
||||
|
@ -1354,11 +1356,11 @@ Public Sub txtFilterComponent_Change()
|
|||
|
||||
End
|
||||
|
||||
Public Sub txtFilterComponent_KeyPress()
|
||||
|
||||
If Key.Code = Key.Esc Then btnClearFilter_Click
|
||||
|
||||
End
|
||||
' Public Sub txtFilterComponent_KeyPress()
|
||||
'
|
||||
' If Key.Code = Key.Esc Then btnClearFilter_Click
|
||||
'
|
||||
' End
|
||||
|
||||
Public Sub btnClearFilter_Click()
|
||||
|
||||
|
@ -1537,8 +1539,6 @@ Private Sub ReadComponent()
|
|||
|
||||
Dim aComp As String[]
|
||||
Dim hComp As CComponent
|
||||
Dim sComp As String
|
||||
Dim hMenu As Menu
|
||||
|
||||
ReadComponentFile
|
||||
|
||||
|
@ -1553,12 +1553,6 @@ Private Sub ReadComponent()
|
|||
Next
|
||||
aComp.Sort
|
||||
|
||||
mnuAdd.Children.Clear
|
||||
For Each sComp In aComp
|
||||
hMenu = New Menu(mnuAdd) As "mnuAddRequire"
|
||||
hMenu.Text = sComp
|
||||
Next
|
||||
|
||||
lstRequire.List = $aRequire
|
||||
|
||||
ReadFeatures(panNeed, $aNeed)
|
||||
|
@ -1609,12 +1603,6 @@ Public Sub chkCompat_Click()
|
|||
|
||||
End
|
||||
|
||||
Public Sub mnuAddRequire_Click()
|
||||
|
||||
AddRequire(Last.Text)
|
||||
|
||||
End
|
||||
|
||||
Private Sub UpdateInfo()
|
||||
|
||||
If $bInitInfo Then Return
|
||||
|
@ -1671,3 +1659,10 @@ Public Sub btnZoomNormal_Click()
|
|||
webAboutComponent.TextZoom = 0.8
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnAdd_Click()
|
||||
|
||||
If FSelectComponent.Run($aRequire) Then Return
|
||||
AddRequire(FSelectComponent.Component)
|
||||
|
||||
End
|
||||
|
|
|
@ -73,8 +73,6 @@
|
|||
Tag = "LIBOVERLAY_SCROLLBAR=0"
|
||||
}
|
||||
}
|
||||
{ mnuAdd Menu
|
||||
}
|
||||
{ ipnProject IconPanel
|
||||
MoveScaled(0,0,108,70)
|
||||
Expand = True
|
||||
|
@ -312,12 +310,10 @@
|
|||
{ VBox5 VBox
|
||||
MoveScaled(38,1,21,17)
|
||||
Spacing = True
|
||||
{ btnAdd MenuButton
|
||||
{ btnAdd Button
|
||||
MoveScaled(0,0,16,4)
|
||||
Text = ("Add")
|
||||
Text = ("Add") & "..."
|
||||
Picture = Picture["icon:/small/add"]
|
||||
Menu = "mnuAdd"
|
||||
MenuOnly = True
|
||||
}
|
||||
{ btnRemove Button
|
||||
MoveScaled(0,5,17,4)
|
||||
|
@ -387,7 +383,7 @@
|
|||
Border = False
|
||||
Mode = Select.Single
|
||||
Grid = False
|
||||
Padding = 6
|
||||
Padding = 0
|
||||
}
|
||||
{ btnUndo Button
|
||||
MoveScaled(58,7,17,4)
|
||||
|
|
|
@ -17,8 +17,6 @@ End
|
|||
Public Sub Form_Open()
|
||||
|
||||
Dim aGroup As New CSoftwareGroup[]
|
||||
Dim aInit As String[]
|
||||
Dim I As Integer
|
||||
Dim hButton As ToolButton
|
||||
Dim hGroup As CSoftwareGroup
|
||||
Dim sIcon As String
|
||||
|
@ -593,6 +591,12 @@ End
|
|||
|
||||
Public Sub chkShowFilter_Click()
|
||||
|
||||
Dim hPanel As VBox
|
||||
|
||||
panFilter.Visible = chkShowFilter.Value
|
||||
|
||||
hPanel = panFilter.Parent
|
||||
HPanel.AutoResize = True
|
||||
HPanel.AutoResize = False
|
||||
|
||||
End
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Gambas Form File 3.0
|
||||
|
||||
{ Form Form
|
||||
MoveScaled(0,0,108,91)
|
||||
MoveScaled(0,0,100,82)
|
||||
Background = Color.TextBackground
|
||||
Text = ("Gambas Software Farm")
|
||||
Arrangement = Arrange.Vertical
|
||||
|
@ -14,7 +14,7 @@
|
|||
Delay = 500
|
||||
}
|
||||
{ VBox1 HBox
|
||||
MoveScaled(0,10,102,6)
|
||||
MoveScaled(0,10,98,6)
|
||||
Background = &HDF6B00&
|
||||
Foreground = &HFFFFFF&
|
||||
Spacing = True
|
||||
|
@ -25,15 +25,19 @@
|
|||
Picture = Picture["icon:/medium/left"]
|
||||
}
|
||||
{ Panel12 Panel
|
||||
MoveScaled(8,0,93,6)
|
||||
MoveScaled(8,0,89,6)
|
||||
Expand = True
|
||||
Arrangement = Arrange.Horizontal
|
||||
Spacing = True
|
||||
Margin = True
|
||||
{ Label2 Label
|
||||
MoveScaled(0,0,11,4)
|
||||
MoveScaled(0,0,8,4)
|
||||
AutoResize = True
|
||||
Text = ("Farm")
|
||||
}
|
||||
{ Panel14 Panel
|
||||
MoveScaled(11,0,1,4)
|
||||
}
|
||||
{ cmbFarm ComboBox
|
||||
MoveScaled(15,0,29,4)
|
||||
ReadOnly = True
|
||||
|
@ -63,14 +67,14 @@
|
|||
}
|
||||
}
|
||||
{ btnLogin Button
|
||||
MoveScaled(77,0,15,4)
|
||||
MoveScaled(73,0,15,4)
|
||||
AutoResize = True
|
||||
Text = ("Configure") & "..."
|
||||
}
|
||||
}
|
||||
}
|
||||
{ wizFarm Wizard
|
||||
MoveScaled(1,17,106,73)
|
||||
MoveScaled(1,17,96,64)
|
||||
Expand = True
|
||||
Arrangement = Arrange.Vertical
|
||||
Count = 3
|
||||
|
@ -89,12 +93,12 @@
|
|||
Index = 1
|
||||
Text = ("")
|
||||
{ Panel1 VBox
|
||||
MoveScaled(0,1,97,17)
|
||||
MoveScaled(0,1,92,17)
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
Margin = True
|
||||
{ HBox1 HBox
|
||||
MoveScaled(2,1,93,4)
|
||||
MoveScaled(2,1,86,4)
|
||||
Spacing = True
|
||||
{ Label1 Label
|
||||
MoveScaled(0,0,11,4)
|
||||
|
@ -110,11 +114,24 @@
|
|||
Text = ("Show filters")
|
||||
}
|
||||
}
|
||||
{ panFilter Panel
|
||||
MoveScaled(2,6,94,10)
|
||||
{ panFilter VBox
|
||||
MoveScaled(2,6,89,10)
|
||||
Visible = False
|
||||
Spacing = True
|
||||
{ Panel4 HPanel
|
||||
MoveScaled(0,0,88,5)
|
||||
Spacing = True
|
||||
{ Label3 Label
|
||||
MoveScaled(0,0,11,4)
|
||||
Text = ("Tags")
|
||||
}
|
||||
{ tagFarm CTagEditor
|
||||
MoveScaled(15,0,72,5)
|
||||
Expand = True
|
||||
}
|
||||
}
|
||||
{ Panel5 HPanel
|
||||
MoveScaled(0,6,94,4)
|
||||
MoveScaled(0,6,89,4)
|
||||
Spacing = True
|
||||
{ Label4 Label
|
||||
MoveScaled(0,0,11,4)
|
||||
|
@ -133,25 +150,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
{ Panel4 HPanel
|
||||
MoveScaled(0,0,94,5)
|
||||
Spacing = True
|
||||
{ Label3 Label
|
||||
MoveScaled(0,0,11,4)
|
||||
Text = ("Tags")
|
||||
}
|
||||
{ tagFarm CTagEditor
|
||||
MoveScaled(15,0,78,5)
|
||||
Expand = True
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{ Separator3 Separator
|
||||
MoveScaled(20,22,21,0)
|
||||
}
|
||||
{ Panel7 Panel
|
||||
MoveScaled(1,28,98,38)
|
||||
MoveScaled(1,24,91,38)
|
||||
Background = Color.TextBackground
|
||||
Foreground = Color.TextForeground
|
||||
Expand = True
|
||||
|
@ -168,7 +173,7 @@
|
|||
ScrollBar = Scroll.Vertical
|
||||
}
|
||||
{ spnFarm Spinner
|
||||
MoveScaled(85,26,10,9)
|
||||
MoveScaled(77,27,10,9)
|
||||
Visible = False
|
||||
Ignore = True
|
||||
}
|
||||
|
@ -176,7 +181,7 @@
|
|||
Index = 2
|
||||
Text = ("")
|
||||
{ Panel9 Panel
|
||||
MoveScaled(5,0,77,56)
|
||||
MoveScaled(5,0,77,53)
|
||||
Background = Color.TextBackground
|
||||
Foreground = Color.TextForeground
|
||||
Expand = True
|
||||
|
@ -264,7 +269,7 @@
|
|||
}
|
||||
}
|
||||
{ HBox2 HBox
|
||||
MoveScaled(2,58,86,7)
|
||||
MoveScaled(2,54,86,7)
|
||||
Background = &HFFFFFF&
|
||||
Spacing = True
|
||||
Margin = True
|
||||
|
|
|
@ -31,17 +31,22 @@ Private $aCol As String[]
|
|||
|
||||
Public Sub _new(hConn As DataConnection, Table As String, Filter As String)
|
||||
|
||||
Dim iPos As Integer
|
||||
Dim sStart As String
|
||||
|
||||
$hConn = hConn
|
||||
$DB = hConn.Connection
|
||||
$sTable = Trim(Table)
|
||||
$sFilter = Filter
|
||||
|
||||
If $sTable Like "SELECT *" Then
|
||||
$bRequest = True
|
||||
Else
|
||||
$hConn.CheckTable(Table)
|
||||
iPos = InStr($sTable, " ")
|
||||
If iPos Then
|
||||
sStart = UCase(Left($sTable, iPos - 1))
|
||||
$bRequest = ["SELECT", "WITH", "PRAGMA"].Exist(sStart)
|
||||
Endif
|
||||
|
||||
If Not $bRequest Then $hConn.CheckTable(Table)
|
||||
|
||||
RefreshKey
|
||||
|
||||
End
|
||||
|
|
|
@ -291,13 +291,26 @@ Public Sub View_Select()
|
|||
|
||||
End
|
||||
|
||||
Private Sub GotoIndex(iInc As Integer)
|
||||
|
||||
Dim iIndex As Integer
|
||||
|
||||
iIndex = $iCurrent
|
||||
Do
|
||||
iIndex += iInc
|
||||
If iIndex < 0 Or If iIndex > $aCont.Max Then Break
|
||||
If $aCont[iIndex].Visible Then
|
||||
Index_Write(iIndex)
|
||||
Break
|
||||
Endif
|
||||
Loop
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub View_MouseWheel()
|
||||
|
||||
If Mouse.Delta < 0 And If $iCurrent < $aCont.Max Then
|
||||
Index_Write($iCurrent + 1)
|
||||
Else If Mouse.Delta > 0 And If $iCurrent > 0 Then
|
||||
Index_Write($iCurrent - 1)
|
||||
Endif
|
||||
GotoIndex(- Sgn(Mouse.Delta))
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ End
|
|||
Public Sub SetBorder(bOn As Boolean)
|
||||
|
||||
panWizard.Border = If(bOn, Border.Plain, Border.None)
|
||||
panWizard.Padding = If(bOn, 2, 0)
|
||||
'panWizard.Padding = If(bOn, 2, 0)
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
MoveScaled(1,8,61,30)
|
||||
Expand = True
|
||||
Arrangement = Arrange.Fill
|
||||
Padding = 2
|
||||
Border = Border.Plain
|
||||
}
|
||||
{ panButton HBox
|
||||
|
|
|
@ -82,11 +82,11 @@ i
|
|||
16
|
||||
Width
|
||||
p
|
||||
f
|
||||
g
|
||||
|
||||
Radius
|
||||
p
|
||||
f
|
||||
g
|
||||
|
||||
Style
|
||||
p
|
||||
|
@ -98,11 +98,11 @@ i
|
|||
|
||||
Padding
|
||||
p
|
||||
f
|
||||
g
|
||||
|
||||
Margin
|
||||
p
|
||||
f
|
||||
g
|
||||
|
||||
LeftStyle
|
||||
v
|
||||
|
@ -227,11 +227,11 @@ g
|
|||
Paint
|
||||
m
|
||||
|
||||
(X)f(Y)f(Width)f(Height)f
|
||||
(X)g(Y)g(Width)g(Height)g
|
||||
Clip
|
||||
m
|
||||
b
|
||||
(X)f(Y)f(Width)f(Height)f
|
||||
(X)g(Y)g(Width)g(Height)g
|
||||
_new
|
||||
m
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ Version=3.6.90
|
|||
VersionFile=1
|
||||
Component=gb.image
|
||||
Component=gb.gui
|
||||
Environment="GB_GUI=gb.gtk\nLIBOVERLAY_SCROLLBAR=0"
|
||||
Environment="GB_GUI=gb.qt4\nLIBOVERLAY_SCROLLBAR=0"
|
||||
TabSize=2
|
||||
Type=Component
|
||||
Packager=1
|
||||
|
|
|
@ -4,12 +4,12 @@ Export
|
|||
|
||||
Public Enum Solid = 1, Dotted = 2, Dashed = 3, Double = 16
|
||||
|
||||
Property Width As Float
|
||||
Property Radius As Float
|
||||
Property Width As Single
|
||||
Property Radius As Single
|
||||
Property Style As Integer
|
||||
Property Color As Integer
|
||||
Property Padding As Float
|
||||
Property Margin As Float
|
||||
Property Padding As Single
|
||||
Property Margin As Single
|
||||
|
||||
Public LeftStyle As Byte = Solid
|
||||
Public RightStyle As Byte = Solid
|
||||
|
@ -50,15 +50,15 @@ Public BackslashWidth As Single
|
|||
|
||||
Static Private $aProp As String[] = ["width", "color", "radius", "style", "padding", "margin", "slash"]
|
||||
|
||||
Private Const CURVE_MUL As Float = 0.44771525
|
||||
Private Const CURVE_MUL As Single = 0.44771525
|
||||
|
||||
Private Function Width_Read() As Float
|
||||
Private Function Width_Read() As Single
|
||||
|
||||
Return LeftWidth
|
||||
|
||||
End
|
||||
|
||||
Private Sub Width_Write(Value As Float)
|
||||
Private Sub Width_Write(Value As Single)
|
||||
|
||||
LeftWidth = Value
|
||||
RightWidth = Value
|
||||
|
@ -67,13 +67,13 @@ Private Sub Width_Write(Value As Float)
|
|||
|
||||
End
|
||||
|
||||
Private Function Radius_Read() As Float
|
||||
Private Function Radius_Read() As Single
|
||||
|
||||
Return TopLeftRadius
|
||||
|
||||
End
|
||||
|
||||
Private Sub Radius_Write(Value As Float)
|
||||
Private Sub Radius_Write(Value As Single)
|
||||
|
||||
TopLeftRadius = Value
|
||||
TopRightRadius = Value
|
||||
|
@ -112,23 +112,26 @@ Private Sub Color_Write(Value As Integer)
|
|||
|
||||
End
|
||||
|
||||
Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
||||
Private $iHue As Integer
|
||||
|
||||
Public Sub Paint(X As Single, Y As Single, Width As Single, Height As Single)
|
||||
|
||||
Dim fWidth As Float
|
||||
Dim fWidth As Single
|
||||
Dim iStyle As Integer
|
||||
Dim iColor As Integer
|
||||
Dim F As Float
|
||||
Dim F2 As Float
|
||||
Dim F As Single
|
||||
Dim F2 As Single
|
||||
Dim bTop As Boolean
|
||||
Dim bRight As Boolean
|
||||
Dim bLeft As Boolean
|
||||
Dim bBottom As Boolean
|
||||
Dim bSlash As Boolean
|
||||
Dim bBackslash As Boolean
|
||||
Dim X1 As Float
|
||||
Dim Y1 As Float
|
||||
Dim X2 As Float
|
||||
Dim Y2 As Float
|
||||
Dim X1 As Single
|
||||
Dim Y1 As Single
|
||||
Dim X2 As Single
|
||||
Dim Y2 As Single
|
||||
Dim iClip As Integer
|
||||
|
||||
X += LeftMargin
|
||||
Y += TopMargin
|
||||
|
@ -167,21 +170,44 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
|
||||
Paint.Save
|
||||
|
||||
If bLeft And If TopLeftRadius > TopWidth Then
|
||||
Paint.MoveTo(X + Width / 2, Y + Width / 2)
|
||||
Paint.LineTo(X, Y)
|
||||
Paint.LineTo(X + Width / 2, Y)
|
||||
Else
|
||||
Paint.Rectangle(X, Y, Width / 2, TopWidth)
|
||||
Endif
|
||||
iClip = 0
|
||||
If bLeft And If TopLeftRadius > TopWidth Then iClip += 1
|
||||
If bRight And If TopRightRadius > TopWidth Then iClip += 2
|
||||
|
||||
If bRight And If TopRightRadius > TopWidth Then
|
||||
Paint.MoveTo(X + Width / 2, Y + Width / 2)
|
||||
Paint.LineTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width / 2, Y)
|
||||
Else
|
||||
Paint.Rectangle(X + Width / 2, Y, Width / 2, TopWidth)
|
||||
Endif
|
||||
Select Case iClip
|
||||
|
||||
Case 0
|
||||
Paint.Rectangle(X, Y, Width, TopWidth)
|
||||
|
||||
Case 1
|
||||
Paint.MoveTo(X, Y)
|
||||
'Print "MoveTo:";; X;; Y
|
||||
Paint.LineTo(X + Width / 2, Y + Width / 2)
|
||||
'Print "LineTo:";; X + Width / 2;; Y + Width / 2
|
||||
Paint.LineTo(X + Width / 2, Y + TopWidth)
|
||||
'Print "LineTo:";; X + Width / 2;; Y + TopWidth
|
||||
Paint.LineTo(X + Width, Y + TopWidth)
|
||||
'Print "LineTo:";; X + Width;; Y + TopWidth
|
||||
Paint.LineTo(X + Width, Y)
|
||||
'Print "LineTo:";; X + Width;; Y
|
||||
Paint.LineTo(X, Y)
|
||||
'Print "LineTo:";; X;; Y
|
||||
|
||||
Case 2
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.LineTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width / 2, Y + Width / 2)
|
||||
Paint.LineTo(X + Width / 2, Y + TopWidth)
|
||||
Paint.LineTo(X, Y + TopWidth)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 3
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.LineTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width / 2, Y + Width / 2)
|
||||
Paint.ClosePath
|
||||
|
||||
End Select
|
||||
|
||||
Paint.Clip
|
||||
|
||||
|
@ -204,21 +230,56 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
|
||||
Paint.Save
|
||||
|
||||
If bTop And If TopRightRadius > RightWidth Then
|
||||
Paint.MoveTo(X + Width - Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width, Y + Height / 2)
|
||||
Else
|
||||
Paint.Rectangle(X + Width - RightWidth, Y, RightWidth, Height / 2)
|
||||
Endif
|
||||
iClip = 0
|
||||
If bTop And If TopRightRadius > RightWidth Then iClip += 1
|
||||
If bBottom And If BottomRightRadius > RightWidth Then iClip += 2
|
||||
|
||||
If bBottom And If BottomRightRadius > RightWidth Then
|
||||
Paint.MoveTo(X + Width - Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.LineTo(X + Width, Y + Height / 2)
|
||||
Else
|
||||
Paint.Rectangle(X + Width - RightWidth, Y + Height / 2, RightWidth, Height / 2)
|
||||
Endif
|
||||
Select Case iClip
|
||||
|
||||
Case 0
|
||||
Paint.Rectangle(X + Width - RightWidth, Y, RightWidth, Height)
|
||||
|
||||
Case 1
|
||||
Paint.MoveTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width - Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + Width - RightWidth, Y + Height / 2)
|
||||
Paint.LineTo(X + Width - RightWidth, Y + Height)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 2
|
||||
Paint.MoveTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.LineTo(X + Width - Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + Width - RightWidth, Y + Height / 2)
|
||||
Paint.LineTo(X + Width - RightWidth, Y)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 3
|
||||
Paint.MoveTo(X + Width, Y)
|
||||
Paint.LineTo(X + Width - Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
End Select
|
||||
|
||||
' If bTop And If TopRightRadius > RightWidth Then
|
||||
' Paint.MoveTo(X + Width - Height / 2, Y + Height / 2)
|
||||
' Paint.LineTo(X + Width, Y)
|
||||
' Paint.LineTo(X + Width, Y + Height / 2)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X + Width - RightWidth, Y, RightWidth, Height / 2)
|
||||
' Endif
|
||||
'
|
||||
' If bBottom And If BottomRightRadius > RightWidth Then
|
||||
' Paint.MoveTo(X + Width - Height / 2, Y + Height / 2)
|
||||
' Paint.LineTo(X + Width, Y + Height)
|
||||
' Paint.LineTo(X + Width, Y + Height / 2)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X + Width - RightWidth, Y + Height / 2, RightWidth, Height / 2)
|
||||
' Endif
|
||||
|
||||
Paint.Clip
|
||||
|
||||
|
@ -241,21 +302,56 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
|
||||
Paint.Save
|
||||
|
||||
If bLeft And If BottomLeftRadius > BottomWidth Then
|
||||
Paint.MoveTo(X + Width / 2, Y + Height - Width / 2)
|
||||
Paint.LineTo(X + Width / 2, Y + Height)
|
||||
Paint.LineTo(X, Y + Height)
|
||||
Else
|
||||
Paint.Rectangle(X, Y + Height - BottomWidth, Width / 2, BottomWidth)
|
||||
Endif
|
||||
iClip = 0
|
||||
If bLeft And If BottomLeftRadius > BottomWidth Then Inc iClip
|
||||
If bRight And If BottomRightRadius > BottomWidth Then iClip += 2
|
||||
|
||||
If bRight And If BottomRightRadius > BottomWidth Then
|
||||
Paint.MoveTo(X + Width / 2, Y + Height - Width / 2)
|
||||
Paint.LineTo(X + Width / 2, Y + Height)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Else
|
||||
Paint.Rectangle(X + Width / 2, Y + Height - BottomWidth, Width / 2, BottomWidth)
|
||||
Endif
|
||||
Select Case iClip
|
||||
|
||||
Case 0
|
||||
Paint.Rectangle(X, Y + Height - BottomWidth, Width, BottomWidth)
|
||||
|
||||
Case 1
|
||||
Paint.MoveTo(X, Y + Height)
|
||||
Paint.LineTo(X + Width / 2, Y + Height - Width / 2)
|
||||
Paint.LineTo(X + Width / 2, Y + Height - BottomWidth)
|
||||
Paint.LineTo(X + Width, Y + Height - BottomWidth)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 2
|
||||
Paint.MoveTo(X, Y + Height)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.LineTo(X + Width / 2, Y + Height - Width / 2)
|
||||
Paint.LineTo(X + Width / 2, Y + Height - BottomWidth)
|
||||
Paint.LineTo(X, Y + Height - BottomWidth)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 3
|
||||
Paint.MoveTo(X, Y + Height)
|
||||
Paint.LineTo(X + Width / 2, Y + Height - Width / 2)
|
||||
Paint.LineTo(X + Width, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
End Select
|
||||
|
||||
' If bLeft And If BottomLeftRadius > BottomWidth Then
|
||||
' Paint.MoveTo(X + Width / 2, Y + Height - Width / 2)
|
||||
' Paint.LineTo(X + Width / 2, Y + Height)
|
||||
' Paint.LineTo(X, Y + Height)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X, Y + Height - BottomWidth, Width / 2, BottomWidth)
|
||||
' Endif
|
||||
'
|
||||
' If bRight And If BottomRightRadius > BottomWidth Then
|
||||
' Paint.MoveTo(X + Width / 2, Y + Height - Width / 2)
|
||||
' Paint.LineTo(X + Width / 2, Y + Height)
|
||||
' Paint.LineTo(X + Width, Y + Height)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X + Width / 2, Y + Height - BottomWidth, Width / 2, BottomWidth)
|
||||
' Endif
|
||||
|
||||
Paint.Clip
|
||||
|
||||
|
@ -278,21 +374,56 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
|
||||
Paint.Save
|
||||
|
||||
If bTop And If TopLeftRadius > LeftWidth Then
|
||||
Paint.MoveTo(X + Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X, Y)
|
||||
Paint.LineTo(X, Y + Height / 2)
|
||||
Else
|
||||
Paint.Rectangle(X, Y, LeftWidth, Height / 2)
|
||||
Endif
|
||||
iClip = 0
|
||||
If bTop And If TopLeftRadius > LeftWidth Then Inc iClip
|
||||
If bBottom And If BottomLeftRadius > LeftWidth Then iClip += 2
|
||||
|
||||
If bBottom And If BottomLeftRadius > LeftWidth Then
|
||||
Paint.MoveTo(X + Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X, Y + Height)
|
||||
Paint.LineTo(X, Y + Height / 2)
|
||||
Else
|
||||
Paint.Rectangle(X, Y + Height / 2, LeftWidth, Height / 2)
|
||||
Endif
|
||||
Select Case iClip
|
||||
|
||||
Case 0
|
||||
Paint.Rectangle(X, Y, LeftWidth, Height)
|
||||
|
||||
Case 1
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.LineTo(X + Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X + LeftWidth, Y + Height / 2)
|
||||
Paint.LineTo(X + LeftWidth, Y + Height)
|
||||
Paint.LineTo(X, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 2
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.LineTo(X, Y + Height)
|
||||
Paint.LineTo(X + LeftWidth, Y + Height)
|
||||
Paint.LineTo(X + LeftWidth, Y + Height / 2)
|
||||
Paint.LineTo(X + Height / 2, Y + Height / 2)
|
||||
Paint.ClosePath
|
||||
|
||||
Case 3
|
||||
Paint.MoveTo(X, Y)
|
||||
Paint.LineTo(X + Height / 2, Y + Height / 2)
|
||||
Paint.LineTo(X, Y + Height)
|
||||
Paint.ClosePath
|
||||
|
||||
End Select
|
||||
|
||||
' If bTop And If TopLeftRadius > LeftWidth Then
|
||||
' Paint.MoveTo(X + Height / 2, Y + Height / 2)
|
||||
' Paint.LineTo(X, Y)
|
||||
' Paint.LineTo(X, Y + Height / 2)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X, Y, LeftWidth, Height / 2)
|
||||
' Endif
|
||||
'
|
||||
' If bBottom And If BottomLeftRadius > LeftWidth Then
|
||||
' Paint.MoveTo(X + Height / 2, Y + Height / 2)
|
||||
' Paint.LineTo(X, Y + Height)
|
||||
' Paint.LineTo(X, Y + Height / 2)
|
||||
' Paint.ClosePath
|
||||
' Else
|
||||
' Paint.Rectangle(X, Y + Height / 2, LeftWidth, Height / 2)
|
||||
' Endif
|
||||
|
||||
Paint.Clip
|
||||
|
||||
|
@ -316,7 +447,6 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
Paint.Save
|
||||
|
||||
PaintRoundRectangle(X, Y, Width, Height, TopLeftRadius, TopRightRadius, BottomLeftRadius, BottomRightRadius, True)
|
||||
Paint.Clip
|
||||
|
||||
If bSlash Then
|
||||
|
||||
|
@ -353,13 +483,12 @@ Public Sub Paint(X As Float, Y As Float, Width As Float, Height As Float)
|
|||
Endif
|
||||
|
||||
Paint.Restore
|
||||
$iHue = 0
|
||||
Return
|
||||
|
||||
CLIP_BORDER:
|
||||
|
||||
PaintRoundRectangle(X, Y, Width, Height, TopLeftRadius, TopRightRadius, BottomLeftRadius, BottomRightRadius, True)
|
||||
Paint.Clip
|
||||
|
||||
Return
|
||||
|
||||
INIT_STYLE:
|
||||
|
@ -418,12 +547,12 @@ DRAW_LINE:
|
|||
|
||||
If iStyle And Double Then
|
||||
|
||||
Paint.MoveTo(X1 - F, Y1)
|
||||
Paint.LineTo(X2 - F, Y2)
|
||||
Paint.MoveTo(X1 - F - F2, Y1)
|
||||
Paint.LineTo(X2 - F - F2, Y2)
|
||||
Paint.Stroke
|
||||
|
||||
Paint.MoveTo(X1 + F, Y1)
|
||||
Paint.LineTo(X2 + F, Y2)
|
||||
Paint.MoveTo(X1, Y1 - F - F2)
|
||||
Paint.LineTo(X2, Y2 - F - F2)
|
||||
Paint.Stroke
|
||||
|
||||
Else
|
||||
|
@ -438,7 +567,7 @@ DRAW_LINE:
|
|||
|
||||
End
|
||||
|
||||
Public Sub Clip(X As Float, Y As Float, Width As Float, Height As Float) As Boolean
|
||||
Public Sub Clip(X As Single, Y As Single, Width As Single, Height As Single) As Boolean
|
||||
|
||||
X += LeftMargin '+ LeftWidth
|
||||
Y += TopMargin '+ TopWidth
|
||||
|
@ -446,20 +575,30 @@ Public Sub Clip(X As Float, Y As Float, Width As Float, Height As Float) As Bool
|
|||
Height -= TopMargin + BottomMargin '+ TopWidth + BottomWidth
|
||||
If Width <= 0 Or If Height <= 0 Then Return True
|
||||
|
||||
'Paint.Debug = True
|
||||
PaintRoundRectangle(X, Y, Width, Height, TopLeftRadius, TopRightRadius, BottomLeftRadius, BottomRightRadius, True)
|
||||
Paint.Clip
|
||||
'Paint.Debug = False
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Sub PaintRoundRectangle(X As Float, Y As Float, W As Float, H As Float, TL As Float, TR As Float, BL As Float, BR As Float, Optional bClip As Boolean)
|
||||
Private Sub PaintRoundRectangle(X As Single, Y As Single, W As Single, H As Single, TL As Single, TR As Single, BL As Single, BR As Single, Optional bClip As Boolean)
|
||||
|
||||
If W <= 0 Or If H <= 0 Then Return
|
||||
'Paint.Debug = True
|
||||
|
||||
TL = Min(TL, Min(W, H) / 2)
|
||||
TR = Min(TR, Min(W, H) / 2)
|
||||
BL = Min(BL, Min(W, H) / 2)
|
||||
BR = Min(BR, Min(W, H) / 2)
|
||||
If W <= 0 Or If H <= 0 Then
|
||||
If bClip Then
|
||||
Paint.Rectangle(X, Y, 0, 0)
|
||||
Paint.Clip
|
||||
Endif
|
||||
'Paint.Debug = False
|
||||
Return
|
||||
Endif
|
||||
|
||||
TL = Max(0, Min(TL, Min(W, H) / 2))
|
||||
TR = Max(0, Min(TR, Min(W, H) / 2))
|
||||
BL = Max(0, Min(BL, Min(W, H) / 2))
|
||||
BR = Max(0, Min(BR, Min(W, H) / 2))
|
||||
|
||||
If TL <= 0 And If TR <= 0 And If BL <= 0 And If BR <= 0 Then
|
||||
If bClip Then
|
||||
|
@ -474,28 +613,43 @@ Private Sub PaintRoundRectangle(X As Float, Y As Float, W As Float, H As Float,
|
|||
Paint.MoveTo(X, Y + H)
|
||||
Paint.LineTo(X + W, Y + H)
|
||||
Endif
|
||||
Return
|
||||
Else
|
||||
' PAINT->MoveTo(THIS, x + r, y);
|
||||
' PAINT->LineTo(THIS, x + w - r, y);
|
||||
' PAINT->CurveTo(THIS, x + w - r2, y, x + w, y + r2, x + w, y + r);
|
||||
' PAINT->LineTo(THIS, x + w, y + h - r);
|
||||
' PAINT->CurveTo(THIS, x + w, y + h - r2, x + w - r2, y + h, x + w - r, y + h);
|
||||
' PAINT->LineTo(THIS, x + r, y + h);
|
||||
' PAINT->CurveTo(THIS, x + r2, y + h, x, y + h - r2, x, y + h - r);
|
||||
' PAINT->LineTo(THIS, x, y + r);
|
||||
' PAINT->CurveTo(THIS, x, y + r2, x + r2, y, x + r, y);
|
||||
'
|
||||
|
||||
Paint.MoveTo(X + TL, Y)
|
||||
Paint.LineTo(X + W - TR, Y)
|
||||
If TR > 0 Then Paint.CurveTo(X + W - TR * CURVE_MUL, Y, X + W, Y + TR * CURVE_MUL, X + W, Y + TR)
|
||||
Paint.LineTo(X + W, Y + H - BR)
|
||||
If BR > 0 Then Paint.CurveTo(X + W, Y + H - BR * CURVE_MUL, X + W - BR * CURVE_MUL, Y + H, X + W - BR, Y + H)
|
||||
Paint.LineTo(X + BL, Y + H)
|
||||
If BL > 0 Then Paint.CurveTo(X + BL * CURVE_MUL, Y + H, X, Y + H - BL * CURVE_MUL, X, Y + H - BL)
|
||||
Paint.LineTo(X, Y + TL)
|
||||
If TL > 0 Then Paint.CurveTo(X, Y + TL * CURVE_MUL, X + TL * CURVE_MUL, Y, X + TL, Y)
|
||||
Paint.LineTo(X + TL, Y)
|
||||
Endif
|
||||
|
||||
If bClip Then Paint.Clip
|
||||
|
||||
Paint.MoveTo(X + TL, Y)
|
||||
Paint.LineTo(X + W - TR, Y)
|
||||
Paint.CurveTo(X + W - TR * CURVE_MUL, Y, X + W, Y + TR * CURVE_MUL, X + W, Y + TR)
|
||||
Paint.LineTo(X + W, Y + H - BR)
|
||||
Paint.CurveTo(X + W, Y + H - BR * CURVE_MUL, X + W - BR * CURVE_MUL, Y + H, X + W - BR, Y + H)
|
||||
Paint.LineTo(X + BL, Y + H)
|
||||
Paint.CurveTo(X + BL * CURVE_MUL, Y + H, X, Y + H - BL * CURVE_MUL, X, Y + H - BL)
|
||||
Paint.LineTo(X, Y + TL)
|
||||
Paint.CurveTo(X, Y + TL * CURVE_MUL, X + TL * CURVE_MUL, Y, X + TL, Y)
|
||||
|
||||
'Paint.Debug = False
|
||||
|
||||
End
|
||||
|
||||
Private Function Padding_Read() As Float
|
||||
Private Function Padding_Read() As Single
|
||||
|
||||
Return LeftPadding
|
||||
|
||||
End
|
||||
|
||||
Private Sub Padding_Write(Value As Float)
|
||||
Private Sub Padding_Write(Value As Single)
|
||||
|
||||
LeftPadding = Value
|
||||
RightPadding = Value
|
||||
|
@ -529,7 +683,7 @@ Private Sub SetProperty(sProp As String, sValue As String)
|
|||
Try vValue = Val("&H" & Mid$(sValue, 2) & "&")
|
||||
Endif
|
||||
Else
|
||||
Try vValue = CFloat(sValue)
|
||||
Try vValue = CSingle(sValue)
|
||||
Endif
|
||||
If Error Then Return
|
||||
|
||||
|
@ -590,13 +744,13 @@ Public Sub _new(Optional Style As String)
|
|||
|
||||
End
|
||||
|
||||
Private Function Margin_Read() As Float
|
||||
Private Function Margin_Read() As Single
|
||||
|
||||
Return LeftMargin
|
||||
|
||||
End
|
||||
|
||||
Private Sub Margin_Write(Value As Float)
|
||||
Private Sub Margin_Write(Value As Single)
|
||||
|
||||
LeftMargin = Value
|
||||
RightMargin = Value
|
||||
|
|
|
@ -332,7 +332,7 @@ DRAW_GRID:
|
|||
Endif
|
||||
|
||||
Paint.Restore
|
||||
|
||||
|
||||
End
|
||||
|
||||
Private Sub DrawText(sText As String, X As Integer, Y As Integer, W As Integer, H As Integer, iAlign As Integer, iPadding As Integer)
|
||||
|
@ -561,6 +561,7 @@ Public Sub ScrollArea_Draw()
|
|||
If Not hClip Then Return
|
||||
|
||||
Paint.Save
|
||||
Paint.ResetClip
|
||||
Paint.Rectangle(hClip.X, hClip.Y, hClip.W, hClip.H)
|
||||
Paint.Clip
|
||||
|
||||
|
@ -633,6 +634,8 @@ Public Sub ScrollArea_Draw()
|
|||
|
||||
Paint.Save
|
||||
If hData.Border Then
|
||||
Paint.Save
|
||||
Paint.Restore
|
||||
If hData.Border.Clip(hSpan.X, hSpan.Y, hSpan.W, hSpan.H) Then Goto NEXT_CELL
|
||||
Else
|
||||
Paint.Rectangle(hSpan.X, hSpan.Y, hSpan.W, hSpan.H)
|
||||
|
|
|
@ -198,3 +198,71 @@ Static Public Sub DrawRichTextShadow(Text As String, X As Float, Y As Float, W A
|
|||
Paint.DrawImage(hShadow, X + DX - Radius, Y + DY - Radius,,, Opacity)
|
||||
|
||||
End
|
||||
|
||||
' Static Public Debug As Boolean
|
||||
'
|
||||
' Static Public Sub MoveTo(X As Float, Y As Float)
|
||||
'
|
||||
' Super.MoveTo(X, Y)
|
||||
' If {Debug} Then Print "MoveTo("; CStr(X); ","; CStr(Y); ")"
|
||||
'
|
||||
' End
|
||||
'
|
||||
' Static Public Sub LineTo(X As Float, Y As Float)
|
||||
'
|
||||
' Super.LineTo(X, Y)
|
||||
' If {Debug} Then Print "LineTo("; CStr(X); ","; CStr(Y); ")"
|
||||
'
|
||||
' End
|
||||
'
|
||||
' Static Public Sub CurveTo(X1 As Float, X2 As Float, Y1 As Float, Y2 As Float, X3 As Float, Y3 As Float)
|
||||
'
|
||||
' Super.CurveTo(X1, X2, Y1, Y2, X3, Y3)
|
||||
' If {Debug} Then Print "CurveTo("; CStr(X1); ","; CStr(Y1); ","; CStr(X2); ","; CStr(Y2); ","; CStr(X3); ","; CStr(Y3); ")"
|
||||
'
|
||||
' End
|
||||
'
|
||||
'
|
||||
' Static Public Sub Clip(Optional Preserve As Boolean)
|
||||
'
|
||||
' If {Debug} Then
|
||||
' With Paint.ClipExtents
|
||||
' Print "Clip() ["; CStr(.X); ","; CStr(.Y); ","; CStr(.Width); ","; CStr(.Height); "] -> ";
|
||||
' End With
|
||||
' Endif
|
||||
' Super.Clip(Preserve)
|
||||
' If {Debug} Then
|
||||
' With Paint.ClipExtents
|
||||
' Print "["; CStr(.X); ","; CStr(.Y); ","; CStr(.Width); ","; CStr(.Height); "]"
|
||||
' End With
|
||||
' Endif
|
||||
'
|
||||
' End
|
||||
'
|
||||
' Static Public Sub Restore()
|
||||
'
|
||||
' If {Debug} Then
|
||||
' With Paint.ClipExtents
|
||||
' Print "Restore() ["; CStr(.X); ","; CStr(.Y); ","; CStr(.Width); ","; CStr(.Height); "] -> ";
|
||||
' End With
|
||||
' Endif
|
||||
' Super.Restore
|
||||
' If {Debug} Then
|
||||
' With Paint.ClipExtents
|
||||
' Print "["; CStr(.X); ","; CStr(.Y); ","; CStr(.Width); ","; CStr(.Height); "]"
|
||||
' End With
|
||||
' Endif
|
||||
'
|
||||
' End
|
||||
'
|
||||
' Static Public Sub Rectangle(X As Float, Y As Float, W As Float, H As Float, Optional R As Float)
|
||||
'
|
||||
' Super.Rectangle(X, Y, W, H, R)
|
||||
' If {Debug} Then
|
||||
' Print "Rectangle("; CStr(X); ","; CStr(Y); ","; CStr(W); ","; CStr(H);
|
||||
' If R Then Print ","; CStr(R);
|
||||
' Print ")"
|
||||
' Endif
|
||||
'
|
||||
' End
|
||||
'
|
||||
|
|
|
@ -12,9 +12,9 @@ Public Sub Form_Open()
|
|||
|
||||
Print gvwInfo.W;; gvwInfo.H;; "/";; Me.W;; Me.H
|
||||
|
||||
hBorderLeft = New Border("margin:4;width:1.5;right-style:none;right-margin:0;right-width:0;top-left-radius:16;bottom-left-radius:16")
|
||||
hBorder = New Border("margin:4;width:1.5;left-margin:0;right-margin:0;left-style:none;right-style:none;left-width:0;right-width:0;")
|
||||
hBorderRight = New Border("margin:4;width:1.5;left-style:none;left-margin:0;left-width:0")
|
||||
hBorderLeft = New Border("margin:4;width:4;right-style:none;right-margin:0;right-width:0;top-left-radius:16;bottom-left-radius:16;color:#80000000")
|
||||
hBorder = New Border("margin:4;width:4;left-margin:0;right-margin:0;left-style:none;right-style:none;left-width:0;right-width:0;")
|
||||
hBorderRight = New Border("margin:4;width:4;left-style:none;left-margin:0;left-width:0;top-right-radius:24;right-color:green")
|
||||
|
||||
'gvwinfo.Clear
|
||||
gvwinfo.Columns.Count = 3
|
||||
|
@ -27,6 +27,7 @@ Public Sub Form_Open()
|
|||
gvwInfo[I, J].Border = hBorder
|
||||
Next
|
||||
Next
|
||||
'gvwInfo[8, 0].Border = hBorderLeft
|
||||
|
||||
'gvwinfo.Rows.Resizable = True
|
||||
gvwinfo[0, 0].Text = "Bleu"
|
||||
|
@ -64,11 +65,14 @@ Public Sub Form_Open()
|
|||
|
||||
gvwInfo[1, 1].Background = Color.Yellow
|
||||
|
||||
gvwInfo[6, 1].Border = gvwInfo[6, 1].Border.Copy()
|
||||
gvwInfo[6, 1].Border = hBorderLeft.Copy()
|
||||
With gvwInfo[6, 1].Border
|
||||
.SlashStyle = Border.Dotted
|
||||
.SlashColor = Color.Red
|
||||
.SlashWidth = 4
|
||||
.BackSlashStyle = Border.Double + Border.Dashed
|
||||
.BackSlashColor = Color.Red
|
||||
.BackSlashWidth = 4
|
||||
End With
|
||||
|
||||
|
||||
|
@ -79,9 +83,12 @@ Public Sub Form_Open()
|
|||
gvwInfo[0, 0].ColumnSpan = gvwInfo.Columns.Count
|
||||
|
||||
gvwinfo.Columns.Width = -1
|
||||
'gvwinfo.Rows[6].Height = -1
|
||||
gvwInfo.Columns[0].W = 110
|
||||
gvwinfo.Rows[6].Height = -1
|
||||
|
||||
txtPadding.Value = gvwInfo.Padding
|
||||
|
||||
Me.Height += 2
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Gambas Form File 3.0
|
||||
|
||||
{ Form Form
|
||||
MoveScaled(0,0,72,75)
|
||||
MoveScaled(0,0,72,68)
|
||||
Arrangement = Arrange.Vertical
|
||||
{ HBox1 HBox
|
||||
MoveScaled(6,1,25,4)
|
||||
|
|
34
comp/src/gb.gui.base/.src/Test/FTestClipping.class
Normal file
34
comp/src/gb.gui.base/.src/Test/FTestClipping.class
Normal file
|
@ -0,0 +1,34 @@
|
|||
' Gambas class file
|
||||
|
||||
|
||||
Public Sub DrawingArea1_Draw()
|
||||
|
||||
'Paint.Debug = True
|
||||
|
||||
Paint.ResetClip
|
||||
Paint.Rectangle(55, 50, 431, 400)
|
||||
Paint.Clip
|
||||
Paint.MoveTo(75, 446)
|
||||
Paint.LineTo(165, 446)
|
||||
Paint.LineTo(165, 487)
|
||||
Paint.LineTo(75, 487)
|
||||
Paint.CurveTo(66.163444, 59, 487, 479.836556, 59, 471)
|
||||
Paint.LineTo(59, 462)
|
||||
Paint.CurveTo(59, 66.163444, 453.163444, 446, 75, 446)
|
||||
Paint.LineTo(75, 446)
|
||||
Paint.Clip()
|
||||
Paint.MoveTo(59, 446)
|
||||
Paint.LineTo(112, 499)
|
||||
Paint.LineTo(112, 450)
|
||||
Paint.LineTo(165, 450)
|
||||
Paint.LineTo(165, 446)
|
||||
Paint.LineTo(59, 446)
|
||||
Paint.Clip()
|
||||
|
||||
'Paint.Debug = False
|
||||
|
||||
Paint.Background = Color.Red
|
||||
Paint.Rectangle(0, 0, Paint.W, Paint.H)
|
||||
Paint.Fill
|
||||
|
||||
End
|
10
comp/src/gb.gui.base/.src/Test/FTestClipping.form
Normal file
10
comp/src/gb.gui.base/.src/Test/FTestClipping.form
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Gambas Form File 3.0
|
||||
|
||||
{ Form Form
|
||||
MoveScaled(0,0,99,72)
|
||||
Arrangement = Arrange.Fill
|
||||
{ DrawingArea1 DrawingArea
|
||||
MoveScaled(1,1,62,47)
|
||||
Background = &HFFFFFF&
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
[Component]
|
||||
Key=gb.db.sqlite2
|
||||
Author=Nigel Gerrard,Benoît Minisini
|
||||
State=0
|
||||
State=Deprecated
|
||||
Require=gb.db
|
||||
|
||||
|
|
|
@ -384,17 +384,14 @@ public:
|
|||
virtual void open(const string & sql) = 0;
|
||||
virtual void open() = 0;
|
||||
|
||||
/* func. executes a query without results to return */
|
||||
virtual int exec(const string & sql) = 0;
|
||||
virtual int exec() = 0;
|
||||
virtual const void *getExecRes() = 0;
|
||||
|
||||
/* as open, but with our query exept Sql */
|
||||
virtual bool query(const char *sql) = 0;
|
||||
|
||||
/* Close SQL Query*/
|
||||
virtual void close();
|
||||
|
||||
virtual result_set *getResult() = 0;
|
||||
|
||||
/* This function looks for field Field_name with value equal Field_value
|
||||
Returns true if found (position of dataset is set to founded position)
|
||||
and false another way (position is not changed). */
|
||||
|
|
|
@ -300,7 +300,6 @@ static int do_query(DB_DATABASE *db, const char *error, Dataset **pres, const ch
|
|||
int err;
|
||||
int retry = 0;
|
||||
int max_retry;
|
||||
bool select;
|
||||
bool success;
|
||||
|
||||
if (nsubst)
|
||||
|
@ -331,18 +330,13 @@ static int do_query(DB_DATABASE *db, const char *error, Dataset **pres, const ch
|
|||
else
|
||||
max_retry = 0;
|
||||
|
||||
select = (strncasecmp("select ", query, 7) == 0 || strncasecmp("with ", query, 5) == 0);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
err = 0;
|
||||
|
||||
res->setNeedFieldType(_need_field_type);
|
||||
|
||||
if (select)
|
||||
success = res->query(query);
|
||||
else
|
||||
success = res->exec(query);
|
||||
success = res->query(query);
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
@ -953,7 +947,7 @@ static int query_fill(DB_DATABASE *db, DB_RESULT result, int pos, GB_VARIANT_VAL
|
|||
fType type;
|
||||
|
||||
if (!next)
|
||||
res->seek(pos); /* move to record */
|
||||
res->seek(pos);
|
||||
else
|
||||
res->next();
|
||||
|
||||
|
@ -1196,7 +1190,7 @@ static int table_init(DB_DATABASE * db, const char *table, DB_INFO * info)
|
|||
if (do_query(db, "Unable to get table fields: &1", &res, qfield, 1, table))
|
||||
return TRUE;
|
||||
|
||||
result_set *r = (result_set *) res->getExecRes();
|
||||
result_set *r = (result_set *) res->getResult();
|
||||
|
||||
info->nfield = n = r->records.size();
|
||||
if (n == 0)
|
||||
|
@ -1268,7 +1262,7 @@ static int table_index(DB_DATABASE * db, const char *table, DB_INFO * info)
|
|||
if (do_query(db, "Unable to get primary index: &1", &res, qindex1, 1, table))
|
||||
return TRUE;
|
||||
|
||||
result_set *r = (result_set *) res->getExecRes();
|
||||
result_set *r = (result_set *) res->getResult();
|
||||
n = r->records.size();
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
|
@ -1288,7 +1282,7 @@ static int table_index(DB_DATABASE * db, const char *table, DB_INFO * info)
|
|||
}
|
||||
GB.FreeString(&sql);
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
info->nindex = r->records.size();
|
||||
GB.Alloc(POINTER(&info->index), sizeof(int) * info->nindex);
|
||||
|
||||
|
@ -1312,7 +1306,7 @@ static int table_index(DB_DATABASE * db, const char *table, DB_INFO * info)
|
|||
"PRAGMA table_info('&1')", 1, table))
|
||||
return TRUE;
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
|
||||
info->nindex = 1;
|
||||
GB.Alloc(POINTER(&info->index), sizeof(int));
|
||||
|
@ -1478,7 +1472,7 @@ static int table_primary_key(DB_DATABASE * db, const char *table, char ***primar
|
|||
|
||||
GB.NewArray(primary, sizeof(char *), 0);
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
n = r->records.size();
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
|
@ -1496,7 +1490,7 @@ static int table_primary_key(DB_DATABASE * db, const char *table, char ***primar
|
|||
}
|
||||
GB.FreeString(&sql);
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
if ((n = r->records.size()) < 1)
|
||||
{
|
||||
// No information returned for key
|
||||
|
@ -1524,7 +1518,7 @@ static int table_primary_key(DB_DATABASE * db, const char *table, char ***primar
|
|||
"PRAGMA table_info('&1')", 1, table))
|
||||
return TRUE;
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
|
||||
for (i = 0; i < (int) r->records.size(); i++)
|
||||
{
|
||||
|
@ -1759,7 +1753,7 @@ static int field_exist(DB_DATABASE * db, const char *table, const char *field)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
result_set *r = (result_set *) res->getExecRes();
|
||||
result_set *r = (result_set *) res->getResult();
|
||||
|
||||
n = r->records.size();
|
||||
|
||||
|
@ -1802,7 +1796,7 @@ static int field_list(DB_DATABASE * db, const char *table, char ***fields)
|
|||
return -1;
|
||||
}
|
||||
|
||||
result_set *r = (result_set *) res->getExecRes();
|
||||
result_set *r = (result_set *) res->getResult();
|
||||
|
||||
n = r->records.size();
|
||||
|
||||
|
@ -1860,7 +1854,7 @@ static int field_info(DB_DATABASE *db, const char *table, const char *field, DB_
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
|
||||
if ((n = r->records.size()) == 0)
|
||||
{
|
||||
|
@ -2118,7 +2112,7 @@ static int index_info(DB_DATABASE * db, const char *table, const char *index, DB
|
|||
table))
|
||||
return TRUE;
|
||||
|
||||
result_set *r = (result_set *) res->getExecRes();
|
||||
result_set *r = (result_set *) res->getResult();
|
||||
|
||||
if ((n = r->records.size()) == 0)
|
||||
{
|
||||
|
@ -2160,7 +2154,7 @@ static int index_info(DB_DATABASE * db, const char *table, const char *index, DB
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
r = (result_set *) res->getExecRes();
|
||||
r = (result_set *) res->getResult();
|
||||
n = r->records.size();
|
||||
i = 0;
|
||||
/* (BM) row can be null if we are seeking the last index */
|
||||
|
|
|
@ -796,45 +796,6 @@ void SqliteDataset::fill_fields()
|
|||
|
||||
// BM: should retry if error = SQLITE_SCHEMA
|
||||
|
||||
int SqliteDataset::exec(const string & sql)
|
||||
{
|
||||
int res;
|
||||
int retry;
|
||||
|
||||
|
||||
if (!handle())
|
||||
GB.Error("No database connection");
|
||||
|
||||
exec_res.record_header.clear();
|
||||
exec_res.records.clear();
|
||||
exec_res.conn = handle(); //NG
|
||||
//if ((strncmp("select",sql.c_str(),6) == 0) || (strncmp("SELECT",sql.c_str(),6) == 0))
|
||||
|
||||
for (retry = 1; retry <= 2; retry++)
|
||||
{
|
||||
res = my_sqlite3_exec(handle(), sql.c_str(), &callback, &exec_res, NULL);
|
||||
if (res != SQLITE_SCHEMA)
|
||||
break;
|
||||
}
|
||||
|
||||
db->setErr(res);
|
||||
//if (res != SQLITE_OK)
|
||||
// GB.Error(db->getErrorMsg());
|
||||
|
||||
return (res == SQLITE_OK);
|
||||
}
|
||||
|
||||
int SqliteDataset::exec()
|
||||
{
|
||||
return exec(sql);
|
||||
}
|
||||
|
||||
const void *SqliteDataset::getExecRes()
|
||||
{
|
||||
return &exec_res;
|
||||
}
|
||||
|
||||
|
||||
bool SqliteDataset::query(const char *query)
|
||||
{
|
||||
int res;
|
||||
|
@ -864,11 +825,6 @@ bool SqliteDataset::query(const char *query)
|
|||
return (res == SQLITE_OK);
|
||||
}
|
||||
|
||||
bool SqliteDataset::query(const string & q)
|
||||
{
|
||||
return query(q.c_str());
|
||||
}
|
||||
|
||||
void SqliteDataset::open(const string & sql)
|
||||
{
|
||||
set_select_sql(sql);
|
||||
|
@ -934,7 +890,7 @@ bool SqliteDataset::bof()
|
|||
void SqliteDataset::first()
|
||||
{
|
||||
Dataset::first();
|
||||
this->fill_fields();
|
||||
fill_fields();
|
||||
//cout << "In first "<< fields_object->size()<<"\n";
|
||||
}
|
||||
|
||||
|
@ -1162,3 +1118,8 @@ fType GetFieldType(const char *Type, unsigned int *length)
|
|||
|
||||
return rType;
|
||||
}
|
||||
|
||||
result_set *SqliteDataset::getResult()
|
||||
{
|
||||
return &result;
|
||||
}
|
||||
|
|
|
@ -156,7 +156,6 @@ class SqliteDataset:public Dataset
|
|||
protected:
|
||||
/* query results*/
|
||||
result_set result;
|
||||
result_set exec_res;
|
||||
|
||||
sqlite3 *handle();
|
||||
|
||||
|
@ -183,13 +182,8 @@ public:
|
|||
/* opens a query & then sets a query results */
|
||||
virtual void open();
|
||||
virtual void open(const string & sql);
|
||||
/* func. executes a query without results to return */
|
||||
virtual int exec();
|
||||
virtual int exec(const string & sql);
|
||||
virtual const void *getExecRes();
|
||||
/* as open, but with our query exept Sql */
|
||||
virtual bool query(const char *query);
|
||||
virtual bool query(const string & query);
|
||||
/* func. closes a query */
|
||||
virtual void close(void);
|
||||
/* Cancel changes, made in insert or edit states of dataset */
|
||||
|
@ -208,6 +202,8 @@ public:
|
|||
/* Go to record No (starting with 0) */
|
||||
virtual bool seek(int pos = 0);
|
||||
|
||||
virtual result_set *getResult();
|
||||
|
||||
void setNeedFieldType(bool need);
|
||||
};
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#include "csvgimage.h"
|
||||
#include "cpaint_impl.h"
|
||||
|
||||
class ClipInfo
|
||||
/*class ClipInfo
|
||||
{
|
||||
public:
|
||||
QPainterPath *path;
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
ClipInfo() { path = NULL; rect = NULL; }
|
||||
~ClipInfo() { delete path; delete rect; }
|
||||
};
|
||||
};*/
|
||||
|
||||
typedef
|
||||
struct {
|
||||
|
@ -73,9 +73,9 @@ typedef
|
|||
int fillRule;
|
||||
QTransform *init;
|
||||
float bx, by;
|
||||
QPainterPath *clip;
|
||||
GB_RECT *clipRect;
|
||||
QList<ClipInfo *> *clipStack;
|
||||
//QPainterPath *clip;
|
||||
//GB_RECT *clipRect;
|
||||
//QList<ClipInfo *> *clipStack;
|
||||
}
|
||||
QT_PAINT_EXTRA;
|
||||
|
||||
|
@ -86,7 +86,7 @@ typedef
|
|||
|
||||
#define PAINTER(d) EXTRA(d)->painter
|
||||
#define PATH(d) EXTRA(d)->path
|
||||
#define CLIP(d) EXTRA(d)->clip
|
||||
//#define CLIP(d) EXTRA(d)->clip
|
||||
|
||||
static inline qreal to_deg(float angle)
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ static QColor get_color(GB_PAINT *d, GB_COLOR col)
|
|||
return CCOLOR_make(col);
|
||||
}
|
||||
|
||||
static void begin_clipping(GB_PAINT *d)
|
||||
/*static void begin_clipping(GB_PAINT *d)
|
||||
{
|
||||
if (CLIP(d))
|
||||
{
|
||||
|
@ -171,7 +171,10 @@ static void end_clipping(GB_PAINT *d)
|
|||
{
|
||||
if (CLIP(d))
|
||||
PAINTER(d)->setClipping(false);
|
||||
}
|
||||
}*/
|
||||
|
||||
#define begin_clipping(_d)
|
||||
#define end_clipping(_d)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
@ -287,27 +290,27 @@ static void End(GB_PAINT *d)
|
|||
PAINTER(d)->end(); // ??
|
||||
}
|
||||
|
||||
if (dx->clipStack)
|
||||
/*if (dx->clipStack)
|
||||
{
|
||||
while (!dx->clipStack->isEmpty())
|
||||
delete dx->clipStack->takeLast();
|
||||
delete dx->clipStack;
|
||||
}
|
||||
}*/
|
||||
|
||||
delete dx->init;
|
||||
delete dx->path;
|
||||
delete dx->clip;
|
||||
//delete dx->clip;
|
||||
delete dx->painter;
|
||||
}
|
||||
|
||||
static void Save(GB_PAINT *d)
|
||||
{
|
||||
QT_PAINT_EXTRA *dx = EXTRA(d);
|
||||
ClipInfo *ci;
|
||||
//QT_PAINT_EXTRA *dx = EXTRA(d);
|
||||
//ClipInfo *ci;
|
||||
|
||||
PAINTER(d)->save();
|
||||
|
||||
if (!dx->clipStack)
|
||||
/*if (!dx->clipStack)
|
||||
dx->clipStack = new QList<ClipInfo *>;
|
||||
|
||||
ci = new ClipInfo;
|
||||
|
@ -319,16 +322,16 @@ static void Save(GB_PAINT *d)
|
|||
*ci->rect = *dx->clipRect;
|
||||
}
|
||||
|
||||
dx->clipStack->append(ci);
|
||||
dx->clipStack->append(ci);*/
|
||||
}
|
||||
|
||||
static void Restore(GB_PAINT *d)
|
||||
{
|
||||
QT_PAINT_EXTRA *dx = EXTRA(d);
|
||||
//QT_PAINT_EXTRA *dx = EXTRA(d);
|
||||
|
||||
PAINTER(d)->restore();
|
||||
|
||||
if (dx->clipStack && !dx->clipStack->isEmpty())
|
||||
/*if (dx->clipStack && !dx->clipStack->isEmpty())
|
||||
{
|
||||
ClipInfo *ci = dx->clipStack->takeLast();
|
||||
|
||||
|
@ -345,7 +348,7 @@ static void Restore(GB_PAINT *d)
|
|||
dx->clipRect = NULL;
|
||||
|
||||
delete ci;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
static void Antialias(GB_PAINT *d, int set, int *antialias)
|
||||
|
@ -411,36 +414,39 @@ static void init_path(GB_PAINT *d)
|
|||
if (!PATH(_d)) \
|
||||
EXTRA(_d)->path = new QPainterPath();
|
||||
|
||||
static void delete_clip_rect(GB_PAINT *d)
|
||||
/*static void delete_clip_rect(GB_PAINT *d)
|
||||
{
|
||||
if (EXTRA(d)->clipRect)
|
||||
{
|
||||
delete EXTRA(d)->clipRect;
|
||||
EXTRA(d)->clipRect = NULL;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
static void Clip(GB_PAINT *d, int preserve)
|
||||
{
|
||||
CHECK_PATH(d);
|
||||
|
||||
PAINTER(d)->setClipPath(*PATH(d), PAINTER(d)->hasClipping() ? Qt::IntersectClip : Qt::ReplaceClip);
|
||||
|
||||
QPainterPath path = PAINTER(d)->worldTransform().map(*PATH(d));
|
||||
/*QPainterPath path = PAINTER(d)->worldTransform().map(*PATH(d));
|
||||
|
||||
if (CLIP(d))
|
||||
path = CLIP(d)->intersected(path);
|
||||
|
||||
delete EXTRA(d)->clip;
|
||||
EXTRA(d)->clip = new QPainterPath(path);
|
||||
delete_clip_rect(d);
|
||||
delete_clip_rect(d);*/
|
||||
|
||||
PRESERVE_PATH(d, preserve);
|
||||
}
|
||||
|
||||
static void ResetClip(GB_PAINT *d)
|
||||
{
|
||||
delete CLIP(d);
|
||||
/*delete CLIP(d);
|
||||
EXTRA(d)->clip = 0;
|
||||
delete_clip_rect(d);
|
||||
delete_clip_rect(d);*/
|
||||
PAINTER(d)->setClipping(false);
|
||||
}
|
||||
|
||||
static void get_path_extents(QPainterPath *path, GB_EXTENTS *ext, const QTransform &transform)
|
||||
|
@ -461,7 +467,7 @@ static void get_path_extents(QPainterPath *path, GB_EXTENTS *ext, const QTransfo
|
|||
|
||||
static void ClipExtents(GB_PAINT *d, GB_EXTENTS *ext)
|
||||
{
|
||||
GB_RECT *rect = EXTRA(d)->clipRect;
|
||||
/*GB_RECT *rect = EXTRA(d)->clipRect;
|
||||
if (rect)
|
||||
{
|
||||
ext->x1 = (float)rect->x;
|
||||
|
@ -469,22 +475,23 @@ static void ClipExtents(GB_PAINT *d, GB_EXTENTS *ext)
|
|||
ext->x2 = (float)(rect->x + rect->w);
|
||||
ext->y2 = (float)(rect->y + rect->h);
|
||||
}
|
||||
else
|
||||
get_path_extents(CLIP(d), ext, PAINTER(d)->transform());
|
||||
else*/
|
||||
QPainterPath path = PAINTER(d)->clipPath();
|
||||
get_path_extents(&path, ext, QTransform()); //PAINTER(d)->transform());
|
||||
}
|
||||
|
||||
static void Fill(GB_PAINT *d, int preserve)
|
||||
{
|
||||
CHECK_PATH(d);
|
||||
|
||||
if (!CLIP(d))
|
||||
//if (!CLIP(d))
|
||||
PAINTER(d)->fillPath(*PATH(d), PAINTER(d)->brush());
|
||||
else
|
||||
/*else
|
||||
{
|
||||
QPainterPath path = PAINTER(d)->worldTransform().inverted().map(*CLIP(d));
|
||||
path = path.intersected(*PATH(d));
|
||||
PAINTER(d)->fillPath(path, PAINTER(d)->brush());
|
||||
}
|
||||
}*/
|
||||
|
||||
PRESERVE_PATH(d, preserve);
|
||||
}
|
||||
|
@ -495,9 +502,9 @@ static void Stroke(GB_PAINT *d, int preserve)
|
|||
|
||||
if (PAINTER(d)->pen().widthF() > 0.0)
|
||||
{
|
||||
if (!CLIP(d))
|
||||
//if (!CLIP(d))
|
||||
PAINTER(d)->strokePath(*PATH(d), PAINTER(d)->pen());
|
||||
else
|
||||
/*else
|
||||
{
|
||||
QPainterPathStroker stroker;
|
||||
QPen pen = PAINTER(d)->pen();
|
||||
|
@ -512,7 +519,7 @@ static void Stroke(GB_PAINT *d, int preserve)
|
|||
QPainterPath path = PAINTER(d)->worldTransform().inverted().map(*CLIP(d));
|
||||
path = path.intersected(stroker.createStroke(*PATH(d)));
|
||||
PAINTER(d)->fillPath(path, PAINTER(d)->brush());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
PRESERVE_PATH(d, preserve);
|
||||
|
@ -834,17 +841,17 @@ static void Rectangle(GB_PAINT *d, float x, float y, float width, float height)
|
|||
|
||||
static void ClipRect(GB_PAINT *d, int x, int y, int w, int h)
|
||||
{
|
||||
GB_RECT *rect;
|
||||
//GB_RECT *rect;
|
||||
ResetClip(d);
|
||||
Rectangle(d, x, y, w, h);
|
||||
Clip(d, FALSE);
|
||||
|
||||
rect = new GB_RECT;
|
||||
/*rect = new GB_RECT;
|
||||
rect->x = x;
|
||||
rect->y = y;
|
||||
rect->w = w;
|
||||
rect->h = h;
|
||||
EXTRA(d)->clipRect = rect;
|
||||
EXTRA(d)->clipRect = rect;*/
|
||||
}
|
||||
|
||||
static void GetCurrentPoint(GB_PAINT *d, float *x, float *y)
|
||||
|
|
|
@ -19,7 +19,7 @@ File[1]=".src/Main.module:4.2"
|
|||
Active=3
|
||||
File[2]=".src/Connections.class:137.22"
|
||||
Count=3
|
||||
File[3]=".src/Connection.class:115.2"
|
||||
File[3]=".src/Connection.class:208.4"
|
||||
|
||||
[Watches]
|
||||
Count=0
|
||||
|
|
Loading…
Reference in a new issue