From d48356d59da76b923f544f68be59c88ecff3872f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 10 Apr 2009 21:19:32 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * NEW: Now each database driver has its own component, so that you can explicitely check it. This way, these dependencies are taken into account when making a binary package. * NEW: Starting support for WebPage classes, and other kind of forms. [WIKI CGI SCRIPT] * BUG: Symbol pages are never cached, so that refreshing a 2.0 symbol page does not break a 3.0 symbol page. [INTERPRETER] * NEW: gb.IgnoreCase is a new property that is a synonymous of gb.Text. * NEW: gb.UseLanguage is a new property that is a synonymous of gb.Language. [GB.DB.*] * NEW: All database drivers now have a *.component file, and is visible in the IDE project property dialog. git-svn-id: svn://localhost/gambas/trunk@1926 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- TODO | 5 +- app/src/doc.cgi/.lang/.pot | 372 +++++++++++++------------ app/src/doc.cgi/.project | 2 +- app/src/doc.cgi/Main.module | 45 ++- app/src/gambas3/CComponent.class | 6 + app/src/gambas3/CModule.class | 63 +++++ app/src/gambas3/FCreateFile.class | 32 ++- app/src/gambas3/FCreateFile.form | 40 ++- app/src/gambas3/FFind.class | 12 +- app/src/gambas3/FMain.class | 8 +- app/src/gambas3/FMain.form | 18 +- app/src/gambas3/FOption.class | 2 +- app/src/gambas3/FTextEditor.class | 9 +- app/src/gambas3/Project.module | 136 ++++----- app/src/gambas3/img/module/class.png | Bin 0 -> 271 bytes app/src/gambas3/img/module/form.png | Bin 0 -> 436 bytes app/src/gambas3/img/module/module.png | Bin 0 -> 285 bytes app/src/gambas3/img/module/webpage.png | Bin 0 -> 103 bytes comp/src/gb.web/.component | 2 + comp/src/gb.web/.info | 3 + comp/src/gb.web/.list | 1 + comp/src/gb.web/WebPage.class | 3 + gb.db.firebird/component.am | 1 + gb.db.firebird/src/Makefile.am | 3 + gb.db.mysql/src/Makefile.am | 3 + gb.db.mysql/src/gb.db.mysql.component | 5 + gb.db.odbc/component.am | 1 + gb.db.odbc/src/Makefile.am | 3 + gb.db.postgresql/component.am | 1 + gb.db.postgresql/src/Makefile.am | 3 + gb.db.sqlite2/component.am | 1 + gb.db.sqlite2/src/Makefile.am | 3 + gb.db.sqlite3/component.am | 1 + gb.db.sqlite3/src/Makefile.am | 3 + gb.qt.kde/src/gb.qt.kde.component | 5 - main/gbx/gbx_c_gambas.c | 2 + 36 files changed, 495 insertions(+), 299 deletions(-) create mode 100644 app/src/gambas3/CModule.class create mode 100644 app/src/gambas3/img/module/class.png create mode 100644 app/src/gambas3/img/module/form.png create mode 100644 app/src/gambas3/img/module/module.png create mode 100644 app/src/gambas3/img/module/webpage.png create mode 100644 comp/src/gb.web/WebPage.class create mode 120000 gb.db.firebird/component.am create mode 100644 gb.db.mysql/src/gb.db.mysql.component create mode 120000 gb.db.odbc/component.am create mode 120000 gb.db.postgresql/component.am create mode 120000 gb.db.sqlite2/component.am create mode 120000 gb.db.sqlite3/component.am diff --git a/TODO b/TODO index ee679f3a2..e6a116443 100644 --- a/TODO +++ b/TODO @@ -69,6 +69,7 @@ GUI RELATED STUFF - Form.KeyPreview - Control.HasFocus - GridView.Cell.WordWrap +- ValueBox.Value should be visible in the IDE. DESKTOP COMPONENT @@ -83,10 +84,6 @@ DATABASE COMPONENT - Copy a result line into another one. - Use SAVEPOINT in postgresql to simulate nested transactions. -NETWORK COMPONENT - -- Support for UDP sockets on local paths. - DOCUMENTATION WIKI - Mass rename command. diff --git a/app/src/doc.cgi/.lang/.pot b/app/src/doc.cgi/.lang/.pot index a5ef6abf9..8119c40a8 100644 --- a/app/src/doc.cgi/.lang/.pot +++ b/app/src/doc.cgi/.lang/.pot @@ -34,353 +34,361 @@ msgstr "" msgid "Description" msgstr "" -#: Main.module:1133 +#: Main.module:1135 msgid "Index" msgstr "" -#: Main.module:1240 +#: Main.module:1242 msgid "Gambas Documentation" msgstr "" -#: Main.module:1282 +#: Main.module:1284 msgid "Home" msgstr "" -#: Main.module:1440 +#: Main.module:1442 msgid "Previous" msgstr "" -#: Main.module:1449 +#: Main.module:1451 msgid "Next" msgstr "" -#: Main.module:1468 +#: Main.module:1470 msgid "Cancel" msgstr "" -#: Main.module:1473 +#: Main.module:1475 msgid "Edit" msgstr "" -#: Main.module:1475 +#: Main.module:1477 msgid "Create" msgstr "" -#: Main.module:1480 +#: Main.module:1482 msgid "Rename" msgstr "" -#: Main.module:1485 +#: Main.module:1487 msgid "Undo" msgstr "" -#: Main.module:1490 +#: Main.module:1492 msgid "Refresh" msgstr "" -#: Main.module:1496 +#: Main.module:1498 msgid "Search" msgstr "" -#: Main.module:1497 +#: Main.module:1499 msgid "Administration" msgstr "" -#: Main.module:1535 +#: Main.module:1537 msgid "Documentation" msgstr "" -#: Main.module:1539 +#: Main.module:1541 msgid "History" msgstr "" -#: Main.module:1560 +#: Main.module:1562 msgid "Warning!" msgstr "" -#: Main.module:1562 +#: Main.module:1564 msgid "See english version" msgstr "" -#: Main.module:1569 +#: Main.module:1571 msgid "Comments on &1" msgstr "" -#: Main.module:1755 +#: Main.module:1757 msgid "This page is not translated." msgstr "" -#: Main.module:1762 +#: Main.module:1764 msgid "This page is not up to date." msgstr "" -#: Main.module:1770 +#: Main.module:1772 msgid "There is no comment on this page yet." msgstr "" -#: Main.module:1772 +#: Main.module:1774 msgid "This documentation page is not available." msgstr "" -#: Main.module:2085 -msgid "DELETE ME" +#: Main.module:1836 +msgid "This symbol does not exist in version &1." msgstr "" -#: Main.module:2145 -msgid "Save" +#: Main.module:1839 +msgid "This class does not exist in version &1." msgstr "" -#: Main.module:2145 -msgid "Delete" -msgstr "" - -#: Main.module:2635 -msgid "New path" -msgstr "" - -#: Main.module:2637 -msgid "Rename children" -msgstr "" - -#: Main.module:2699 -msgid "This documentation page already exists." -msgstr "" - -#: Main.module:2759 -msgid "&1 - History" -msgstr "" - -#: Main.module:2850 -msgid "No change" -msgstr "" - -#: Main.module:2866 -msgid "Creation" -msgstr "" - -#: Main.module:2880 -msgid "Welcome back &1!" -msgstr "" - -#: Main.module:2927 -msgid "User management" -msgstr "" - -#: Main.module:2938 -msgid "Create user" -msgstr "" - -#: Main.module:2940 -msgid "Edit user" -msgstr "" - -#: Main.module:2942 -msgid "Delete user" -msgstr "" - -#: Main.module:2949 -msgid "Name" -msgstr "" - -#: Main.module:2950 -msgid "Password" -msgstr "" - -#: Main.module:2951 -msgid "Confirm" -msgstr "" - -#: Main.module:2994 -msgid "Database management" -msgstr "" - -#: Main.module:2997 -msgid "Download database" -msgstr "" - -#: Main.module:3001 -msgid "Purge temporary files" -msgstr "" - -#: Main.module:3021 -msgid "Please enter a user name." -msgstr "" - -#: Main.module:3023 -msgid "Passwords do not match." -msgstr "" - -#: Main.module:3025 -msgid "Please enter a password." -msgstr "" - -#: Main.module:3027 -msgid "User already exists." -msgstr "" - -#: Main.module:3031 -msgid "User '&1' created." -msgstr "" - -#: Main.module:3033 -msgid "Cannot create user '&1'. Error code #&2." -msgstr "" - -#: Main.module:3047 -msgid "User '&1' modified." -msgstr "" - -#: Main.module:3049 -msgid "Cannot edit user '&1'. Error code #&2." -msgstr "" - -#: Main.module:3058 -msgid "Cannot delete user 'gambas'. This user is reserved." -msgstr "" - -#: Main.module:3062 -msgid "User '&1' deleted." -msgstr "" - -#: Main.module:3064 -msgid "Cannot delete user '&1'. Error code #&2." -msgstr "" - -#: Main.module:3086 -msgid "Return to administration page" -msgstr "" - -#: Main.module:3099 -msgid "Search with Google" -msgstr "" - -#: Main.module:3158 +#: Main.module:1842 msgid "This component does not exist in version &1." msgstr "" -#: Main.module:3160 +#: Main.module:2100 +msgid "DELETE ME" +msgstr "" + +#: Main.module:2160 +msgid "Save" +msgstr "" + +#: Main.module:2160 +msgid "Delete" +msgstr "" + +#: Main.module:2650 +msgid "New path" +msgstr "" + +#: Main.module:2652 +msgid "Rename children" +msgstr "" + +#: Main.module:2714 +msgid "This documentation page already exists." +msgstr "" + +#: Main.module:2774 +msgid "&1 - History" +msgstr "" + +#: Main.module:2865 +msgid "No change" +msgstr "" + +#: Main.module:2881 +msgid "Creation" +msgstr "" + +#: Main.module:2895 +msgid "Welcome back &1!" +msgstr "" + +#: Main.module:2942 +msgid "User management" +msgstr "" + +#: Main.module:2953 +msgid "Create user" +msgstr "" + +#: Main.module:2955 +msgid "Edit user" +msgstr "" + +#: Main.module:2957 +msgid "Delete user" +msgstr "" + +#: Main.module:2964 +msgid "Name" +msgstr "" + +#: Main.module:2965 +msgid "Password" +msgstr "" + +#: Main.module:2966 +msgid "Confirm" +msgstr "" + +#: Main.module:3009 +msgid "Database management" +msgstr "" + +#: Main.module:3012 +msgid "Download database" +msgstr "" + +#: Main.module:3016 +msgid "Purge temporary files" +msgstr "" + +#: Main.module:3036 +msgid "Please enter a user name." +msgstr "" + +#: Main.module:3038 +msgid "Passwords do not match." +msgstr "" + +#: Main.module:3040 +msgid "Please enter a password." +msgstr "" + +#: Main.module:3042 +msgid "User already exists." +msgstr "" + +#: Main.module:3046 +msgid "User '&1' created." +msgstr "" + +#: Main.module:3048 +msgid "Cannot create user '&1'. Error code #&2." +msgstr "" + +#: Main.module:3062 +msgid "User '&1' modified." +msgstr "" + +#: Main.module:3064 +msgid "Cannot edit user '&1'. Error code #&2." +msgstr "" + +#: Main.module:3073 +msgid "Cannot delete user 'gambas'. This user is reserved." +msgstr "" + +#: Main.module:3077 +msgid "User '&1' deleted." +msgstr "" + +#: Main.module:3079 +msgid "Cannot delete user '&1'. Error code #&2." +msgstr "" + +#: Main.module:3101 +msgid "Return to administration page" +msgstr "" + +#: Main.module:3114 +msgid "Search with Google" +msgstr "" + +#: Main.module:3177 msgid "Classes" msgstr "" -#: Main.module:3330 +#: Main.module:3347 msgid "Date" msgstr "" -#: Main.module:3330 +#: Main.module:3347 msgid "User" msgstr "" -#: Main.module:3330 +#: Main.module:3347 msgid "Page" msgstr "" -#: Main.module:3363 +#: Main.module:3380 msgid "State" msgstr "" -#: Main.module:3504 +#: Main.module:3521 msgid "Symbols" msgstr "" -#: Main.module:3513 +#: Main.module:3530 msgid "This class reimplements" msgstr "" -#: Main.module:3515 +#: Main.module:3532 msgid "This class inherits" msgstr "" -#: Main.module:3521 +#: Main.module:3538 msgid "in" msgstr "" -#: Main.module:3529 +#: Main.module:3546 msgid "This class is &1." msgstr "" -#: Main.module:3531 +#: Main.module:3548 msgid "" "This class can be used like an object by creating an hidden instance on " "demand." msgstr "" -#: Main.module:3535 +#: Main.module:3552 msgid "creatable" msgstr "" -#: Main.module:3538 +#: Main.module:3555 msgid "This class is static." msgstr "" -#: Main.module:3540 +#: Main.module:3557 msgid "This class is not creatable." msgstr "" -#: Main.module:3546 +#: Main.module:3563 msgid "This class acts like a &1 / &2 array." msgstr "" -#: Main.module:3546 +#: Main.module:3563 msgid "read" msgstr "" -#: Main.module:3546 +#: Main.module:3563 msgid "write" msgstr "" -#: Main.module:3548 +#: Main.module:3565 msgid "This class acts like a &1 array." msgstr "" -#: Main.module:3548 +#: Main.module:3565 msgid "read-only" msgstr "" -#: Main.module:3554 +#: Main.module:3571 msgid "This class is &1 with the &2 keyword." msgstr "" -#: Main.module:3554 +#: Main.module:3571 msgid "enumerable" msgstr "" -#: Main.module:3558 +#: Main.module:3575 msgid "This class can be used as a &1." msgstr "" -#: Main.module:3558 +#: Main.module:3575 msgid "function" msgstr "" -#: Main.module:3570 +#: Main.module:3587 msgid "Static properties" msgstr "" -#: Main.module:3571 +#: Main.module:3588 msgid "Static methods" msgstr "" -#: Main.module:3573 +#: Main.module:3590 msgid "Constants" msgstr "" -#: Main.module:3590 +#: Main.module:3607 msgid "Properties" msgstr "" -#: Main.module:3591 +#: Main.module:3608 msgid "Methods" msgstr "" -#: Main.module:3592 +#: Main.module:3609 msgid "Events" msgstr "" -#: Main.module:4104 +#: Main.module:4121 msgid "Only in &1 version" msgstr "" -#: Main.module:4140 +#: Main.module:4157 msgid "There are &1 classes and &2 symbols in all Gambas components." msgstr "" diff --git a/app/src/doc.cgi/.project b/app/src/doc.cgi/.project index 9d48f48b1..d10422f35 100644 --- a/app/src/doc.cgi/.project +++ b/app/src/doc.cgi/.project @@ -1,5 +1,5 @@ # Gambas Project File 3.0 -# Compiled with Gambas 2.99.0 (r1796) +# Compiled with Gambas 2.99.0 (r1924) Title=Gambas documentation CGI script Startup=Main Stack=16 diff --git a/app/src/doc.cgi/Main.module b/app/src/doc.cgi/Main.module index 296baa089..acad539f4 100644 --- a/app/src/doc.cgi/Main.module +++ b/app/src/doc.cgi/Main.module @@ -1125,6 +1125,8 @@ Private Function Encode(sText As String) As String Next +BREAK_ALL: + While $aSection.Count LeaveSection() Wend @@ -1830,19 +1832,32 @@ Private Function MakePageWithoutHeader(rPage As Result) As String bPrint = False - If $iType = TYPE_SYMBOL And If $hSym Then - Print Encode("@syntax") - Print "

" - Endif - - Print Encode(rPage!sDesc) - - If $iType = TYPE_COMPONENT And If Not $cGotSpecial.Exist("classes") Then - Print "

" - Print Encode("@classes") - Else If $iType = TYPE_CLASS And If Not $cGotSpecial.Exist("symbols") Then - Print "

" - Print Encode("@symbols") + If $iType = TYPE_SYMBOL And If Not $hSym Then + Print "

"; Subst(("This symbol does not exist in version &1."), $sVersion); "

" + $cGotSpecial["syntax"] = True + Else If $iType = TYPE_CLASS And If Not $hClass Then + Print "

"; Subst(("This class does not exist in version &1."), $sVersion); "

" + $cGotSpecial["symbols"] = True + Else If $iType = TYPE_COMPONENT And If Not $hComp Then + Print "

"; Subst(("This component does not exist in version &1."), $sVersion); "

" + $cGotSpecial["classes"] = True + Else + + If $iType = TYPE_SYMBOL Then 'And If $hSym Then + Print Encode("@syntax") + Print "

" + Endif + + Print Encode(rPage!sDesc) + + If $iType = TYPE_COMPONENT And If Not $cGotSpecial.Exist("classes") Then + Print "

" + Print Encode("@classes") + Else If $iType = TYPE_CLASS And If Not $cGotSpecial.Exist("symbols") Then + Print "

" + Print Encode("@symbols") + Endif + Endif Output To Default @@ -3155,7 +3170,9 @@ Private Function GetClasses() As String 'hComp = CComponent.All[sComp] 'hComp.Load() - If Not $hComp Then Return "

" & Subst(("This component does not exist in version &1."), $sVersion) & "

" + If Not $hComp Then + Return "

" & Subst(("This component does not exist in version &1."), $sVersion) & "

" + Endif sRes = "
" & ("Classes") & "
\n" diff --git a/app/src/gambas3/CComponent.class b/app/src/gambas3/CComponent.class index d64c2ae06..e4e8b3b7a 100644 --- a/app/src/gambas3/CComponent.class +++ b/app/src/gambas3/CComponent.class @@ -67,7 +67,13 @@ Static Private Sub InitComponentNames() $cName["gb.corba"] = ("CORBA Client") $cName["gb.crypt"] = ("MD5/DES crypting") $cName["gb.db"] = ("Database access") + $cName["gb.db.firebird"] = ("Firebird database driver") $cName["gb.db.form"] = ("Data bound controls") + $cName["gb.db.mysql"] = ("MySQL database driver") + $cName["gb.db.odbc"] = ("ODBC database driver") + $cName["gb.db.postgresql"] = ("PostgreSQL database driver") + $cName["gb.db.sqlite2"] = ("SQLite 2 database driver") + $cName["gb.db.sqlite3"] = ("SQLite 3 database driver") $cName["gb.debug"] = ("Application debugger helper") $cName["gb.desktop"] = ("Desktop-neutral routines from Portland project") $cName["gb.eval"] = ("Expression evaluator") diff --git a/app/src/gambas3/CModule.class b/app/src/gambas3/CModule.class new file mode 100644 index 000000000..786fd497a --- /dev/null +++ b/app/src/gambas3/CModule.class @@ -0,0 +1,63 @@ +' Gambas class file + +Static Public All As Collection + +Public Key As String +Public Name As String +Public NamePlural As String +Public NameFilter As String +Public TreeKey As String +Public Component As String +Public Used As Boolean +Public HasFormEditor As Boolean + +Static Public Sub _init() + + Dim hModule As CModule + + All = New Collection(gb.IgnoreCase) + + hModule = New CModule("form", ("Form"), ("Forms"), ("Gambas forms"), "$F", True) + hModule = New CModule("webpage", ("WebPage"), ("WebPages"), ("Gambas web pages"), "$A", False) + +End + +Static Public Sub _get(sKey As String) As CModule + + Return All[sKey] + +End + +Public Sub _new(sKey As String, sName As String, sNamePlural As String, sNameFilter As String, sTreeKey As String, bHasFormEditor As Boolean) + + Key = sKey + Name = sName + NamePlural = sNamePlural + NameFilter = sNameFilter + TreeKey = sTreeKey + HasFormEditor = bHasFormEditor + All[sKey] = Me + +End + +Static Public Sub InitFromProject() + + Dim hModule As CModule + Dim sComp As String + + For Each hModule In All + hModule.Component = "" + hModule.Used = False + Next + + For Each sComp In Project.Libraries + With CComponent.All[sComp] + If .Type Then + All[.Type].Component = sComp + All[.Type].Used = True + Endif + End With + Next + +End + diff --git a/app/src/gambas3/FCreateFile.class b/app/src/gambas3/FCreateFile.class index 761ae57eb..3d978f100 100644 --- a/app/src/gambas3/FCreateFile.class +++ b/app/src/gambas3/FCreateFile.class @@ -58,14 +58,32 @@ Public Sub Form_Open() Dim hCtrl As Control Dim sParent As String + Dim hModule As CModule + Dim aFilter As String[] + Dim hPanel As Container $bDoNotSetName = False Settings.Read(Me) - fchExisting.Filter = ["*.module", ("Gambas modules"), "*.class", ("Gambas classes"), "*.form", ("Gambas forms"), "*.png;*.jpg;*.jpeg;*.xpm;*.gif", ("Picture files"), "*.htm;*.html", ("HTML files")] + aFilter = ["*.module", ("Gambas modules"), "*.class", ("Gambas classes")] - panForm.Visible = Project.AllowForm() + For Each hModule In CModule.All + + aFilter.Add("*." & hModule.Key) + aFilter.Add(hModule.NameFilter) + + Next + + aFilter.Insert(["*.png;*.jpg;*.jpeg;*.xpm;*.gif", ("Picture files"), "*.htm;*.html", ("HTML files")]) + + fchExisting.Filter = aFilter + + For Each hPanel In lstType.Children + If Not hPanel.Tag Then Continue + If Not CModule.All.Exist(hPanel.Tag) Then Continue + hPanel.Visible = CModule[hPanel.Tag].Used + Next If Not $sType Then $sType = "module" For Each hCtrl In lstType.Children @@ -243,6 +261,10 @@ Private Sub CreateFile() As Boolean Project.Insert(sName, "form", sTemp) + Case "webpage" + + Project.Insert(sName, "webpage", "\n\n<%\nPrint \"

Gambas

\";\n%>\n\n\n") + Case "text" File.Save($sDir &/ sName, "") @@ -250,7 +272,7 @@ Private Sub CreateFile() As Boolean Case "html" - File.Save($sDir &/ sName, "\n\n\n") + File.Save($sDir &/ sName, "\n\n\n\n") Project.InsertFile(sName, $sDir) Case "css" @@ -367,6 +389,10 @@ Private Sub ImportFile() As Boolean ImportDependencies(sName, sTemp, chkLink.Value) Project.OpenForm(sName) + Case "webpage" + sName = File.BaseName(Project.GetUniqueName(Project.Dir, sName)) + Project.Insert(sName, "webpage", sTemp,,, chkLink.Value) + Default sName = Project.GetUniqueName($sDir, sName) Project.InsertFile(sName, $sDir, sTemp,, chkLink.Value) diff --git a/app/src/gambas3/FCreateFile.form b/app/src/gambas3/FCreateFile.form index 9809a2159..2bf53473a 100644 --- a/app/src/gambas3/FCreateFile.form +++ b/app/src/gambas3/FCreateFile.form @@ -1,7 +1,7 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,79,66) + MoveScaled(0,0,92,74) Text = ("New file") Icon = Picture["icon:/small/new"] Persistent = True @@ -9,7 +9,7 @@ Spacing = True Padding = 8 { tabFile TabStrip - MoveScaled(1,1,76,58) + MoveScaled(1,1,80,63) Expand = True Arrangement = Arrange.Vertical Spacing = True @@ -18,11 +18,11 @@ Index = 0 Text = ("New") { HBox3 HBox - MoveScaled(1,1,72,51) + MoveScaled(1,1,77,56) Expand = True Spacing = True { lstType ListContainer - MoveScaled(1,1,27,47) + MoveScaled(1,1,32,52) { panModule HBox MoveScaled(0,0,39,6) Tag = "module" @@ -35,7 +35,7 @@ Alignment = Align.Center } { Label6 Label - MoveScaled(8,1,25,4) + MoveScaled(7,1,25,4) Text = ("Module") } } @@ -71,8 +71,24 @@ Text = ("Form") } } + { panWebPage HBox + MoveScaled(0,18,39,6) + Tag = "webpage" + Spacing = True + Padding = 8 + { PictureBox8 PictureBox + MoveScaled(1,1,4,4) + Picture = Picture["icon:/48/html"] + Stretch = True + Alignment = Align.Center + } + { Label15 Label + MoveScaled(7,1,25,4) + Text = ("WebPage") + } + } { HBox5 HBox - MoveScaled(0,18,27,6) + MoveScaled(0,25,27,6) Tag = "image" Spacing = True Padding = 8 @@ -83,12 +99,12 @@ Alignment = Align.Center } { Label3 Label - MoveScaled(6,1,16,4) + MoveScaled(7,1,16,4) Text = ("Image") } } { HBox4 HBox - MoveScaled(0,24,39,6) + MoveScaled(0,31,39,6) Tag = "text" Spacing = True Padding = 8 @@ -104,7 +120,7 @@ } } { HBox7 HBox - MoveScaled(0,30,39,6) + MoveScaled(0,37,39,6) Tag = "html" Spacing = True Padding = 8 @@ -120,7 +136,7 @@ } } { HBox2 HBox - MoveScaled(0,37,39,6) + MoveScaled(0,44,39,6) Tag = "css" Spacing = True Padding = 8 @@ -137,7 +153,7 @@ } } { panOption VBox - MoveScaled(29,1,42,48) + MoveScaled(34,1,42,52) Expand = True Spacing = True { Label9 Label @@ -256,7 +272,7 @@ Index = 0 } { HBox6 HBox - MoveScaled(11,60,60,4) + MoveScaled(11,67,60,4) Spacing = True { Panel1 Panel MoveScaled(11,0,4,4) diff --git a/app/src/gambas3/FFind.class b/app/src/gambas3/FFind.class index 0f31caa27..9b3ad0d31 100644 --- a/app/src/gambas3/FFind.class +++ b/app/src/gambas3/FFind.class @@ -19,7 +19,7 @@ Private $iLastTimeStamp As Integer Private $sLastSearch As String Private $bStop As Boolean Private $bCanceled As Boolean -Private $iWait As Integer +'Private $iWait As Integer Public Sub Find(Optional bReplace As Boolean) @@ -294,7 +294,9 @@ Private Sub DoSearch(bBack As Boolean, bReplace As Boolean) As Boolean Dim sLine As String Dim iPos As Integer Dim sNext As String + Dim eLast As Float + eLast = Timer $bStop = False $bCanceled = False @@ -491,8 +493,12 @@ Private Sub DoSearch(bBack As Boolean, bReplace As Boolean) As Boolean Endif If $bList Then - Inc $iWait - If ($iWait And 63) = 0 Then Wait 0.01 + If (Timer - eLast) > 0.1 Then + eLast += 0.1 + Wait 0.01 + Endif + 'Inc $iWait + 'If ($iWait And 255) = 0 Then Wait 0.01 Endif Loop diff --git a/app/src/gambas3/FMain.class b/app/src/gambas3/FMain.class index bcf276341..e581f7d74 100644 --- a/app/src/gambas3/FMain.class +++ b/app/src/gambas3/FMain.class @@ -273,6 +273,7 @@ Public Sub mnuPopup_Show() Dim bCurrent As Boolean Dim bFile As Boolean Dim bCanStoreFile As Boolean + Dim hMenu As Menu sCurrent = GetCurrent() bCurrent = sCurrent @@ -316,7 +317,12 @@ Public Sub mnuPopup_Show() mnuAddDirectory.Visible = (sCurrent And Not Project.IsClassPath(sCurrent)) Or bCanStoreFile mnuNewFile.Visible = mnuAddDirectory.Visible mnuNewImage.Visible = mnuAddDirectory.Visible - mnuNewForm.Visible = Project.AllowForm() + + For Each hMenu In mnuNew.Children + If Not hMenu.Tag Then Continue + If Not CModule.All.Exist(hMenu.Tag) Then Continue + hMenu.Visible = CModule[hMenu.Tag].Used + Next End diff --git a/app/src/gambas3/FMain.form b/app/src/gambas3/FMain.form index 16f1eefc3..62554faf4 100644 --- a/app/src/gambas3/FMain.form +++ b/app/src/gambas3/FMain.form @@ -1,7 +1,7 @@ # Gambas Form File 3.0 { Form Form - MoveScaled(0,0,140,86) + MoveScaled(0,0,134,86) Text = ("") Icon = Picture["img/logo/new-logo-32.png"] Arrangement = Arrange.Vertical @@ -321,7 +321,7 @@ Text = ("Popup") Enabled = False Visible = False - { Menu17 Menu + { mnuNew Menu Text = ("New") { mnuAddDirectory Menu Action = "new-directory" @@ -352,6 +352,12 @@ Picture = Picture["img/16/form.png"] Tag = "form" } + { mnuNewWebPage Menu mnuNewFile + Name = "mnuNewWebPage" + Action = "new-webpage" + Text = ("&WebPage...") + Tag = "webpage" + } { Menu18 Menu Text = ("") } @@ -452,11 +458,11 @@ } } { panToolbar Panel - MoveScaled(0,0,139,4) + MoveScaled(0,0,129,4) Arrangement = Arrange.Row AutoResize = True { ToolBar1 ToolBar - MoveScaled(0,0,136,4) + MoveScaled(0,0,129,4) Expand = True Key = "main" Text = ("") @@ -943,6 +949,10 @@ Shortcut = "Ctrl+N" Picture = "icon:/small/new" } + { Action new-webpage + Text = "&WebPage..." + Shortcut = "" + } { Action open-project Text = "&Open project..." Shortcut = "Ctrl+O" diff --git a/app/src/gambas3/FOption.class b/app/src/gambas3/FOption.class index 6b850bab5..ef3e1894b 100644 --- a/app/src/gambas3/FOption.class +++ b/app/src/gambas3/FOption.class @@ -51,7 +51,7 @@ Public Sub _new() Dim hColor As DrawingArea Dim hButton As Button - cmbTheme.List = $aThemeName.Copy().Sort(gb.Language) + cmbTheme.List = $aThemeName.Copy().Sort(gb.UseLanguage) cmbTheme.Add(("Select a theme"), 0) cmbIconTheme.List = [("Desktop"), "Gnome", "KDE", "KDE4"] cmbBrowser.List = [("(Default)"), "Konqueror", "Firefox", "Epiphany", "SeaMonkey", "Opera"] diff --git a/app/src/gambas3/FTextEditor.class b/app/src/gambas3/FTextEditor.class index 490f0f70c..6ee8c7033 100644 --- a/app/src/gambas3/FTextEditor.class +++ b/app/src/gambas3/FTextEditor.class @@ -5,10 +5,11 @@ Public Editor As Editor Property Read ReadOnly As Boolean -Static Private $aExt As String[] = ["htm", "html", "xml", "svg", "css"] +Static Private $aExt As String[] = ["htm", "html", "xml", "svg", "css", "webpage"] Private Const STYLE_HTML As Integer = 1 Private Const STYLE_CSS As Integer = 2 +Private Const STYLE_WEB As Integer = 3 Private Const TAG_HTML As Integer = 0 Private Const TAG_CODE As Integer = 1 @@ -46,6 +47,8 @@ Public Sub LoadFile() Select Case sExt Case "css" $iStyle = STYLE_CSS + Case "webpage" + $iStyle = STYLE_WEB Case Else $iStyle = STYLE_HTML End Select @@ -436,7 +439,7 @@ Public Sub Editors_Highlight() Select Case $iStyle - Case STYLE_HTML + Case STYLE_HTML, STYLE_WEB If iTag = TAG_HTML Then bMarkup = iState = Highlight.Keyword @@ -502,7 +505,7 @@ Public Sub Editors_Highlight() Else If String.Mid$(sText, iInd, 9) = " 16 Then sIcon = "img/32" &/ sExt & ".png" @@ -734,7 +744,6 @@ End Private Sub AddFile(sDir As String, sFile As String, Optional bAfter As Boolean, Optional bIgnoreInheritance As Boolean) As Boolean - Dim bAllowForm As Boolean Dim bIgnore As Boolean Dim sPath As String Dim sKey As String @@ -747,9 +756,8 @@ Private Sub AddFile(sDir As String, sFile As String, Optional bAfter As Boolean, Dim bDir As Boolean Dim sAfter As String Dim hForm As Object + Dim hModule As CModule - bAllowForm = AllowForm() - sPath = sDir &/ sFile sKey = sPath sParent = sDir @@ -784,45 +792,44 @@ Private Sub AddFile(sDir As String, sFile As String, Optional bAfter As Boolean, If sDir = Project.Dir Then - Select Case sExt + If sExt = "module" Or If sExt = "class" Or If CModule.All.Exist(sExt) Then - Case "form", "class", "module" + 'sIcon = IMAGE_DIR &/ sExt & ".png" + bShow = True + bChecked = True - 'sIcon = IMAGE_DIR &/ sExt & ".png" - bShow = True - bChecked = True - - If sExt = "form" Then - sParent = KEY_FORM - If Not bAllowForm Then bIgnore = True - Else If sExt = "class" Then - sParent = "" - If Exist(sDir &/ File.BaseName(sFile) & ".form") Then - bIgnore = True - Else - 'IF sFile = "ReportContainer.class" THEN STOP - sParent = FindKey(GetParentClass(sPath)) - If sParent Then - If File.Ext(sParent) <> "class" Then + If sExt = "class" Then + sParent = "" + If Exist(sDir &/ File.BaseName(sFile) & ".form") Then + bIgnore = True + Else + 'IF sFile = "ReportContainer.class" THEN STOP + sParent = FindKey(GetParentClass(sPath)) + If sParent Then + If File.Ext(sParent) <> "class" Then + sParent = "" + Else If Not ProjectTree.Exist(sParent) Then + If Not bIgnoreInheritance Then + $aRefreshAfter.Add(sPath) + bIgnore = True + Else sParent = "" - Else If Not ProjectTree.Exist(sParent) Then - If Not bIgnoreInheritance Then - $aRefreshAfter.Add(sPath) - bIgnore = True - Else - sParent = "" - Endif Endif Endif Endif - If Not sParent Then sParent = KEY_CLASS - Else If sExt = "module" Then - sParent = KEY_MODULE Endif - - sFile = File.BaseName(sFile) - - End Select + If Not sParent Then sParent = KEY_CLASS + Else If sExt = "module" Then + sParent = KEY_MODULE + Else + hModule = CModule[sExt] + sParent = hModule.TreeKey + If Not hModule.Used Then bIgnore = True + Endif + + sFile = File.BaseName(sFile) + + Endif Endif @@ -1047,6 +1054,7 @@ Private Sub DoRefresh(Optional bReset As Boolean) Dim sTitle As String Dim hFile As Object Dim sPath As String + Dim hModule As CModule '$bDisplayForm = Settings["/DisplayForm"] @@ -1066,9 +1074,13 @@ Private Sub DoRefresh(Optional bReset As Boolean) .Add(KEY_PROJECT, ("Project"), Picture["icon:/small/directory"], sKey) .Add(KEY_MODULE, ("Modules"), Picture["icon:/small/directory"], sKey) .Add(KEY_CLASS, ("Classes"), Picture["icon:/small/directory"], sKey) - If AllowForm() Then - .Add(KEY_FORM, ("Forms"), Picture["icon:/small/directory"], sKey) - Endif + + For Each hModule In CModule.All + If hModule.Used Then + .Add(hModule.TreeKey, hModule.NamePlural, Picture["icon:/small/directory"], sKey) + Endif + Next + .Add(KEY_MISC, ("Data"), Picture["icon:/small/directory"], sKey) '$bGetSource = TRUE @@ -1092,7 +1104,8 @@ Private Sub DoRefresh(Optional bReset As Boolean) DefineStartup(Startup, True) - If Not AllowForm() Then + ' $$ TODO + If Not HasModule("form") Then For Each hFile In Files sPath = Files.Key If Not IsClassPath(sPath) Then Continue @@ -1187,7 +1200,7 @@ Public Function LoadFile(sPath As String) As Object hForm = New FEditor(sPath) Case "form" - If AllowForm() Then + If HasModule("form") Then hForm = New FForm(sPath) Endif @@ -1904,7 +1917,7 @@ Public Sub Activate(hForm As Object) sType = Object.Type(ActiveForm) - FMain.ShowTool(sType = "FForm" Or ShowAlwaysProperty) + FMain.ShowTool(sType = "FForm") 'Or ShowAlwaysProperty) Endif @@ -3322,19 +3335,12 @@ Public Sub RefreshLibrary(Optional bForce As Boolean) CComponent.Reset - ComponentFromType.Clear - FormType.Clear - For Each sLib In Libraries - 'IF NOT CComponent.All.Exist(sLib) THEN CONTINUE - With CComponent.All[sLib] - .Load - If .Type Then - ComponentFromType[.Type] = sLib - Endif - End With + CComponent.All[sLib].Load Next + CModule.InitFromProject() + FToolBox.RefreshToolbar(bForce) FCompletion.RefreshLibrary FProperty.RefreshAll @@ -3639,10 +3645,10 @@ Public Sub ResetScan() End -Public Function AllowForm() As Boolean - - Return ComponentFromType.Exist("Form") - +Public Function HasModule(sType As String) As Boolean + + Return CModule[sType].Used + End @@ -4045,8 +4051,6 @@ Public Sub SavePosition() Dim hEditor As FEditor Dim sPos As String - If $bDoNotSavePosition Then Return - Try hEditor = ActiveForm If Error Then Return diff --git a/app/src/gambas3/img/module/class.png b/app/src/gambas3/img/module/class.png new file mode 100644 index 0000000000000000000000000000000000000000..dc1b155d779ea00d05cf1ce8d853c5f6badf3815 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy3m2~z+gpz4wLqbMPZ!6Kh{JEM z7;-ro@-#erUn$`jQ1G#CZ@c&hmR%Jbb4#y3we0L}(i64Pa$4H|C)&xA>926pg2ZJJ z4_nx))?}N;KWI~bcjNJl$67hXo4M6o>*BH-vgHzfW-km}&9ra-g5x_*od2i#kgt7~ z(6sCdy=w)+*H>EZ@|RyWWuKVN(kr~*_*$4BI#>wsu^cR@V3di{czYl_BMj&?22WQ% Jmvv4FO#oz7U}XRR literal 0 HcmV?d00001 diff --git a/app/src/gambas3/img/module/form.png b/app/src/gambas3/img/module/form.png new file mode 100644 index 0000000000000000000000000000000000000000..316f84a030b915f6fd17e491c7d86ed8940df23a GIT binary patch literal 436 zcmV;l0ZaagP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ) z4K5)pZY#n700A^fL_t(o!|j&APQpMChW`<0qfmqpO-x zU_#(PU2SnoQ#)J?A*H%aEcW2e>Cf(;%$Lm0&JZ)B&NxENVE}3eXyy-yr~%--=?JTh3WJG^Z5*;(G9xYz81jq9=HA|df(HN$z8cO0040uqt!ZrWwnuI zfRwLVfL(u)w(aBc07@yWRuMWK2U5z?b>8*owNk1)fDkUmyMf(jt%q5`HHFn1*s>=&ojl_(rO3C>>g0n-(QN;tmj~xB|6fyI z%i?%pj@5iiF^h){l2s9p=G@(KmLdGjXLtYY2l?Mkcif|=L{Jc7&s1ZXskc) o%;ul9VCJ@;Iq~m-3Xp*(pTibr+wI$?Sb#)5UHx3vIVCg!0J7>CMF0Q* literal 0 HcmV?d00001 diff --git a/comp/src/gb.web/.component b/comp/src/gb.web/.component index 72ed8f570..6c878bf16 100644 --- a/comp/src/gb.web/.component +++ b/comp/src/gb.web/.component @@ -1,4 +1,6 @@ [Component] Key=gb.web +Version=2.99.0 Authors=Benoît Minisini +Type=WebPage diff --git a/comp/src/gb.web/.info b/comp/src/gb.web/.info index bcd75de18..2265ce2fe 100644 --- a/comp/src/gb.web/.info +++ b/comp/src/gb.web/.info @@ -196,3 +196,6 @@ Load M +#WebPage + +C diff --git a/comp/src/gb.web/.list b/comp/src/gb.web/.list index b4177bf71..c83e75f25 100644 --- a/comp/src/gb.web/.list +++ b/comp/src/gb.web/.list @@ -4,3 +4,4 @@ JSON Request Response Session +WebPage diff --git a/comp/src/gb.web/WebPage.class b/comp/src/gb.web/WebPage.class new file mode 100644 index 000000000..b22223d21 --- /dev/null +++ b/comp/src/gb.web/WebPage.class @@ -0,0 +1,3 @@ +' Gambas class file + +Export diff --git a/gb.db.firebird/component.am b/gb.db.firebird/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.db.firebird/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.db.firebird/src/Makefile.am b/gb.db.firebird/src/Makefile.am index 329d777ed..61321838b 100644 --- a/gb.db.firebird/src/Makefile.am +++ b/gb.db.firebird/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.firebird +include $(top_srcdir)/component.am + ##INCLUDES = -I./ibpp -I./ibpp/fbheaders INCLUDES = -I./ibpp/core EXTRA_DIST = ibpp diff --git a/gb.db.mysql/src/Makefile.am b/gb.db.mysql/src/Makefile.am index 6e320711d..50ffef9fc 100755 --- a/gb.db.mysql/src/Makefile.am +++ b/gb.db.mysql/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.mysql +include $(top_srcdir)/component.am + INCLUDES = @MYSQL_INC@ gblib_LTLIBRARIES = gb.db.mysql.la diff --git a/gb.db.mysql/src/gb.db.mysql.component b/gb.db.mysql/src/gb.db.mysql.component new file mode 100644 index 000000000..19cff9bc3 --- /dev/null +++ b/gb.db.mysql/src/gb.db.mysql.component @@ -0,0 +1,5 @@ +[Component] +Key=gb.db.mysql +Author=Nigel Gerrard,Benoît Minisini +State=0 +Require=gb.db diff --git a/gb.db.odbc/component.am b/gb.db.odbc/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.db.odbc/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.db.odbc/src/Makefile.am b/gb.db.odbc/src/Makefile.am index 7b4ead241..f286d2f60 100644 --- a/gb.db.odbc/src/Makefile.am +++ b/gb.db.odbc/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.odbc +include $(top_srcdir)/component.am + INCLUDES = @ODBC_INC@ gblib_LTLIBRARIES = gb.db.odbc.la diff --git a/gb.db.postgresql/component.am b/gb.db.postgresql/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.db.postgresql/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.db.postgresql/src/Makefile.am b/gb.db.postgresql/src/Makefile.am index 6002ea653..7d969cc58 100644 --- a/gb.db.postgresql/src/Makefile.am +++ b/gb.db.postgresql/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.postgresql +include $(top_srcdir)/component.am + INCLUDES = @POSTGRESQL_INC@ gblib_LTLIBRARIES = gb.db.postgresql.la diff --git a/gb.db.sqlite2/component.am b/gb.db.sqlite2/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.db.sqlite2/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.db.sqlite2/src/Makefile.am b/gb.db.sqlite2/src/Makefile.am index efc5908bb..d1be2ed54 100755 --- a/gb.db.sqlite2/src/Makefile.am +++ b/gb.db.sqlite2/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.sqlite2 +include $(top_srcdir)/component.am + INCLUDES = @SQLITE2_INC@ gblib_LTLIBRARIES = gb.db.sqlite2.la diff --git a/gb.db.sqlite3/component.am b/gb.db.sqlite3/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.db.sqlite3/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.db.sqlite3/src/Makefile.am b/gb.db.sqlite3/src/Makefile.am index 9dfeb14cc..d002c4428 100755 --- a/gb.db.sqlite3/src/Makefile.am +++ b/gb.db.sqlite3/src/Makefile.am @@ -1,3 +1,6 @@ +COMPONENT = gb.db.sqlite3 +include $(top_srcdir)/component.am + INCLUDES = @SQLITE3_INC@ gblib_LTLIBRARIES = gb.db.sqlite3.la diff --git a/gb.qt.kde/src/gb.qt.kde.component b/gb.qt.kde/src/gb.qt.kde.component index 243f7e110..0cd748a56 100644 --- a/gb.qt.kde/src/gb.qt.kde.component +++ b/gb.qt.kde/src/gb.qt.kde.component @@ -1,10 +1,5 @@ [Component] Key=gb.qt.kde -Name=KDE integration and scripting -Name[fr]=Intégration et scriptage de KDE -Name[pl]=Integracja z KDE -Name[es]=Integración y scripting de KDE -Name[tr]=KDE entegrasyonu Author=Benoît Minisini Type=Form Require=gb.qt diff --git a/main/gbx/gbx_c_gambas.c b/main/gbx/gbx_c_gambas.c index 994307efa..93a4e0916 100644 --- a/main/gbx/gbx_c_gambas.c +++ b/main/gbx/gbx_c_gambas.c @@ -214,7 +214,9 @@ GB_DESC NATIVE_Gambas[] = GB_CONSTANT("Binary", "i", GB_COMP_BINARY), GB_CONSTANT("Text", "i", GB_COMP_TEXT), GB_CONSTANT("Case", "i", GB_COMP_TEXT), + GB_CONSTANT("IgnoreCase", "i", GB_COMP_TEXT), GB_CONSTANT("Language", "i", GB_COMP_LANG), + GB_CONSTANT("UseLanguage", "i", GB_COMP_LANG), GB_CONSTANT("Ascent", "i", GB_COMP_ASCENT), GB_CONSTANT("Descent", "i", GB_COMP_DESCENT),