From jredrejo at ...101... Thu Sep 1 17:08:18 2005 From: jredrejo at ...101... (=?ISO-8859-1?Q?Jos=E9?= L. Redrejo =?ISO-8859-1?Q?Rodr=EDguez?=) Date: Thu, 01 Sep 2005 17:08:18 +0200 Subject: [Gambas-devel] Timer in console application Message-ID: <1125587298.6575.10.camel@...102...> Does anyone have an example of using a timer without the qt/gtk interface?. I need to use it in a console application, and Beno?t said it was a new feature of the 1.9.18 version, but I haven't found the way to make it work. From gambas at ...1... Thu Sep 1 20:06:46 2005 From: gambas at ...1... (Benoit Minisini) Date: Thu, 1 Sep 2005 20:06:46 +0200 Subject: [Gambas-devel] Timer in console application In-Reply-To: <1125587298.6575.10.camel@...102...> References: <1125587298.6575.10.camel@...102...> Message-ID: <200509012006.46390.gambas@...1...> On Thursday 01 September 2005 17:08, Jos? L. Redrejo Rodr?guez wrote: > Does anyone have an example of using a timer without the qt/gtk > interface?. > I need to use it in a console application, and Beno?t said it was a new > feature of the 1.9.18 version, but I haven't found the way to make it > work. > > It works exactly the same way as before :-) PRIVATE MyTimer AS Timer ... MyTimer = NEW Timer AS "MyTimer" MyTimer.Delay = 500 MyTimer.Enabled = TRUE Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Thu Sep 1 21:01:38 2005 From: gambas at ...1... (Benoit Minisini) Date: Thu, 1 Sep 2005 21:01:38 +0200 Subject: [Gambas-devel] Release of gambas 1.0.11 and 1.9.19 Message-ID: <200509012101.39115.gambas@...1...> Hi everybody! Here is a simultaneous release of stable and development versions :-) Here are the main changes: In the 1.0.11 stable version: * A new swedish translation made by Peter Landgren. * Some bug fixes in the QT component. In the 1.9.19 development version: * A insignificant and incomplete example of what could be the interface of the next development environment. * A new instruction, SCAN, to match a string against a pattern. * A new container, SidePanel. * Many bug fixes in the QT component, the Editor control, and the KDE component among other things. WARNING! Bytecode has changed, so you will be warned to recompile your projects... Don't forget to read the change logs... Now some news about me: I will move to a new cupboard^W^H flat in Paris in the next days, and I won't be connected to Internet from 5 Sep, and for an unknown period of time. I will see if I can use sometimes the connection of a friend, but you may have to manage yourself :-) Regards, -- Benoit Minisini mailto:gambas at ...1... From jredrejo at ...101... Thu Sep 1 22:13:03 2005 From: jredrejo at ...101... (=?ISO-8859-1?Q?Jos=E9?= L. Redrejo =?ISO-8859-1?Q?Rodr=EDguez?=) Date: Thu, 01 Sep 2005 22:13:03 +0200 Subject: [Gambas-devel] Release of gambas 1.0.11 and 1.9.19 In-Reply-To: <200509012101.39115.gambas@...1...> References: <200509012101.39115.gambas@...1...> Message-ID: <1125605583.6534.2.camel@...102...> El jue, 01-09-2005 a las 21:01 +0200, Benoit Minisini escribi?: > Hi everybody! > > Here is a simultaneous release of stable and development versions :-) > > Here are the main changes: > > In the 1.0.11 stable version: > * A new swedish translation made by Peter Landgren. > * Some bug fixes in the QT component. > > In the 1.9.19 development version: > * A insignificant and incomplete example of what could be the interface of the > next development environment. > * A new instruction, SCAN, to match a string against a pattern. > * A new container, SidePanel. > * Many bug fixes in the QT component, the Editor control, and the KDE > component among other things. > > WARNING! Bytecode has changed, so you will be warned to recompile your > projects... > > Don't forget to read the change logs... > > Now some news about me: I will move to a new cupboard^W^H flat in Paris in the > next days, and I won't be connected to Internet from 5 Sep, and for an > unknown period of time. > oooh, does it mean that I won't have to recompile my projects for, let's say, 15 days? I don't know if I will be able to survive. P.S. Please, Beno?t, go on with your great work, but don't change bytecode so often....., snif From gambasfr at ...4... Thu Sep 1 22:31:51 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Thu, 1 Sep 2005 22:31:51 +0200 Subject: [Gambas-devel] Timer in console application In-Reply-To: <1125587298.6575.10.camel@...102...> References: <1125587298.6575.10.camel@...102...> Message-ID: <200509012231.51354.gambasfr@...4...> Le Jeudi 01 Septembre 2005 17:08, Jos? L. Redrejo Rodr?guez a ?crit?: > Does anyone have an example of using a timer without the qt/gtk > interface?. > I need to use it in a console application, and Beno?t said it was a new > feature of the 1.9.18 version, but I haven't found the way to make it > work. > > simply by : Private tmrTest as timer PUBLIC SUB _New() tmrTest = NEW Timer() AS "tmrTest" tmrTest.Delay = 1000 tmrTest.Enabled = TRUE END PUBLIC SUB tmrTest_Timer() Print "Hello you ;-)" END Regards, Fabien Bodard From gambasfr at ...4... Thu Sep 1 23:26:51 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Thu, 1 Sep 2005 23:26:51 +0200 Subject: [Gambas-devel] Release of gambas 1.0.11 and 1.9.19 In-Reply-To: <200509012101.39115.gambas@...1...> References: <200509012101.39115.gambas@...1...> Message-ID: <200509012326.51397.gambasfr@...4...> Le Jeudi 01 Septembre 2005 21:01, Benoit Minisini a ?crit?: I ve a bug in the gambas ide ... in FEditor... the application crash I look for it... Fabien From gambasfr at ...4... Fri Sep 2 00:11:35 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Fri, 2 Sep 2005 00:11:35 +0200 Subject: [Gambas-devel] BIG BUG in gb 1.9.19 Message-ID: <200509020011.35450.gambasfr@...4...> Hi, this is the soluce :) for that : This application has raised an unexpected error and must abord [2]Cannot load class 'FEditor': unable to load class file. FOption._init.13 Replace in gambas2-1.9.19/app/src/gambas2 the file FEditor.class By the one put in attachement Regards, Fabien Bodard Benoit, when you create a new KeyWord... (Scan) Make a seach in your old code to know if you don't use it ! ;-) It's a jock but it's the real cause of the error You make a really good job ! Regards, Fabien Bodard -------------- next part -------------- A non-text attachment was scrubbed... Name: FEditor.class Type: application/x-java Size: 36490 bytes Desc: not available URL: From gambasfr at ...4... Fri Sep 2 00:22:29 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Fri, 2 Sep 2005 00:22:29 +0200 Subject: [Gambas-devel] Gambas2-1.9.19 Link Message-ID: <200509020022.29166.gambasfr@...4...> This is a link to Gambas2-1.9.19 http://prdownloads.sf.net/gambas/gambas2-1.9.19.tar.bz2?download Fabien Bodard From danielcampos at ...45... Fri Sep 2 12:38:29 2005 From: danielcampos at ...45... (danielcampos at ...45...) Date: Fri, 2 Sep 2005 12:38:29 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 Message-ID: Hi all: I recommend to not use Gambas-1.9.19, the IDE is absolutely broken, even using Fabien's patch. Keep Gambas-1.9.18 in safe place! I think it is moment to stop that run to nowhere at full speed, and leave time to fix all that is done in developement version. It is full of bugs, and each time it is more difficult to collaborate in the project with that continous changes without having any tool like cvs or subversion. No way to continue improving things in that way, I can not guess every time what will be the next change that will break all! :-(( Regards, Daniel Campos ------------------------------------------------------------- NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Web/Wap : www.netcourrier.com T?l?phone/Fax : 08 92 69 00 21 (0,34 ? TTC/min) Minitel: 3615 NETCOURRIER (0,16 ? TTC/min) From jredrejo at ...101... Fri Sep 2 13:53:27 2005 From: jredrejo at ...101... (jredrejo at ...101...) Date: Fri, 2 Sep 2005 13:53:27 CEST Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 Message-ID: <20050902115327.CAED6344272@...337...> The attached file has to be replaced too. It fixes a bug when clicking the btnGoto in the IDE. Beno?t has used the Scan variable in a good part of the IDE and now it has a lot of conflicts with the new scan instruction. Danielcampos at ...45... wrote : > Hi all: > > I recommend to not use Gambas-1.9.19, the IDE is absolutely broken, even using > Fabien's patch. Keep Gambas-1.9.18 in safe place! > > I think it is moment to stop that run to nowhere at full speed, and leave time > to fix all that is done in developement version. It is full of bugs, and each > time it is more difficult to collaborate in the project with that continous > changes without having any tool like cvs or subversion. No way to continue > improving things in that way, I can not guess every time what will be the next > change that will break all! :-(( > > > Regards, > > Daniel Campos > > ------------------------------------------------------------- > NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, > Toolbar... > Web/Wap : www.netcourrier.com > T?l?phone/Fax : 08 92 69 00 21 (0,34 ? TTC/min) > Minitel: 3615 NETCOURRIER (0,16 ? TTC/min) > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing > & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel ____________________________________________ Servicio WebMail de CiberUNED http://www.uned.es -------------- next part -------------- A non-text attachment was scrubbed... Name: CComponent.class Type: application/x-java Size: 12441 bytes Desc: not available URL: From jredrejo at ...101... Fri Sep 2 16:31:03 2005 From: jredrejo at ...101... (=?ISO-8859-1?Q?Jos=E9?= L. Redrejo =?ISO-8859-1?Q?Rodr=EDguez?=) Date: Fri, 02 Sep 2005 16:31:03 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <20050902115327.CAED6344272@...337...> References: <20050902115327.CAED6344272@...337...> Message-ID: <1125671463.7481.3.camel@...102...> After checking all the "Scan" appearances in the IDE, these are the four files that have to be replaced in the gambas2 dir, instead of those contained in the 1.9.19 sources tree. I haven't found any bug else with these modifications. Regards. El vie, 02-09-2005 a las 13:53 +0000, jredrejo at ...101... escribi?: > The attached file has to be replaced too. It fixes a bug when clicking the btnGoto in the IDE. > Beno?t has used the Scan variable in a good part of the IDE and now it has a lot of conflicts with the new scan instruction. > > Danielcampos at ...45... wrote : > > > Hi all: > > > > I recommend to not use Gambas-1.9.19, the IDE is absolutely broken, even using > > Fabien's patch. Keep Gambas-1.9.18 in safe place! > > > > I think it is moment to stop that run to nowhere at full speed, and leave time > > to fix all that is done in developement version. It is full of bugs, and each > > time it is more difficult to collaborate in the project with that continous > > changes without having any tool like cvs or subversion. No way to continue > > improving things in that way, I can not guess every time what will be the next > > change that will break all! :-(( > > > > > > Regards, > > > > Daniel Campos > > > > ------------------------------------------------------------- > > NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, > > Toolbar... > > Web/Wap : www.netcourrier.com > > T?l?phone/Fax : 08 92 69 00 21 (0,34 ? TTC/min) > > Minitel: 3615 NETCOURRIER (0,16 ? TTC/min) > > > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing > > & QA > > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > > _______________________________________________ > > Gambas-devel mailing list > > Gambas-devel at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > ____________________________________________ > Servicio WebMail de CiberUNED http://www.uned.es -------------- next part -------------- A non-text attachment was scrubbed... Name: FForm.class Type: application/x-java Size: 33719 bytes Desc: not available URL: -------------- next part -------------- ' Gambas module file PUBLIC ProjectTree AS TreeView PUBLIC ProjectMessage AS Label PUBLIC ActiveForm AS Object PUBLIC Path AS String PUBLIC Name AS String PUBLIC Dir AS String PUBLIC ReadOnly AS Boolean PUBLIC Title AS String PUBLIC Startup AS String PUBLIC Libraries AS String[] PUBLIC Arguments AS String PUBLIC KeepDebugInfo AS Boolean PUBLIC ControlPublic AS Boolean PUBLIC MajorVersion AS Integer PUBLIC MinorVersion AS Integer PUBLIC ReleaseVersion AS Integer PUBLIC SnapToGrid AS Boolean PUBLIC ShowGrid AS Boolean PUBLIC Snap AS Integer PUBLIC Localize AS Boolean PUBLIC ComponentFromType AS Collection PUBLIC Description AS String PUBLIC Icon AS String PUBLIC Systems AS String[] PUBLIC Menus AS Collection PUBLIC Groups AS Collection PUBLIC Prefix AS Boolean PUBLIC TabSize AS Integer PUBLIC Version AS String PUBLIC ExecPath AS String PUBLIC TileGrid AS Picture PUBLIC Running AS Boolean PUBLIC Recent AS NEW String[] PRIVATE CONST MAX_RECENT AS Integer = 24 PUBLIC CONST FORM_MAGIC AS String = "# Gambas Form File 1.0" PUBLIC CONST PROJECT_MAGIC AS String = "# Gambas Project File 1.0" PUBLIC CONST DEFAULT_FONT AS String = "Monospace,10" PUBLIC Files AS NEW Collection PUBLIC AboutToQuit AS Boolean PUBLIC Positions AS NEW String[] PUBLIC CONST MAX_ICON_SIZE AS Integer = 2048 PUBLIC EXAMPLES_DIR AS String PUBLIC RPMBUILD_PROG AS String PRIVATE CONST IMAGE_DIR AS String = "img/16" PRIVATE CONST KEY_MODULE AS String = "$M" PRIVATE CONST KEY_CLASS AS String = "$C" PUBLIC CONST KEY_FORM AS String = "$F" PUBLIC CONST KEY_MISC AS String = "$O" PRIVATE CONST CLASS_AUTH_CAR AS String = "abcdefghijklmnopqrstuvwxyz0123456789" PRIVATE CONST FILE_AUTH_CAR AS String = "abcdefghijklmnopqrstuvwxyz0123456789-.+_" PRIVATE CONST PROJECT_FILE AS String = ".project" PRIVATE $bGetSource AS Boolean PRIVATE $bDisplayForm AS Boolean PRIVATE TMP_FILE AS String '= "/tmp/.gambas.ver" PRIVATE OUTPUT_FILE AS String '= "/tmp/.gambas.out" PRIVATE $sBrowser AS String PUBLIC SUB Main() DIM sPath AS String DIM hGambas AS FGambas TMP_FILE = Temp$() OUTPUT_FILE = Temp$() 'CLASSES_FILE = Temp$() EXAMPLES_DIR = System.Path &/ "share/gambas" & System.Version & "/examples" 'Config = NEW Config '(User.Home &/ ".gambas") Application.Tooltip.Enabled = Settings["/ShowTooltip", TRUE] 'Application.Font = Font["10"] InitVersion LoadRecent FMain.Load FGambas.Load 'FOutput.Load(Workspace) 'FDebug.Load(Workspace) 'FIconTool.Load(Workspace) 'FFormStack.Load(Workspace) 'FExplorer.Load(Workspace) IF Application.Args.Count >= 2 THEN sPath = Application.Args[1] ENDIF DO IF Not sPath THEN sPath = FWelcome.Run() 'sPath = User.Home &/ "gambas/test/gambas" IF sPath THEN Project.Open(sPath) ELSE FMain.Close RETURN ENDIF IF Project.Name THEN BREAK sPath = "" LOOP INC Application.Busy FProperty.Show FToolBox.Show 'FFormStack.Load IF Settings["/ShowMascot", TRUE] THEN FGambas.Show ENDIF FMain.UpdateRecentMenu FMain.Show DEC Application.Busy IF Settings["/ShowTipOnStartup", TRUE] THEN FTips.Run ENDIF END PRIVATE SUB InitVersion() DIM sVer AS String Version = "?" 'SHELL "gbx" & System.Version & " -V > " & TMP_FILE 'WAIT 'sVer = File.Load(TMP_FILE) 'KILL TMP_FILE SHELL "gbx" & System.Version & " -V" TO sVer Version = Trim(Mid$(sVer, InStr(sVer, "-") + 1)) END PUBLIC FUNCTION Open(sDir AS String) AS Boolean DIM sOldPath AS String DIM sOldName AS String sOldPath = Project.Path sOldName = Project.Name IF CloseProject() THEN RETURN TRUE IF Exist(sDir &/ ".lock") THEN IF Message.Warning(("BE CAREFUL! This project seems to be already opened.\n\nOpening the same project twice can crash the IDE\nand lead to data loss."), ("Open after all"), ("Do not open")) = 2 THEN RETURN TRUE ENDIF TRY KILL sDir &/ ".lock" ENDIF ReadOnly = NOT Access(sDir, gb.write) Path = sDir &/ PROJECT_FILE Name = File.Name(sDir) Project.Dir = sDir ReadProject Refresh AddRecent(sDir) FMain.OnProjectChange FFind.OnProjectChange 'FExplorer.ProjectChange FDebug.Clear TRY File.Save(sDir &/ ".lock", "") IF ReadOnly THEN Message.Warning(("This project is read-only.")) SetMessage(("OK")) RETURN CATCH IF Error.Text THEN Message.Error(("Cannot open project file :\n") & sDir & "\n\n" & Error.Text & "\n" & Error.Where) ENDIF Path = sOldPath Project.Dir = File.Dir(Path) Name = sOldName IF Path THEN ReadProject RETURN TRUE END PUBLIC SUB CloseAll() DIM hForm AS Object FOR EACH hForm IN Files hForm.Close NEXT END PRIVATE FUNCTION CloseProject() AS Boolean DIM hForm AS Object DIM bModif AS Boolean 'IF Len(Path) = 0 THEN RETURN IF Running THEN FDebug.Stop 'WAIT 0.5 ENDIF FOR EACH hForm IN Files IF hForm.IsModified() THEN bModif = TRUE BREAK ENDIF NEXT IF bModif THEN IF FSave.Run(AboutToQuit) THEN RETURN TRUE ENDIF FFind.Close INC Application.Busy FOR EACH hForm IN Files hForm.Delete NEXT Files.Clear ActiveForm = NULL DEC Application.Busy IF NOT AboutToQuit THEN FProperty.HideAll TRY KILL Project.Dir &/ ".lock" RETURN FALSE END PUBLIC FUNCTION Close() AS Boolean DIM hForm AS Form DIM iInd AS Integer DIM sLig AS String AboutToQuit = TRUE IF CloseProject() THEN AboutToQuit = FALSE RETURN TRUE ENDIF 'FDebug.Close 'FOR EACH hForm IN Windows ' TRY hForm.Close 'NEXT 'FOR EACH hForm IN Windows ' TRY hForm.Delete 'NEXT ' FToolBox.Delete ' FExplorer.Delete ' FFind.Delete ' FGambas.Delete ' FIconTool.Delete ' FDebug.Delete ' FProperty.Delete CComponent.Exit END PRIVATE PROCEDURE AddDir(cDir AS String[]) DIM sDir AS String DIM sFile AS String DIM sIcon AS String DIM sPath AS String DIM sKey AS String DIM bShow AS Boolean DIM sExt AS String DIM sParent AS String DIM hPict AS Picture DIM aFile AS NEW String[] DIM bAllowForm AS Boolean bAllowForm = AllowForm() sDir = cDir[0] FOR EACH sFile IN Dir(sDir, "*") IF IsDir(sDir &/ sFile) THEN aFile.Add("D" & sFile) NEXT FOR EACH sFile IN Dir(sDir, "*") IF NOT IsDir(sDir &/ sFile) THEN aFile.Add("F" & sFile) NEXT aFile.Sort FOR EACH sFile IN aFile sFile = Mid$(sFile, 2) sPath = sDir &/ sFile sKey = sPath sParent = sDir WITH Stat(sPath) IF .Hidden THEN CONTINUE bShow = FALSE IF .Type = gb.Directory THEN cDir.Add(sPath) sIcon = IMAGE_DIR &/ "close.png" IF sDir = Project.Dir THEN sParent = KEY_MISC ENDIF bShow = TRUE ELSE 'IF InStr(.Perm.User & .Perm.Group & .Perm.Other, "x") THEN CONTINUE sExt = Lower(File.Ext(sFile)) IF sDir = Project.Dir THEN sParent = KEY_MISC ENDIF SELECT CASE sExt CASE "form", "class", "module" IF sParent = KEY_MISC THEN sIcon = IMAGE_DIR &/ sExt & ".png" bShow = TRUE IF sExt = "form" THEN sParent = KEY_FORM IF NOT bAllowForm THEN sIcon = "" ELSE IF sExt = "class" THEN sParent = KEY_CLASS IF $bDisplayForm THEN IF NOT bAllowForm THEN IF Exist(sDir &/ File.BaseName(sFile) & ".form") THEN sIcon = "" ENDIF ENDIF ELSE IF Exist(sDir &/ File.BaseName(sFile) & ".form") THEN sIcon = "" ENDIF ENDIF ELSE IF sExt = "module" THEN sParent = KEY_MODULE ENDIF sFile = File.BaseName(sFile) ELSE sIcon = IMAGE_DIR &/ "unknown.png" ENDIF CASE "jpg", "jpeg", "xpm", "bmp", "png", "gif" IF .Size > MAX_ICON_SIZE THEN sIcon = IMAGE_DIR &/ "image.png" ELSE sIcon = sPath ENDIF CASE "svg" sIcon = IMAGE_DIR &/ "image.png" CASE "pot" IF sParent = KEY_MISC THEN sIcon = "" ENDIF CASE "gambas" CONTINUE CASE ELSE sIcon = "" IF Right$(sFile, 1) <> "~" THEN IF sFile <> Project.Name OR sParent <> KEY_MISC THEN sIcon = IMAGE_DIR &/ "unknown.png" ENDIF ENDIF END SELECT ENDIF IF Len(sIcon) THEN IF Left$(sIcon) = "/" THEN hPict = NEW Picture TRY hPict.Load(sIcon) ELSE hPict = Picture[sIcon] ENDIF WITH ProjectTree.Add(sKey, sFile, hPict, sParent) IF bShow THEN ProjectTree[sKey].MoveParent ProjectTree.Item.Expanded = TRUE ENDIF END WITH ENDIF END WITH NEXT END PRIVATE SUB SelectKey(sKey AS String) IF NOT ProjectTree.Exist(sKey) THEN IF Right$(sKey, 6) = ".class" THEN sKey = Left$(sKey, -6) & ".form" ENDIF ENDIF TRY ProjectTree[sKey].Selected = TRUE TRY ProjectTree[sKey].EnsureVisible END PUBLIC PROCEDURE Refresh(OPTIONAL bReset AS Boolean) DIM sFile AS String DIM cDir AS NEW String[] DIM sDir AS String DIM sKey AS String DIM sKeyReset AS String $bDisplayForm = Settings["/DisplayForm"] IF NOT bReset THEN sKeyReset = ProjectTree.Key ENDIF WITH ProjectTree .Clear() sKey = Project.Dir .Add(sKey, Name, Picture["img/16/gambas.png"]).Expanded = TRUE cDir.Add(Project.Dir) .Add(KEY_CLASS, ("Classes"), Picture["img/16/close.png"], sKey) IF AllowForm() THEN .Add(KEY_FORM, ("Forms"), Picture["img/16/close.png"], sKey) ENDIF .Add(KEY_MODULE, ("Modules"), Picture["img/16/close.png"], sKey) .Add(KEY_MISC, ("Data"), Picture["img/16/close.png"], sKey) '$bGetSource = TRUE REPEAT AddDir(cDir) cDir.Remove(0) $bGetSource = FALSE UNTIL cDir.Count = 0 '.Sort() END WITH IF sKeyReset THEN sKey = sKeyReset TRY ProjectTree[sKey].EnsureVisible DefineStartup(Startup, TRUE) WITH ProjectTree .MoveFirst WHILE .Available .Current.Expanded = .Current.Children > 0 .MoveNext WEND END WITH 'STOP FMain.Title = ("Project") & " - " & Name & If(ReadOnly, " [" & ("Read only") & "]", "") END PUBLIC FUNCTION IsEditor(hFile AS Object) AS Boolean RETURN Object.Type(hFile) = "FEditor" END PUBLIC FUNCTION IsForm(hFile AS Object) AS Boolean IF hFile THEN RETURN Object.Type(hFile) = "FForm" END PUBLIC FUNCTION LoadFile(sPath AS String) AS Object DIM hForm AS Object 'DIM hActive AS Object INC Application.Busy hForm = Files[sPath] IF Not hForm THEN 'PRINT "Load: "; sPath 'hActive = ActiveForm SELECT CASE Lower(File.Ext(sPath)) CASE "module", "class" hForm = NEW FEditor(sPath) CASE "form" IF AllowForm() THEN hForm = NEW FForm(sPath) CASE "png", "gif", "jpg", "jpeg", "bmp", "xpm" hForm = NEW FIconEditor(sPath) CASE ELSE hForm = NEW FTextEditor(sPath) END SELECT Files[sPath] = hForm ENDIF DEC Application.Busy RETURN hForm CATCH DEC Application.Busy Message.Error(("Cannot open file.") & "\n\n" & Error.Text & "\n" & Error.Where) END PUBLIC FUNCTION FindPath(sClass AS String) AS String DIM sPath AS String DIM aDir AS String[] DIM iInd AS Integer aDir = Dir(Project.Dir) iInd = aDir.Find(sClass & ".class", gb.Text) IF iInd >= 0 THEN RETURN Project.Dir &/ aDir[iInd] iInd = aDir.Find(sClass & ".module", gb.Text) IF iInd >= 0 THEN RETURN Project.Dir &/ aDir[iInd] 'PRINT "FindPath: "; sClass; " ?" END PUBLIC SUB OpenFile(sPath AS String, OPTIONAL iLine AS Integer) DIM hForm AS Object IF InStr(sPath, "/") = 0 THEN sPath = FindPath(sPath) IF Not Exist(sPath) THEN Message.Warning("File not found!") Project.Refresh RETURN ENDIF 'IF File.Ext(sPath) = "form" THEN ' FProperty.Show ' FToolBox.Show 'ENDIF LoadFile(sPath) hForm = Files[sPath] IF NOT hForm THEN RETURN hForm.Show IF Object.Type(hForm) = "FEditor" THEN hForm.Editor.SetFocus ENDIF IF iLine THEN hForm.GotoCenter(iLine, 0) END PUBLIC FUNCTION ExistForm(sName AS String) AS Boolean RETURN Dir(Project.Dir, "*.form").Find(sName & ".form", gb.Text) >= 0 END PUBLIC SUB OpenForm(sName AS String) DIM sPath AS String sPath = Project.Dir &/ sName & ".form" IF Exist(sPath) THEN OpenFile(sPath) END PRIVATE FUNCTION AddMessage(sVoid AS String) AS String DIM hFic AS File DIM sLig AS String IF Stat(OUTPUT_FILE).Size = 0 THEN SetMessage(sVoid) RETURN ELSE OPEN OUTPUT_FILE FOR READ AS #hFic WHILE Not Eof(hFic) LINE INPUT #hFic, sLig 'ProjectMessage.Add(sLig) WEND CLOSE #hFic ENDIF 'ProjectMessage.Index = ProjectMessage.Count - 1 'SetMessage(sLig) RETURN sLig END PRIVATE SUB CompileError(sMsg AS String) DIM iPos AS Integer DIM sFile AS String DIM iLine AS Integer iPos = InStr(sMsg, ":") 'if iPos = 0 then return sFile = Left$(sMsg, iPos - 1) sMsg = Mid$(sMsg, iPos + 1) iPos = InStr(sMsg, ":") 'if iPos = 0 then return iLine = Val(Left$(sMsg, iPos - 1)) 'if iLine = 0 then return sFile = File.Dir(Path) &/ File.Name(sFile) SetMessage(File.BaseName(sFile) & "." & CStr(iLine) & ": " & Trim(Mid$(sMsg, iPos + 1))) OpenFile(sFile, iLine) FGambas.Animate("Depressive") Message.Warning(Trim(Mid$(sMsg, iPos + 1)) & "\n" & Subst(("at line &1 in &2"), CStr(iLine), File.Name(sFile))) OpenFile(sFile, iLine) CATCH END PUBLIC FUNCTION Quote(sPath AS String) AS String DIM sQuote AS String DIM iInd AS Integer DIM sCar AS String sPath = SConv$(sPath) FOR iInd = 1 TO Len(sPath) sCar = Mid$(sPath, iInd, 1) IF InStr("0123456789abcdefghijklmnopqrstuvwxyz.-/_~", LCase(sCar)) = 0 THEN sCar = "\\" & sCar ENDIF sQuote = sQuote & sCar NEXT RETURN sQuote END PUBLIC FUNCTION Escape(sStr AS String) AS String DIM sRes AS String DIM iInd AS Integer DIM sCar AS String DIM iPos AS Integer FOR iInd = 1 TO Len(sStr) sCar = Mid$(sStr, iInd, 1) iPos = InStr("'\"\\\n\r\t", sCar) IF iPos THEN sCar = "\\" & Mid$("'\"\\nrt", iPos, 1) sRes = sRes & sCar NEXT RETURN sRes END PUBLIC SUB Process_Read() DIM sLig AS String LINE INPUT #LAST, sLig PRINT sLig END PUBLIC SUB DeleteCompiledFiles() DIM sFile AS String EXEC ["rm", "-rf", Project.Dir &/ ".gambas"] WAIT IF Exist(Project.Dir &/ ".lang") THEN FOR EACH sFile IN Dir(Project.Dir &/ ".lang", "*.pot") TRY KILL Project.Dir &/ ".lang" &/ sFile NEXT ENDIF END PUBLIC FUNCTION GetCompileCommand(bAll AS Boolean, bNoDebug AS Boolean, bIDE AS Boolean) AS String DIM sExec AS String sExec = System.Path &/ "bin/gbc" & System.Version & " " IF bAll THEN sExec = sExec & "-a " IF NOT bNoDebug THEN sExec = sExec & "-g " IF Localize THEN sExec = sExec & "-t " IF ControlPublic THEN sExec = sExec & "-p " 'sExec = sExec & "-c " & Quote(CLASSES_FILE) & " " & Quote(Project.Dir) & " > " & OUTPUT_FILE & " 2>&1" IF bIDE THEN sExec = sExec & Quote(Project.Dir) sExec = sExec & " > " & OUTPUT_FILE & " 2>&1" ENDIF RETURN sExec END PUBLIC FUNCTION Compile(OPTIONAL bAll AS Boolean, OPTIONAL bNoDebug AS Boolean) AS Boolean DIM sExec AS String DIM sRes AS String DIM sDir AS String IF Project.ReadOnly THEN RETURN IF Project.Running THEN RETURN 'TRUE IF LockIt() THEN RETURN TRUE sDir = Project.Dir Save SetMessage(("Compiling project") & " " & Project.Name & "...") IF bAll THEN CleanUpProject DeleteCompiledFiles WriteProject ENDIF sExec = GetCompileCommand(bAll, bNoDebug, TRUE) SHELL sExec WAIT 'Stat(OUTPUT_FILE) sRes = AddMessage(("Nothing to do.")) IF sRes THEN IF sRes <> "OK" THEN UnlockIt() CompileError(sRes) RETURN TRUE ELSE IF Localize THEN TRY MKDIR sDir &/ ".lang" SHELL "msgcat " & Quote(sDir) &/ ".lang/*.pot > " & Quote(sDir &/ ".lang/.pot") & " 2>/dev/null" WAIT ENDIF SetMessage(("OK")) FGambas.Animate("Happy") ENDIF ENDIF UnlockIt() END PRIVATE FUNCTION CheckRunning(OPTIONAL bCompileAll AS Boolean) AS Boolean IF Project.Running THEN RETURN IF Compile(bCompileAll) THEN RETURN TRUE IF CheckStartupClass() THEN RETURN TRUE END PUBLIC SUB Run(OPTIONAL bCompileAll AS Boolean, OPTIONAL iDebug AS Integer) IF CheckRunning(bCompileAll) THEN RETURN IF iDebug = 1 THEN FDebug.Step ELSE IF iDebug = 2 THEN FDebug.Forward ELSE IF iDebug = 3 THEN FDebug.ReturnFrom ELSE FDebug.Run ENDIF END PUBLIC SUB Forward() IF CheckRunning() THEN RETURN FDebug.Forward END PUBLIC SUB ReturnFrom() IF CheckRunning() THEN RETURN FDebug.ReturnFrom END PUBLIC SUB RunUntil(hForm AS FEditor, iLine AS Integer) IF CheckRunning() THEN RETURN FDebug.RunUntil(hForm, iLine) END PUBLIC SUB Step() IF Compile() THEN RETURN IF CheckStartupClass() THEN RETURN FDebug.Step END PUBLIC SUB Save() DIM hForm AS Object INC Application.Busy FOR EACH hForm IN Files IF Object.Type(hForm) = "FEditor" THEN IF hForm.Save(TRUE) THEN BREAK ELSE IF hForm.Save() THEN BREAK ENDIF NEXT DEC Application.Busy END PUBLIC SUB Insert(sName AS String, sType AS String, OPTIONAL sTemplate AS String, OPTIONAL bNoRefresh AS Boolean) DIM sPath AS String DIM sData AS String sPath = Project.Dir &/ File.BaseName(sName) & "." & sType IF Exist(sPath) THEN Message.Warning(("File already exists.")) RETURN ENDIF File.Save(sPath, sTemplate) IF Not bNoRefresh THEN Refresh OpenFile(sPath) END PUBLIC SUB InsertFile(sName AS String, sDir AS String, OPTIONAL sTemplate AS String) DIM sPath AS String DIM sData AS String sPath = sDir &/ sName IF Len(sTemplate) THEN IF Exist(sPath) THEN Message.Warning(("File already exists.")) RETURN ENDIF SHELL "cp " & Quote(sTemplate) & " " & Quote(sPath) WAIT IF Not Exist(sPath) THEN Message.Error(("Cannot copy template file.")) RETURN ENDIF ENDIF Refresh RefreshLibrary OpenFile(sPath) END PUBLIC SUB InsertDirectory(sPath AS String) IF Exist(sPath) THEN Message.Warning(("Directory already exists.")) RETURN ENDIF MKDIR sPath Refresh END PUBLIC SUB Activate(hForm AS Object) DIM sType AS String 'PRINT Application.ActiveWindow 'TRY PRINT Application.ActiveWindow.Name 'IF Application.ActiveWindow <> hForm THEN RETURN 'IF File.Ext(hForm.Path) = "class" THEN ' IF Exist(File.Dir(hForm.Path) &/ File.BaseName(hForm.Path) & ".form" THEN IF AboutToQuit THEN RETURN IF Not hForm THEN RETURN SelectKey(hForm.Path) IF ActiveForm = hForm THEN RETURN ActiveForm = hForm IF Object.Type(hForm) = "FIconEditor" THEN FIconTool.Raise ELSE FIconTool.Hide ENDIF FProperty.RefreshAll FFormStack.RefreshAll ' IF Object.Type(hForm) = "FTextEditor" THEN ' FFind.SetTextOnly(TRUE) ' ELSE IF Object.Type(hForm) = "FEditor" THEN ' FFind.SetTextOnly(FALSE) ' ENDIF END PUBLIC SUB Deactivate(hForm AS Object) IF ActiveForm <> hForm THEN RETURN SELECT CASE Object.Type(hForm) CASE "FIconEditor" FIconTool.Hide CASE "FForm" FProperty.HideAll FFormStack.HideAll END SELECT END PUBLIC FUNCTION NewProject(sDir AS String, OPTIONAL aOption AS String[]) AS Boolean DIM sName AS String DIM iInd AS Integer DIM sPath AS String DIM sOption AS String sName = File.Name(sDir) MKDIR sDir sPath = sDir &/ PROJECT_FILE IF aOption THEN sOption = aOption.Join("\n") File.Save(sPath, PROJECT_MAGIC & "\nProject=" & sName & "\n" & sOption) 'BrowseForm.AddProject(sDir) RETURN CATCH Message.Warning(("Cannot create project!") & "\n\n" & Error.Text) RETURN TRUE END PUBLIC FUNCTION CopyProject(sSrc AS String, sDst AS String) AS Boolean DIM sName AS String DIM iInd AS Integer DIM sPath AS String DIM sOut AS String sOut = Temp$ SHELL "cp -r " & Quote(sSrc) & " " & Quote(sDst) & " 2> " & Quote(sOut) WAIT sOut = File.Load(sOut) IF sOut THEN Error.Raise(sOut) RETURN CATCH Message.Warning(("Cannot copy project!") & "\n\n" & Error.Text) RETURN TRUE END PUBLIC FUNCTION MakeExecutable(OPTIONAL bDoNotIncVersion AS Boolean, OPTIONAL bSilent AS Boolean) AS Boolean DIM sExec AS String IF NOT bSilent THEN Dialog.Title = ("Make executable") Dialog.Path = ExecPath Dialog.Filter = [("Gambas executable files") & " (*.gambas)", ("All files") & " (*)"] IF NOT Exist(Dialog.Path) THEN Dialog.Path = Project.Dir &/ Project.Name ENDIF IF Dialog.SaveFile() THEN RETURN TRUE ExecPath = Dialog.Path ENDIF IF Compile(TRUE, NOT KeepDebugInfo) THEN RETURN TRUE IF CheckStartupClass() THEN RETURN TRUE SetMessage(("Making executable...")) sExec = System.Path &/ "bin/gba" & System.Version & " " & Quote(Project.Dir) & " > " & OUTPUT_FILE & " 2>&1" 'PRINT sExec SHELL sExec WAIT IF ExecPath <> (Project.Dir &/ Project.Name & ".gambas") THEN TRY KILL ExecPath TRY RENAME Project.Dir &/ Project.Name AS ExecPath ENDIF 'Stat(OUTPUT_FILE) AddMessage(("Nothing to do.")) Compile(TRUE, FALSE) IF Not bDoNotIncVersion THEN INC ReleaseVersion WriteProject END PUBLIC FUNCTION GetClasses(OPTIONAL bFullPath AS Boolean) AS String[] DIM sFile AS String DIM aClass AS NEW String[] DIM bStop AS Boolean FOR EACH sFile IN Dir(Project.Dir, "*.module") IF bFullPath THEN aClass.Add(Project.Dir &/ sFile) ELSE aClass.Add(File.BaseName(sFile)) ENDIF NEXT FOR EACH sFile IN Dir(Project.Dir, "*.class") IF bFullPath THEN aClass.Add(Project.Dir &/ sFile) ELSE aClass.Add(File.BaseName(sFile)) ENDIF NEXT aClass.Sort RETURN aClass END PUBLIC SUB ReadProject() DIM hFic AS File DIM sLig AS String DIM iPos AS Integer DIM sKey AS String DIM sVal AS String DIM cVer AS String[] DIM sElt AS String DIM iElt AS Integer DIM aMissing AS NEW String[] DIM sMsg AS String Libraries = NEW String[] Title = "" TabSize = Settings["/DefaultTabSize", 2] Arguments = "" MajorVersion = 0 MinorVersion = 0 ReleaseVersion = 1 SnapToGrid = TRUE ShowGrid = TRUE Snap = Settings["/DefaultGridResolution", 8] ControlPublic = FALSE KeepDebugInfo = FALSE Localize = FALSE Description = "" Icon = "" Systems = NEW String[] Menus = NEW Collection Groups = NEW Collection Prefix = FALSE ExecPath = Project.Dir &/ Project.Name & ".gambas" OPEN Path FOR READ AS hFic WHILE Not Eof(hFic) LINE INPUT #hFic, sLig sLig = Trim(sLig) IF Len(sLig) = 0 THEN CONTINUE IF Left$(sLig, 1) = "#" THEN CONTINUE iPos = InStr(sLig, "=") IF iPos = 0 THEN CONTINUE sKey = Lower$(Trim(Left$(sLig, iPos - 1))) sVal = Trim(Mid$(sLig, iPos + 1)) SELECT sKey CASE "title" Title = sVal CASE "startup" DefineStartup(sVal, TRUE) CASE "library" IF CComponent.All.Exist(sVal) THEN Libraries.Add(sVal) ELSE aMissing.Add(sVal) ENDIF CASE "tabsize" TabSize = Val(sVal) CASE "argument" IF Arguments THEN Arguments = Arguments & "\n" Arguments = Arguments & sVal CASE "version" cVer = Split(sVal, ".") TRY MajorVersion = Val(cVer[0]) TRY MinorVersion = Val(cVer[1]) TRY ReleaseVersion = Val(cVer[2]) CASE "snaptogrid" SnapToGrid = Val(sVal) <> 0 CASE "showgrid" ShowGrid = Val(sVal) <> 0 CASE "snapx", "snap" Snap = Val(sVal) CASE "localize" Localize = Val(sVal) <> 0 ' CASE "language" ' Language = sVal CASE "keepdebuginfo" KeepDebugInfo = Val(sVal) <> 0 CASE "controlpublic" ControlPublic = Val(sVal) <> 0 CASE "description" Description = Replace(sVal, "\\n", "\n") CASE "icon" Icon = sVal CASE "systems" Systems = Split(sVal, ",") CASE "menus" iElt = 0 FOR EACH sElt IN Split(sVal, ",") IF iElt >= Systems.Count THEN BREAK Menus[Systems[iElt]] = sElt INC iElt NEXT CASE "groups" iElt = 0 FOR EACH sElt IN Split(sVal, ",") IF iElt >= Systems.Count THEN BREAK Groups[Systems[iElt]] = sElt INC iElt NEXT CASE "prefix" Prefix = Val(sVal) CASE "execpath" ExecPath = sVal END SELECT WEND CLOSE hFic IF aMissing.Count THEN sMsg = Subst(("Some components are missing: &1"), aMissing.Join(", ")) IF Message.Error(sMsg, ("Continue"), ("Cancel")) = 2 THEN Error.Raise("") ENDIF ENDIF 'Libraries.Sort FMain.UpdateTranslate RefreshLibrary 'TileGrid = NEW Picture 'TileGrid.Type = Picture.Bitmap 'TileGrid.Resize(SnapX, SnapY) 'Draw.Begin(TileGrid) 'Draw.FillColor = Color. 'Draw.End END PUBLIC SUB WriteProject() DIM hFic AS File DIM sLib AS String DIM sSys AS String DIM sElt AS String DIM sPath AS String DIM sArg AS String DIM iKey AS Integer DIM iCount AS Integer DIM hComp AS CComponent IF Project.ReadOnly THEN RETURN OPEN Path & ".tmp" FOR CREATE AS hFic PRINT #hFic, PROJECT_MAGIC PRINT #hFic, "Project="; Name IF Title THEN PRINT #hFic, "Title="; Title IF Description THEN PRINT #hFic, "Description="; Replace(Description, "\n", "\\n") IF Icon THEN PRINT #hFic, "Icon="; Icon IF Startup THEN PRINT #hFic, "Startup="; Startup 'IF StackSize THEN PRINT #hFic, "Stack="; CStr(StackSize) PRINT #hFic, "TabSize="; CStr(TabSize) FOR EACH sArg IN Split(Arguments, "\n") PRINT #hFic, "Argument="; sArg NEXT PRINT #hFic, "Version="; CStr(MajorVersion) & "." & CStr(MinorVersion) & "." & CStr(ReleaseVersion) ' FOR iKey = 1 TO 1000 ' FOR EACH sLib IN Libraries ' IF CComponent.All[sLib].SortKey = iKey THEN ' PRINT #hFic, "Library="; sLib ' INC iCount ' ENDIF ' NEXT ' IF iCount = Libraries.Count THEN BREAK ' NEXT FOR EACH hComp IN CComponent.All IF Libraries.Find(hComp.Key) >= 0 THEN PRINT #hFic, "Library="; hComp.Key ENDIF NEXT PRINT #hFic, "SnapToGrid="; If(SnapToGrid, "1", "0") PRINT #hFic, "ShowGrid="; If(ShowGrid, "1", "0") PRINT #hFic, "Snap="; CStr(Snap) PRINT #hFic, "Localize="; If(Localize, "1", "0") 'PRINT #hFic, "Language="; Language PRINT #hFic, "KeepDebugInfo="; If(KeepDebugInfo, "1", "0") PRINT #hFic, "ControlPublic="; If(ControlPublic, "1", "0") IF ExecPath <> (Project.Dir &/ Project.Name & ".gambas") THEN PRINT #hFic, "ExecPath="; ExecPath ENDIF IF Systems.Count THEN PRINT #hFic, "Systems="; Systems.Join(",") sElt = "" FOR EACH sSys IN Systems sElt = sElt & "," & Menus[sSys] NEXT PRINT #hFic, "Menus="; Mid$(sElt, 2) sElt = "" FOR EACH sSys IN Systems sElt = sElt & "," & Groups[sSys] NEXT PRINT #hFic, "Groups="; Mid$(sElt, 2) ENDIF PRINT #hFic, "Prefix="; If(Prefix, "1", "0") CLOSE #hFic KILL Path RENAME Path & ".tmp" AS Path sPath = Project.Dir &/ ".lang/#project.pot" TRY KILL sPath IF Localize THEN TRY MKDIR File.Dir(sPath) OPEN sPath FOR CREATE AS #hFic PRINT #hFic, "# "; Path PRINT #hFic, File.Load("pot-header.txt") IF Title THEN PRINT #hFic, "#: .project:1" PRINT #hFic, "msgid \""; Escape(Title); "\"" PRINT #hFic, "msgstr \"\"\n" ENDIF IF Description THEN PRINT #hFic, "#: .project:2" PRINT #hFic, "msgid \""; Escape(Description); "\"" PRINT #hFic, "msgstr \"\"\n" ENDIF CLOSE #hFic ENDIF RefreshLibrary FMain.UpdateTranslate CATCH Message.Error(("Cannot write project file.") & "\n\n" & Error.Text) END ' PUBLIC FUNCTION GetSorted() AS String[] ' ' DIM cList AS NEW String[] ' DIM hFile AS Object ' DIM bStop AS Boolean ' ' ProjectTree[KEY_CLASS].MoveChild ' WHILE ProjectTree.Available ' cList.Add(ProjectTree.Item.Key) ' ProjectTree.MoveNext ' WEND ' ' ProjectTree[KEY_MODULE].MoveChild ' WHILE ProjectTree.Available ' cList.Add(ProjectTree.Item.Key) ' ProjectTree.MoveNext ' WEND ' ' 'cList.Sort ' ' RETURN cList ' ' END PUBLIC FUNCTION GetNextEditor(sKey AS String) AS String DIM sFirst AS String DIM sFile AS String DIM bNext AS Boolean FOR EACH sFile IN GetClasses(TRUE) IF bNext THEN RETURN sFile IF NOT sFirst THEN sFirst = sFile ENDIF IF sFile = sKey THEN bNext = TRUE ENDIF NEXT IF bNext THEN RETURN sFirst END PUBLIC FUNCTION GetPreviousEditor(sKey AS String) AS String DIM sLast AS String DIM sFile AS String FOR EACH sFile IN GetClasses(TRUE) IF sFile = sKey THEN IF sLast THEN RETURN sLast ENDIF ENDIF sLast = sFile NEXT RETURN sLast END PRIVATE $bBlock AS Boolean PUBLIC SUB Shortcut(Code AS Integer, Ascii AS String, State AS Integer) IF $bBlock THEN RETURN $bBlock = TRUE SELECT CASE Code CASE Key.F2 FExplorer.Show CASE Key.F4 FProperty.Show CASE Key.F5 ME.Run CASE Key.F6 FToolBox.Show CASE Key.F7 Compile(State And Mouse.Alt) CASE Key.F8 ME.Step END SELECT $bBlock = FALSE END PUBLIC SUB SetMessage(sMsg AS String) ProjectMessage.Text = sMsg WAIT END PUBLIC SUB DeleteFile(sPath AS String) DIM sExt AS String DIM hForm AS Object IF Not Exist(sPath) THEN RETURN hForm = Files[sPath] IF hForm THEN hForm.Delete Files[sPath] = NULL ENDIF TRY ProjectTree.Remove(sPath) TRY KILL sPath & "~" TRY RENAME sPath AS sPath & "~" IF sExt = "form" Or sExt = "class" Or sExt = "module" THEN TRY KILL Project.Dir &/ ".gambas" &/ UCase(File.BaseName(sPath)) TRY KILL Project.Dir &/ ".lang" &/ File.BaseName(sPath) & ".pot" ENDIF sExt = File.Ext(sPath) IF sExt = "form" THEN DeleteFile(File.Dir(sPath) &/ File.BaseName(sPath) & ".class") ELSE IF sExt = "class" THEN DeleteFile(File.Dir(sPath) &/ File.BaseName(sPath) & ".form") ENDIF IF File.BaseName(sPath) = Startup THEN DefineStartup("") ENDIF 'CATCH 'Message("*Unable to delete file.||" & sPath) 'Refresh END PUBLIC SUB DeleteDir(sDir AS String) DIM sFile AS String FOR EACH sFile IN Dir(sDir, "*~") TRY KILL sDir &/ sFile NEXT RMDIR sDir END PRIVATE FUNCTION CheckStartupClass() AS Boolean IF Startup THEN RETURN Message.Warning(("You must define a startup class or form!")) RETURN TRUE END PUBLIC FUNCTION CheckFileName(sName AS String, OPTIONAL sDir AS String) AS Boolean DIM iInd AS Integer IF Not sName THEN GOTO VOID_NAME FOR iInd = 1 TO Len(sName) IF InStr(FILE_AUTH_CAR & "-._+()", LCase(Mid$(sName, iInd, 1))) = 0 THEN GOTO BAD_CHAR NEXT IF Len(sDir) THEN IF Exist(sDir &/ sName) THEN GOTO ALREADY_EXIST ENDIF RETURN VOID_NAME: Message.Warning(("Please type a name.")) RETURN TRUE BAD_CHAR: Message.Warning(("This name contains a forbidden character :") & " [ " & Mid$(sName, iInd, 1) & " ]") RETURN TRUE ALREADY_EXIST: Message.Warning(("This name is already used. Choose another one.")) RETURN TRUE END PUBLIC FUNCTION CheckClassName(sName AS String, OPTIONAL bCheckNotExist AS Boolean) AS Boolean DIM iInd AS Integer IF Not sName THEN GOTO VOID_NAME FOR iInd = 1 TO Len(sName) IF InStr(CLASS_AUTH_CAR, LCase(Mid$(sName, iInd, 1))) = 0 THEN GOTO BAD_CHAR NEXT IF InStr("0123456789", Left$(sName)) THEN iInd = 1 GOTO BAD_CHAR ENDIF IF bCheckNotExist THEN IF Project.Exist(sName) THEN GOTO ALREADY_EXIST ENDIF RETURN VOID_NAME: Message.Warning(("Please type a name.")) RETURN TRUE BAD_CHAR: Message.Warning(("This name contains a forbidden character :") & " [ " & Mid$(sName, iInd, 1) & " ] \n\n" & ("A name must begin with a letter, followed by any letter or digit.")) RETURN TRUE ALREADY_EXIST: Message.Warning(("This name is already used. Choose another one.")) RETURN TRUE END PRIVATE FUNCTION RenameOneFile(sDir AS String, sName AS String, sNewName AS String, OPTIONAL sExt AS String) AS String DIM sPath AS String DIM hForm AS Object DIM sNewPath AS String sPath = sDir &/ sName IF sExt THEN sPath = sPath & "." & sExt IF NOT Exist(sPath) THEN RETURN sNewPath = sDir &/ sNewName IF sExt THEN sNewPath = sNewPath & "." & sExt RENAME sPath AS sNewPath IF sExt THEN TRY KILL sDir &/ ".gambas" &/ UCase(sName) ENDIF hForm = Files[sPath] IF hForm THEN hForm.Rename(sNewName, sNewPath) Files[sPath] = NULL Files[sNewPath] = hForm ENDIF RETURN sNewPath END PUBLIC SUB RenameFile(sPath AS String) DIM sName AS String DIM sExt AS String DIM sDir AS String DIM sNewName AS String DIM sNewPath AS String DIM sTitle AS String sDir = File.Dir(sPath) sExt = File.Ext(sPath) IF Project.IsClassName(sPath) THEN sName = File.BaseName(sPath) SELECT CASE sExt CASE "form" sTitle = ("Rename form") CASE "class" sTitle = ("Rename class") CASE "module" sTitle = ("Rename module") END SELECT sNewName = FRename.Run(sName, sTitle, TRUE) IF Not sNewName THEN RETURN IF sName = Startup THEN Startup = sNewName WriteProject ENDIF sNewPath = RenameOneFile(sDir, sName, sNewName, sExt) IF sExt = "form" THEN RenameOneFile(sDir, sName, sNewName, "class") ELSE IF sExt = "class" THEN RenameOneFile(sDir, sName, sNewName, "form") ENDIF ELSE sName = File.Name(sPath) sNewName = FRename.Run(sName, If(IsDir(sPath), ("Rename directory"), ("Rename file"))) IF Not sNewName THEN RETURN sNewPath = RenameOneFile(sDir, sName, sNewName) ENDIF Refresh TRY ProjectTree[sNewPath].Selected = TRUE TRY ProjectTree[sNewPath].EnsureVisible CATCH Message.Error(Subst(("Unable to rename '&1'"), File.Name(sPath))) END PUBLIC FUNCTION Exist(sName AS String) AS Boolean RETURN Project.GetClasses().Find(sName, gb.Text) >= 0 END PRIVATE FUNCTION LockIt() AS Boolean IF Application.Busy THEN RETURN TRUE INC Application.Busy 'PRINT "Lock" END PRIVATE SUB UnLockIt() DEC Application.Busy END PUBLIC FUNCTION GetProject() AS String RETURN FOpenProject.Run() END PUBLIC FUNCTION GetNewProject() AS String RETURN FNewProject.Run() END PRIVATE SUB LoadRecent() DIM nRecent AS Integer DIM hMenu AS Menu DIM iInd AS Integer DIM sPath AS String nRecent = Settings["/Recent/Count", 0] Recent.Clear FOR iInd = 1 TO nRecent sPath = Settings["/Recent/File[" & CStr(iInd) & "]"] IF sPath THEN IF Exist(sPath) THEN Recent.Add(sPath) IF Recent.Count >= MAX_RECENT THEN BREAK ENDIF ENDIF NEXT END PRIVATE SUB AddRecent(sPath AS String) DIM iInd AS Integer IF Right$(sPath) = "/" THEN sPath = Left$(sPath, -1) 'sPath = "(" & File.BaseName(sPath) & ") " & File.Dir(sPath) WHILE iInd < Recent.Count IF Recent[iInd] = sPath THEN Recent.Remove(iInd) ELSE INC iind ENDIF WEND Recent.Add(sPath, 0) WHILE Recent.Count > MAX_RECENT Recent.Remove(Recent.Count - 1) WEND SaveRecent END PRIVATE SUB SaveRecent() DIM iInd AS Integer Settings["/Recent/Count"] = CStr(Recent.Count) FOR iInd = 0 TO Recent.Count - 1 Settings["/Recent/File[" & CStr(iInd + 1) & "]"] = Recent[iInd] NEXT Settings.Save END PUBLIC FUNCTION CheckProjectName(sName AS String, OPTIONAL sDir AS String) AS Boolean DIM iInd AS Integer DIM sCar AS String IF NOT sName THEN Message.Warning(("Please type a project name.")) RETURN TRUE ENDIF FOR iInd = 1 TO Len(sName) sCar = Mid$(sName, iInd, 1) IF iInd = 1 THEN IF InStr(" ?*.", sCar) = 0 And Asc(sCar) < 128 THEN CONTINUE ELSE IF InStr(" ?*", sCar) = 0 And Asc(sCar) < 128 THEN CONTINUE ENDIF Message.Warning(("Forbidden characters in project name.")) RETURN TRUE NEXT IF sDir THEN IF Exist(sDir &/ sName &/ PROJECT_FILE) THEN Message.Warning(("This project already exists.")) RETURN TRUE ENDIF ENDIF END PUBLIC SUB MakeSourcePackageTo(sPath AS String) DIM sCmd AS String DIM sOpt AS String INC Application.Busy IF Right$(sPath, 3) = ".gz" THEN sOpt = "z" ELSE IF Right$(sPath, 4) = ".bz2" THEN sOpt = "j" ENDIF sCmd = "cd " & Quote(File.Dir(Project.Dir)) & ";" sCmd = sCmd & " tar cfv" & sOpt & " " & Quote(sPath) sCmd = sCmd & " --exclude=" & ".gambas/*" sCmd = sCmd & " --exclude=" & "*~" sCmd = sCmd & " --exclude=" & ".lock" sCmd = sCmd & " --exclude=" & ".lang/*.pot" sCmd = sCmd & " --exclude=" & ".lang/.pot" sCmd = sCmd & " --exclude=" & "*/.xvpics/*" sCmd = sCmd & " --exclude=" & ".xvpics/*" sCmd = sCmd & " " & Quote(File.Name(Project.Dir)) & " > /dev/null" SHELL sCmd WAIT DEC Application.Busy END PUBLIC SUB MakePackage() Dialog.Path = User.Home &/ Name & "-" & Subst("&1.&2", MajorVersion, MinorVersion) & IIf(ReleaseVersion > 0, "." & ReleaseVersion, "") & ".tar.gz" Dialog.Title = ("Create source package") Dialog.Filter = [("Source packages") & " (*.tar.gz)", ("All files") & " (*)"] IF Dialog.SaveFile() THEN RETURN MakeSourcePackageTo(Dialog.Path) END PUBLIC SUB RefreshForm() DIM hFile AS Object FOR EACH hFile IN Project.Files IF Not Project.IsEditor(hFile) THEN hFile.Refresh ENDIF NEXT END PUBLIC SUB RefreshEditor() DIM hFile AS Object FOR EACH hFile IN Project.Files IF Project.IsEditor(hFile) THEN hFile.Refresh ENDIF NEXT END PUBLIC SUB RefreshLibrary() DIM sLib AS String DIM sClass AS String CComponent.Reset ComponentFromType = NEW Collection FOR EACH sLib IN Libraries IF Not CComponent.All.Exist(sLib) THEN CONTINUE WITH CComponent.All[sLib] .Load IF .Type THEN ComponentFromType[.Type] = sLib END WITH NEXT FToolBox.RefreshToolbar FCompletion.RefreshLibrary FExplorer.RefreshTree Project.Refresh END PUBLIC FUNCTION IsClassName(sName AS String) AS Boolean DIM sExt AS String sExt = File.Ext(sName) IF sExt = "class" THEN RETURN TRUE IF sExt = "module" THEN RETURN TRUE IF sExt = "form" THEN RETURN TRUE END PUBLIC FUNCTION StripPath(sPath AS String) AS String DIM sDir AS String sDir = Project.Dir IF Right$(sDir) <> "/" THEN sDir = sDir & "/" IF Left$(sPath, Len(sDir)) = sDir THEN RETURN Mid$(sPath, Len(sDir) + 1) ELSE RETURN sPath ENDIF END PUBLIC SUB RunTool(sTool AS String) DIM aExec AS NEW String[] aExec.Add(System.Path &/ "bin" &/ sTool & ".gambas") aExec.Add(Project.Dir) EXEC aExec END PUBLIC FUNCTION GetExamples() AS String[] DIM sFile AS String DIM sFile2 AS String DIM aList AS NEW String[] FOR EACH sFile IN Dir(EXAMPLES_DIR) IF Exist(EXAMPLES_DIR &/ sFile &/ ".project") THEN aList.Add(sFile) ELSE FOR EACH sFile2 IN Dir(EXAMPLES_DIR &/ sFile) aList.Add(sFile &/ sFile2) NEXT ENDIF NEXT aList.Sort FINALLY RETURN aList END PUBLIC SUB DefineStartup(sPath AS String, OPTIONAL bDoNotWrite AS Boolean) IF Startup THEN TRY ProjectTree[Project.Dir &/ Startup & ".module"].Picture = Picture["img/16/module.png"] TRY ProjectTree[Project.Dir &/ Startup & ".class"].Picture = Picture["img/16/class.png"] TRY ProjectTree[Project.Dir &/ Startup & ".form"].Picture = Picture["img/16/form.png"] ENDIF Startup = File.BaseName(sPath) IF NOT Project.Exist(Startup) THEN Startup = "" ENDIF IF Startup THEN TRY ProjectTree[Project.Dir &/ Startup & ".module"].Picture = Picture["img/16/module-start.png"] TRY ProjectTree[Project.Dir &/ Startup & ".class"].Picture = Picture["img/16/class-start.png"] TRY ProjectTree[Project.Dir &/ Startup & ".form"].Picture = Picture["img/16/form-start.png"] ENDIF IF NOT bDoNotWrite THEN WriteProject END PUBLIC SUB CopyFile(sSrc AS String, sDst AS String) DIM iInd AS Integer DIM sDest AS String DIM sExt AS String 'PRINT sSrc; " -> "; sDst sDest = sDst WHILE Exist(sDest) INC iInd sExt = File.Ext(sDst) IF sExt THEN sDest = File.Dir(sDst) &/ File.BaseName(sDst) & " (" & iInd & ")." & sExt ELSE sDest = File.Dir(sDst) &/ File.BaseName(sDst) & " (" & iInd & ")" ENDIF WEND COPY sSrc TO sDest Refresh SelectKey(sDest) CATCH Message.Error(Subst(("Cannot copy file &1."), sSrc) & "\n\n" & Error.Text) END PUBLIC SUB MoveFile(sSrc AS String, sDst AS String) RENAME sSrc AS sDst Refresh SelectKey(sDst) CATCH Message.Error(Subst(("Cannot move file &1."), sSrc) & "\n\n" & Error.Text) END ' PUBLIC SUB RefreshToolbox() ' ' FToolBox.ClearToolbar ' ' END PUBLIC FUNCTION GetNewName(sPrefix AS String) AS String DIM iInd AS Integer DIM sName AS String DO INC iInd sName = sPrefix & iInd IF NOT Project.Exist(sName) THEN RETURN sName LOOP END PUBLIC SUB ResetScan() DIM hFile AS Object FOR EACH hFile IN Files TRY hFile.colScan = NULL NEXT END PUBLIC FUNCTION AllowForm() AS Boolean RETURN ComponentFromType.Exist("Form") END PUBLIC SUB MakeInstall() IF MakeExecutable(TRUE, TRUE) THEN RETURN IF NOT CheckProgram("rpmbuild") THEN RPMBUILD_PROG = "rpmbuild" ELSE IF NOT CheckProgram("rpm") THEN RPMBUILD_PROG = "rpm" ELSE Message.Error(("rpmbuild is not installed on your system.")) RETURN ENDIF FMakeInstall.ShowModal END PUBLIC SUB InitMove(hForm AS Form) IF FMain.X < (Desktop.W \ 2) THEN hForm.Move(Int(Rnd(FMain.X + FMain.W + 8, Desktop.Width - hForm.Width - 8)), Int(Rnd(0, Desktop.Height - hForm.Height))) ELSE hForm.Move(Int(Rnd(0, FMain.X - hForm.Width - 8)), Int(Rnd(0, Desktop.Height - hForm.Height))) ENDIF END PUBLIC FUNCTION GetIcon(sPath AS String, iSize AS Integer) AS Picture DIM hFile AS File DIM sLig AS String DIM hImage AS Image DIM hPict AS Picture OPEN sPath &/ ".project" FOR READ AS #hFile WHILE NOT Eof(hFile) LINE INPUT #hFile, sLig IF Left$(sLig, 5) = "Icon=" THEN sPath = sPath &/ Mid$(sLig, 6) hImage = NEW Image TRY hImage.Load(sPath) IF ERROR THEN hImage = NULL BREAK ENDIF WEND CLOSE #hFile FINALLY IF NOT hImage THEN hImage = NEW Image hImage.Load("img/32/gambas.png") ENDIF RETURN hImage.Stretch(iSize, iSize, TRUE).Picture END PRIVATE SUB CleanUpProject() DIM aDir AS NEW String[] DIM sFile AS String DIM sPath AS String aDir.Add(Project.Dir) WHILE aDir.Count FOR EACH sFile IN Dir(aDir[0]) sPath = aDir[0] &/ sFile IF IsDir(sPath) THEN aDir.Add(sPath) ELSE IF Right(sPath) = "~" THEN TRY KILL sPath ENDIF NEXT aDir.Remove(0) WEND CATCH Message.Error(("Cannot clean the project.") & "\n\n" & Error.Text) END PUBLIC SUB SetFormIcon(hForm AS FForm) ' ' DIM hPict AS Picture ' DIM eRap AS Float ' ' 'hForm.Raise ' hPict = hForm.Grab() ' hForm.Refresh ' eRap = hPict.Width / hPict.Height ' IF eRap > 4 THEN ' eRap = 4 ' hPict = hPict.Copy(0, 0, hPict.Height * eRap, hPict.Height) ' ELSE IF eRap < 0.5 THEN ' eRap = 0.5 ' hPict = hPict.Copy(0, 0, hPict.Width, hPict.Width / eRap) ' ENDIF ' IF eRap > 1 THEN ' hPict = hPict.Image.Stretch(32 * eRap, 32).Picture ' ELSE ' hPict = hPict.Image.Stretch(32, 32 / eRap).Picture ' ENDIF ' ' Draw.Begin(hPict) ' Draw.Foreground = &H808080& ' Draw.Rect(0, 0, hPict.Width, hPict.Height) ' Draw.End ' ' ProjectTree[Project.Dir &/ hForm.Name & ".form"].Picture = hPict ' ' CATCH ' ' PRINT Error.Text ' END PUBLIC FUNCTION CheckProgram(sProg AS String) AS Boolean DIM sTemp AS String DIM bError AS Boolean sTemp = Temp$ SHELL "which " & sProg & " > " & sTemp WAIT bError = Trim(File.Load(sTemp)) LIKE "which: *" KILL sTemp RETURN bError END PUBLIC FUNCTION OpenWebPage(sLink AS String) AS String DIM sExec AS String IF NOT $sBrowser THEN sExec = Application.Env["BROWSER"] IF NOT sExec THEN sExec = "konqueror" IF CheckProgram(sExec) THEN sExec = "firefox" IF CheckProgram(sExec) THEN sExec = "mozilla-firefox" IF CheckProgram(sExec) THEN sExec = "mozilla" IF CheckProgram(sExec) THEN sExec = "opera" IF CheckProgram(sExec) THEN RETURN ENDIF $sBrowser = sExec ENDIF SHELL $sBrowser & " " & Chr$(34) & sLink & Chr$(34) CATCH Message.Error(Error.Text) END -------------- next part -------------- A non-text attachment was scrubbed... Name: CComponent.class Type: application/x-java Size: 12441 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FEditor.class Type: application/x-java Size: 36490 bytes Desc: not available URL: From gambasfr at ...4... Fri Sep 2 20:18:57 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Fri, 2 Sep 2005 20:18:57 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <1125671463.7481.3.camel@...102...> References: <20050902115327.CAED6344272@...337...> <1125671463.7481.3.camel@...102...> Message-ID: <200509022018.57447.gambasfr@...4...> Yes i've forget the file that depend of my modification.. I've send a new gambas archive this morning but it was too big ! Fabien Bodard From gambasfr at ...4... Fri Sep 2 23:08:40 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Fri, 2 Sep 2005 23:08:40 +0200 Subject: [Gambas-devel] Another break in gambas 19 Message-ID: <200509022308.40093.gambasfr@...4...> I can't save modified forms :( Fabien From gambasfr at ...4... Sat Sep 3 15:42:31 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Sat, 3 Sep 2005 15:42:31 +0200 Subject: [Gambas-devel] GTk component bug Message-ID: <200509031542.32028.gambasfr@...4...> Hi daniel, Have you change remove the gtk timer ? It seem to heve a conflict between gtk timer and gb timer My project work on qt but not under gtk. And it's the inverse for the trayicon... Does a qt trayicon not work under gnome ? Regards, Fabien From gambas at ...1... Sat Sep 3 16:04:07 2005 From: gambas at ...1... (Benoit Minisini) Date: Sat, 3 Sep 2005 16:04:07 +0200 Subject: [Gambas-devel] GTk component bug In-Reply-To: <200509031542.32028.gambasfr@...4...> References: <200509031542.32028.gambasfr@...4...> Message-ID: <200509031604.07353.gambas@...1...> On Saturday 03 September 2005 15:42, Fabien Bodard wrote: > Hi daniel, > > Have you change remove the gtk timer ? > > It seem to heve a conflict between gtk timer and gb timer > > My project work on qt but not under gtk. > > And it's the inverse for the trayicon... Does a qt trayicon not work under > gnome ? > > > Regards, > > Fabien > Timers in SDL and GTK are now incompatible. They must be redone as I explained in the mail of a previous release. As for the trayicon problem, do you mean that the tray icon does not appear when you run your program under gnome? -- Benoit Minisini mailto:gambas at ...1... From jredrejo at ...101... Sat Sep 3 16:18:31 2005 From: jredrejo at ...101... (=?ISO-8859-1?Q?Jos=E9?= L. Redrejo =?ISO-8859-1?Q?Rodr=EDguez?=) Date: Sat, 03 Sep 2005 16:18:31 +0200 Subject: [Gambas-devel] GTk component bug In-Reply-To: <200509031604.07353.gambas@...1...> References: <200509031542.32028.gambasfr@...4...> <200509031604.07353.gambas@...1...> Message-ID: <1125757111.6437.17.camel@...102...> Hi, Daniel will not be online until next Tuesday. In the meantime, I have a pre-release gb.gtk component with the timer changed. He sent it to me for testing last friday. You can download it from http://www.linex.org/sources/linex/debian/dists/cl/gambas/source/ Using that gambas-gb-gtk version timers work perfectly now in my tests with gtk and qt, and trayicon does it too. (There is a problem when handling trayicon in the ide if I select the gtk component, but doing it with the qt component selected and switching to gtk before compiling or running the application it works perfectly) The only "incompatibility" I have noticed is with Stock icons. They work with gtk, but with qt I get a message saying that "Cannot load class Stock: Unable to load class file" Finally, Beno?t, can you remove the Debian.Readme from the gambas source code tarball? It is totally obsolete and full of errors with actual gambas development and debian packages. P.S. By the way, all debian packages for gambas 1.9.19 are ready at the usual location (described at http://gambas.sourceforge.net/download.html) . Stable version of gambas Debian packages are placed at http://apt.linex.org/linex/gambas/ . El s?b, 03-09-2005 a las 16:04 +0200, Benoit Minisini escribi?: > On Saturday 03 September 2005 15:42, Fabien Bodard wrote: > > Hi daniel, > > > > Have you change remove the gtk timer ? > > > > It seem to heve a conflict between gtk timer and gb timer > > > > My project work on qt but not under gtk. > > > > And it's the inverse for the trayicon... Does a qt trayicon not work under > > gnome ? > > > > > > Regards, > > > > Fabien > > > > Timers in SDL and GTK are now incompatible. They must be redone as I explained > in the mail of a previous release. > > As for the trayicon problem, do you mean that the tray icon does not appear > when you run your program under gnome? > From lordheavy at ...141... Sat Sep 3 17:49:42 2005 From: lordheavy at ...141... (Laurent Carlier) Date: Sat, 03 Sep 2005 17:49:42 +0200 Subject: [Gambas-devel] GTk component bug In-Reply-To: <200509031604.07353.gambas@...1...> References: <200509031542.32028.gambasfr@...4...> <200509031604.07353.gambas@...1...> Message-ID: <4319C616.1060306@...141...> Benoit Minisini a ?crit : > On Saturday 03 September 2005 15:42, Fabien Bodard wrote: > >>Hi daniel, >> >>Have you change remove the gtk timer ? >> >>It seem to heve a conflict between gtk timer and gb timer >> >>My project work on qt but not under gtk. >> >>And it's the inverse for the trayicon... Does a qt trayicon not work under >>gnome ? >> >> >>Regards, >> >>Fabien >> > > > Timers in SDL and GTK are now incompatible. They must be redone as I explained > in the mail of a previous release. > > As for the trayicon problem, do you mean that the tray icon does not appear > when you run your program under gnome? > Tray icon doesn't appear under gnome (for me). New version of sdl component (timer fix) and opengl component (code cleanup) http://gamebas.tuxfamily.org/download/ Regards, -- Laurent Carlier jabber : LordHeavy at ...298... From gambas at ...1... Sat Sep 3 19:48:49 2005 From: gambas at ...1... (Benoit Minisini) Date: Sat, 3 Sep 2005 19:48:49 +0200 Subject: [Gambas-devel] Release of gambas 1.9.20 Message-ID: <200509031948.49479.gambas@...1...> Hi, I have just uploaded a new release that fixes the previous broken one. Well, it should. Now I must be cautious! I apologize again for my mistake. Regards, -- Benoit Minisini mailto:gambas at ...1... From danielcampos at ...45... Sun Sep 4 13:27:14 2005 From: danielcampos at ...45... (danielcampos at ...45...) Date: Sun, 4 Sep 2005 13:27:14 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 Message-ID: Hi Benoit: Well, first of all, sorry if I was too rude, may be it was not a good day for me :-( The main problem is that from time to time, there are changes (for example the EXEC and OPEN syntax) that seems to not have a practical sense, just may be to make it more beautiful, but breaks existing code, and also some changes related to the gb.qt component, just have broken the code I've written for gb.gtk. May be these changes should be reported while you?re writting them, instead of waiting to release a version and just tell "surprise, I've changed that...". I mean I'm writting the gb.gtk with many problems, as GTK+ just provides the half of help that QT provides to the programmer. May be you need 10 lines of code, but I need 100 to perform the same feature. So finding from version to version that I must change what I've done is frustating, and makes more slow not only the gb.gtk developement, but all the testing platform (for example the Debian packages) that we are trying to provide for Gambas. May be some mails from you while writting a new version, and a little roadmad: "I'll try to do it for the next version a) b) c)"... would be enough at this moment. May be we could help you too with a CVS service... Regards, D. Campos ------------------------------------------------------------- NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Web/Wap : www.netcourrier.com T?l?phone/Fax : 08 92 69 00 21 (0,34 ? TTC/min) Minitel: 3615 NETCOURRIER (0,16 ? TTC/min) From jredrejo at ...101... Sun Sep 4 18:35:42 2005 From: jredrejo at ...101... (=?ISO-8859-1?Q?Jos=E9?= L. Redrejo =?ISO-8859-1?Q?Rodr=EDguez?=) Date: Sun, 04 Sep 2005 18:35:42 +0200 Subject: [Gambas-devel] Release of gambas 1.9.20 In-Reply-To: <200509031948.49479.gambas@...1...> References: <200509031948.49479.gambas@...1...> Message-ID: <1125851742.7017.2.camel@...102...> Ok, perfect, not changing the Bytecode is a great thing, I only have had to repackage the gambas-runtime , gambas-ide packages and the gambas metapackage for Debian, so "apt-get install gambas" will install all the stuff (including a fully functional gambas-gb-gtk package without conflicts with the qt & sdl timers). Regards. El s?b, 03-09-2005 a las 19:48 +0200, Benoit Minisini escribi?: > Hi, > > I have just uploaded a new release that fixes the previous broken one. > > Well, it should. Now I must be cautious! > > I apologize again for my mistake. > > Regards, > From csorda at ...69... Tue Sep 6 12:35:13 2005 From: csorda at ...69... (csorda@libero.it) Date: Tue, 6 Sep 2005 12:35:13 +0200 Subject: [Gambas-devel] undefined symbol compiling my library Message-ID: Hi, I am developing a component for CORBA Dynamic Invocation, named gb.corba in GAMBAS2 1.9.18. In GAMBAS when I use it the error 127 appear: relocation error: /usr/local/lib/gambas2/gb.corba.so: undefined symbol: _ZN5CORBA3ORB16string_to_objectEPKcRNS_11EnvironmentE The cpp standalone project is OK. I used the link option from the original makefile for generate the configure.ac: AC_INIT(configure.ac) GB_INIT(gb.corba) AC_PROG_LIBTOOL GB_COMPONENT( corba, CORBA, [CORBA component], [src], [GB_FIND(ACE.h Request.h, /usr/share/ace /usr/local/lib /usr/local /usr/lib /usr, ace ace/TAO/tao ace/TAO/tao/DynamicInterface include )], [GB_FIND(libACE.$SHLIBEXT libTAO.$SHLIBEXT libTAO_DynamicInterface.$SHLIBEXT libTAO_Valuetype.$SHLIBEXT libTAO_Messaging.$SHLIBEXT libTAO_ObjRefTemplate.$SHLIBEXT libTAO_IORInterceptor.$SHLIBEXT libTAO_PortableServer.$SHLIBEXT libTAO_Strategies.$SHLIBEXT, /usr/share/ace /usr/local /usr, lib)], [$THREAD_LIB -D_MT -DACE_AS_STATIC_LIBS -DTAO_AS_STATIC_LIBS -D__ACE_INLINE__ -DACE_NDEBUG -lACE -lTAO -lTAO_DynamicInterface], [$THREAD_INC ]) AC_OUTPUT( Makefile src/Makefile ) Help me. Thanks, Carlo. ____________________________________________________________ 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it From danielcampos at ...45... Wed Sep 7 09:04:53 2005 From: danielcampos at ...45... (Daniel Campos) Date: Wed, 07 Sep 2005 09:04:53 +0200 Subject: [Gambas-devel] 1.9.20 Timer Bug Message-ID: <1126076693.5945.22.camel@...341...> I Benoit: I've found some strange things with the new native timer implementation: 1) I'm not sure if this first one is a bug, but if you write just a console program like this: PRIVATE hTimer AS Timer PUBLIC SUB hTimer_Timer() PRINT "HELLO" END PUBLIC SUB Main() hTimer=NEW Timer AS "hTimer" hTimer.Delay=100 hTimer.Enabled=TRUE END The program just exits from the Main() function and stops. I think It should be alive, like if a descriptor were beeing watched, in order to allow console programs with timers to not finish in a loop while they're alive... ======================================================================================= 2) I think this second one is a bug, but I'm not sure if it depends on gb.net or the gbx2 interpreter. This little program works, with gb.net, as expected (it never finishes): PRIVATE hProc AS ServerSocket PUBLIC SUB Main() hProc = NEW ServerSocket hProc.Port = 30000 hProc.Listen() END ...But, if I add a Timer, it stops inmediatly! PRIVATE hProc AS ServerSocket PRIVATE hTimer AS Timer PUBLIC SUB hTimer_Timer() PRINT "TIME" END PUBLIC SUB Main() hTimer = NEW Timer AS "hTimer" hTimer.Delay = 100 hTimer.Enabled = TRUE hProc = NEW ServerSocket hProc.Port = 30000 hProc.Listen() END Should I implement some special in the gb.net component? I suppose I have not to reimplement the timer hook, as I have not main loop in that component... However, If I use a Process with the "FOR READ" flag instead of a ServerSocket, the code seems to work normally while there's data to be read from the descriptor. ====================================================================================== 3) More strange things :-) If I try to write a loop at the end of the main function so the program does not finish, the processor takes 100% use: PRIVATE hProc AS ServerSocket PRIVATE hTimer AS Timer PUBLIC SUB hTimer_Timer() PRINT "TIME" END PUBLIC SUB Main() hTimer = NEW Timer AS "hTimer" hTimer.Delay = 100 hTimer.Enabled = TRUE hProc = NEW ServerSocket hProc.Port = 30000 hProc.Listen() DO WHILE TRUE WAIT 0.01 LOOP END ...It can be fixed if I use WAIT 0.1 instead of 0.01, but in that case the program is idle a lot of time sleeping... I'm not sure if this is a bug or the normal effect of looping in short intervals. =========================================================================== Anyway, there are two main problems there: 1) A program with a timer should wait until the Timer is disabled. 2) A program with a descriptor beeing watched (ServerSocket) works, but if I add a timer it just finishes... I made a temporally hack in the gbx_process.c file, so it waits when there's a timer, and the program with the ServerSocket does not need the loop, but I suppose there's more work to do it in the right way: static bool do_loop(bool canBlock, struct timeval *wait) { .... if (EVENT_check_post()) return FALSE; /* Hack */ if (_timers) { if (ARRAY_count(_timers)) { ret=TRUE; } } /* End of hack :-) */ return ret == 0; } Regards, D. Campos From gambasfr at ...4... Wed Sep 7 22:21:06 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Wed, 7 Sep 2005 22:21:06 +0200 Subject: [Gambas-devel] ABout Scan keyword Message-ID: <200509072221.06656.gambasfr@...4...> hi Benoit After some test on the scan keyword, i think i've understand the system it seem to be one var for one '*' but if you can set the doc of it on the gambas help site... it can help... it seem to have a problem... if i put a form with 2 field one for the string and one for the pattern.. how can i dynamiquely set the number of variable ? is a string array not be better ? SCAN MyString WITH MyPattern TO String[] Then i can test the string.count... and see if i have result What is the goal of this keyword... in your mind ? is it a try to implement regexp as native in gambas like php ? Regards, Fabien Bodard From gambas at ...1... Sat Sep 10 12:56:42 2005 From: gambas at ...1... (Benoit Minisini) Date: Sat, 10 Sep 2005 12:56:42 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: References: Message-ID: <200509101256.42430.gambas@...1...> On Sunday 04 September 2005 13:27, danielcampos at ...45... wrote: > Hi Benoit: > > Well, first of all, sorry if I was too rude, may be it was not a good day > for me :-( No problem :-) > > The main problem is that from time to time, there are changes (for example > the EXEC and OPEN syntax) that seems to not have a practical sense, just > may be to make it more beautiful, but breaks existing code, and also some > changes related to the gb.qt component, just have broken the code I've > written for gb.gtk. May be these changes should be reported while you?re > writting them, instead of waiting to release a version and just tell > "surprise, I've changed that...". You are right - Now I will try to tell the changes I want to make long before I do them. > > I mean I'm writting the gb.gtk with many problems, as GTK+ just provides > the half of help that QT provides to the programmer. I know that your work is harder because of that lack of help... > May be you need 10 > lines of code, but I need 100 to perform the same feature. Actually, I think the harder thing is making the equivalent of the follwoing QT feature: the event filters. This is a method in a class that catch all events sent to an object (a widget), before the widget catches it, and that can modify them. There is a global event filter too, that catches all event sent to an application. But I find QT GUi library and GTK+ library converging in features. So things may become easier with time... > So finding from > version to version that I must change what I've done is frustating, and > makes more slow not only the gb.gtk developement, but all the testing > platform (for example the Debian packages) that we are trying to provide > for Gambas. > > May be some mails from you while writting a new version, and a little > roadmad: "I'll try to do it for the next version a) b) c)"... would be > enough at this moment. May be we could help you too with a CVS service... > > Regards, > > D. Campos > I try as much as possible (I don't have a great knowledge of gtk+) not using too specific QT features. So if you find something impossible to do in GTK+, or too complicated, tell me. Maybe I can change things in QT component. The aim is having exact similar behaviour. I can remove features in the QT component if needed. Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Sat Sep 10 12:58:22 2005 From: gambas at ...1... (Benoit Minisini) Date: Sat, 10 Sep 2005 12:58:22 +0200 Subject: [Gambas-devel] ABout Scan keyword In-Reply-To: <200509072221.06656.gambasfr@...4...> References: <200509072221.06656.gambasfr@...4...> Message-ID: <200509101258.22996.gambas@...1...> On Wednesday 07 September 2005 22:21, Fabien Bodard wrote: > hi Benoit > > After some test on the scan keyword, i think i've understand the system > > it seem to be one var for one '*' but if you can set the doc of it on the > gambas help site... it can help... > > it seem to have a problem... > if i put a form with 2 field one for the string and one for the pattern.. > how can i dynamiquely set the number of variable ? > > is a string array not be better ? > > SCAN MyString WITH MyPattern TO String[] > > Then i can test the string.count... > and see if i have result > > What is the goal of this keyword... in your mind ? > > is it a try to implement regexp as native in gambas like php ? > > Regards, > Fabien Bodard > You are right... I think this keyword will be replaced by a native routine, that will return a String array. It worked like that when I implemented it first. This keyword is just a try, so there is no reason to document it immediately. Regards, -- Benoit Minisini mailto:gambas at ...1... From kryskool at ...342... Sat Sep 10 12:50:09 2005 From: kryskool at ...342... (Christophe) Date: Sat, 10 Sep 2005 12:50:09 +0200 (CEST) Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <200509101256.42430.gambas@...1...> References: <200509101256.42430.gambas@...1...> Message-ID: <20050910105009.5B35D6036@...343...> L'email que vous venez de m'envoyer est au Format HTML, Je serais dans l'impossibilt? de le lire, merci de configurer votre client mail afin de m'envoyer un mail au format texte pure. Il n'y a que des avantages a envoy? des E-mails au format texte: - Le mail est jusqu'a 40 Fois plus l?ger. - Aucun risque de phishing (usurpation d'identit?) - Pas de risque de code mailicieux qui s'execute a votre insu. - Agr?able a lire :) Merci de tenir compte de ces recommendations lors de nos prochains ?changes. **************************************************************************************************** * CE MESSAGE EST GENERE AUTOMATIQUEMENT, ET SERA ENVOYE CHAQUE FOIS QU'UN MAIL EN HTML EST DETECTE * **************************************************************************************************** From kryskool at ...342... Sat Sep 10 13:13:52 2005 From: kryskool at ...342... (Christophe Chauvet) Date: Sat, 10 Sep 2005 13:13:52 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <20050910105009.5B35D6036@...343...> References: <200509101256.42430.gambas@...1...> <20050910105009.5B35D6036@...343...> Message-ID: <20050910111352.GA17237@...342...> Excus? du d?rangement mon procmail se m?lange les pinceaux quand y'a plusieurs mail en m?me temps, dont un est en HTML :( Christophe. On Sat, Sep 10, 2005 at 12:50:09PM +0200, Christophe wrote : > L'email que vous venez de m'envoyer est au Format HTML, Je serais dans l'impossibilt? de le lire, > merci de configurer votre client mail afin de m'envoyer un mail au format texte pure. > > Il n'y a que des avantages a envoy? des E-mails au format texte: > - Le mail est jusqu'a 40 Fois plus l?ger. > - Aucun risque de phishing (usurpation d'identit?) > - Pas de risque de code mailicieux qui s'execute a votre insu. > - Agr?able a lire :) > > Merci de tenir compte de ces recommendations lors de nos prochains ?changes. > > **************************************************************************************************** > * CE MESSAGE EST GENERE AUTOMATIQUEMENT, ET SERA ENVOYE CHAQUE FOIS QU'UN MAIL EN HTML EST DETECTE * > **************************************************************************************************** > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Christophe Chauvet (aka krysKool) < http://www.kryskool.org/ > Pr?sident d'Ornix < http://www.ornix.org/ > Projet de Gestion commerciale < http://www.opengescom.org/ > Membre de PostgreSQLFr < http://postgresqlfr.org/ > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From kryskool at ...342... Sat Sep 10 13:20:06 2005 From: kryskool at ...342... (Christophe) Date: Sat, 10 Sep 2005 13:20:06 +0200 (CEST) Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <20050910111352.GA17237@...342...> References: <200509101256.42430.gambas@...1...> <20050910105009.5B35D6036@...343...> <20050910111352.GA17237@...342...> Message-ID: <20050910112006.B33856036@...343...> L'email que vous venez de m'envoyer est au Format HTML, Je serais dans l'impossibilt? de le lire, merci de configurer votre client mail afin de m'envoyer un mail au format texte pure. Il n'y a que des avantages a envoy? des E-mails au format texte: - Le mail est jusqu'a 40 Fois plus l?ger. - Aucun risque de phishing (usurpation d'identit?) - Pas de risque de code mailicieux qui s'execute a votre insu. - Agr?able a lire :) Merci de tenir compte de ces recommendations lors de nos prochains ?changes. **************************************************************************************************** * CE MESSAGE EST GENERE AUTOMATIQUEMENT, ET SERA ENVOYE CHAQUE FOIS QU'UN MAIL EN HTML EST DETECTE * **************************************************************************************************** From gambasfr at ...4... Sun Sep 11 00:29:53 2005 From: gambasfr at ...4... (Fabien Bodard) Date: Sun, 11 Sep 2005 00:29:53 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Re: BIG BUG in gb 1.9.19 In-Reply-To: <20050910111352.GA17237@...342...> References: <20050910105009.5B35D6036@...343...> <20050910111352.GA17237@...342...> Message-ID: <200509110029.54002.gambasfr@...4...> in english please From gambas at ...345... Mon Sep 12 22:55:27 2005 From: gambas at ...345... (Guido Ostkamp) Date: Mon, 12 Sep 2005 22:55:27 +0200 (CEST) Subject: [Gambas-devel] Bug in gambas2-1.9.20 installation Message-ID: Hello, I would like to report a bug in the gambas2-1.9.20 installation. I'm testing my software as a seperate user 'testuser' before installing it to the regular locations. So I did this: $ cd /home/testuser $ tar xvjf /tmp/gambas2-1.9.20.tar.bz2 $ cd gambas2-1.9.20 $ ./configure --prefix=/home/testuser/local $ make $ make install The installation script finished, but the effects were as follows: ... ln: creating symbolic link `/usr/bin/gambas2' to `/home/testuser/local/bin/gambas2.gambas': Permission denied ... It's clear that this link should have been created in /home/testuser/local/bin. I tried that, but then ... $ cd /home/testuser/local/bin $ ln -s gambas2.gambas gambas2 $ ./gambas2 zsh: no such file or directory: ./gambas2 ... it failed. I checked 'gambas2.gambas' and found $ head gambas2.gambas #!/usr/bin/gbx2 -x ....# Gambas Project File 1.0 ... This is also wrong. /usr/bin/gbx2 should not be in here as it does not exist. Ah, btw. here is my environment: SuSE Linux 9.3 Prof., and an earlier version of gambas was installed as SuSE package at standard locations. However, this should not have any influence. I would appreciate if these bugs could be fixed. Thanx in advance, Guido From lordheavy at ...141... Mon Sep 12 23:01:59 2005 From: lordheavy at ...141... (Laurent Carlier) Date: Mon, 12 Sep 2005 23:01:59 +0200 Subject: [Gambas-devel] Bug in gambas2-1.9.20 installation In-Reply-To: References: Message-ID: <4325ECC7.7000305@...141...> Guido Ostkamp a ?crit : > Hello, > > I would like to report a bug in the gambas2-1.9.20 installation. > > I'm testing my software as a seperate user 'testuser' before installing it > to the regular locations. So I did this: > > $ cd /home/testuser > $ tar xvjf /tmp/gambas2-1.9.20.tar.bz2 > $ cd gambas2-1.9.20 > $ ./configure --prefix=/home/testuser/local > $ make > $ make install > > The installation script finished, but the effects were as follows: > > ... ln: creating symbolic link `/usr/bin/gambas2' to > `/home/testuser/local/bin/gambas2.gambas': Permission denied > ... > > It's clear that this link should have been created in > /home/testuser/local/bin. I tried that, but then ... > > $ cd /home/testuser/local/bin > $ ln -s gambas2.gambas gambas2 > $ ./gambas2 > zsh: no such file or directory: ./gambas2 > > ... it failed. I checked 'gambas2.gambas' and found > > $ head gambas2.gambas > #!/usr/bin/gbx2 -x > > ....# Gambas Project File 1.0 > ... > > This is also wrong. /usr/bin/gbx2 should not be in here as it does not > exist. > > Ah, btw. here is my environment: SuSE Linux 9.3 Prof., and an earlier > version of gambas was installed as SuSE package at standard locations. > However, this should not have any influence. > > I would appreciate if these bugs could be fixed. > > Thanx in advance, > > Guido Perhaps su -c 'make install' work better ? Regards, -- Laurent Carlier jabber : LordHeavy at ...298... From gambas at ...345... Mon Sep 12 23:10:49 2005 From: gambas at ...345... (Guido Ostkamp) Date: Mon, 12 Sep 2005 23:10:49 +0200 (CEST) Subject: [Gambas-devel] Gambas 1.0.11 installation bug Message-ID: Hello, I just reported a bug against gambas2 in another mail. Here is the almost similar problem with gambas 1.0.11: $ cd /home/testuser $ tar xvjf /tmp/gambas-1.0.11.tar.bz2 $ cd gambas-1.0.11 $ ./configure --prefix=/home/testuser/local $ make $ make install fails with Making symbolic links in /usr/bin... rm: cannot remove `/usr/bin/gbx': Permission denied ln: creating symbolic link `/usr/bin/gbx' to `/home/testuser/local/bin/gbx': File exists rm: cannot remove `/usr/bin/gbc': Permission denied ln: creating symbolic link `/usr/bin/gbc' to `/home/testuser/local/bin/gbc': File exists rm: cannot remove `/usr/bin/gba': Permission denied ln: creating symbolic link `/usr/bin/gba' to `/home/testuser/local/bin/gba': File exists rm: cannot remove `/usr/bin/gbi': Permission denied ln: creating symbolic link `/usr/bin/gbi' to `/home/testuser/local/bin/gbi': File exists make[2]: *** [install-exec-local] Error 1 make[2]: Leaving directory `/home/testuser/gambas-1.0.11' make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/home/testuser/gambas-1.0.11' make: *** [install-recursive] Error 1 The 'file exists' is because I have another older installation in the /usr/bin etc. directories. This however, should have no influence, as I have ordered to place everything under /home/testuser/local. I would appreciate, if this bug could be fixed in the next release. Thanx in advance, Guido From gambas at ...345... Mon Sep 12 23:19:38 2005 From: gambas at ...345... (Guido Ostkamp) Date: Mon, 12 Sep 2005 23:19:38 +0200 (CEST) Subject: [Gambas-devel] Bug in gambas2-1.9.20 installation In-Reply-To: <4325ECC7.7000305@...141...> References: <4325ECC7.7000305@...141...> Message-ID: Hello Laurent, > Perhaps su -c 'make install' work better ? no, the general configure-options with '--prefix=...' as well as with '--exec_prefix=...' or '--bindir=...' is explicitly designed to allow for different installation pathes and should be honored. This provides the possibility to install software into your private homedirectory on machines, where you are only a user, and do not have admin rights. Regards, Guido From gambas at ...1... Tue Sep 13 11:51:09 2005 From: gambas at ...1... (Benoit Minisini) Date: Tue, 13 Sep 2005 11:51:09 +0200 Subject: [Gambas-devel] 1.9.20 Timer Bug In-Reply-To: <1126076693.5945.22.camel@...341...> References: <1126076693.5945.22.camel@...341...> Message-ID: <200509131151.09942.gambas@...1...> On Wednesday 07 September 2005 09:04, Daniel Campos wrote: > I Benoit: > > I've found some strange things with the new native timer implementation: > > 1) I'm not sure if this first one is a bug, but if you write just a > console program like this: > > > PRIVATE hTimer AS Timer > > PUBLIC SUB hTimer_Timer() > > PRINT "HELLO" > > END > > PUBLIC SUB Main() > > hTimer=NEW Timer AS "hTimer" > hTimer.Delay=100 > hTimer.Enabled=TRUE > > END > > The program just exits from the Main() function and stops. I think It > should be alive, like if a descriptor were beeing watched, in order to > allow console programs with timers to not finish in a loop while they're > alive... > > =========================================================================== >============ > > 2) I think this second one is a bug, but I'm not sure if it depends on > gb.net or the gbx2 interpreter. This little program works, with gb.net, > as expected (it never finishes): > > PRIVATE hProc AS ServerSocket > > PUBLIC SUB Main() > > hProc = NEW ServerSocket > hProc.Port = 30000 > hProc.Listen() > > END > > ...But, if I add a Timer, it stops inmediatly! > > PRIVATE hProc AS ServerSocket > PRIVATE hTimer AS Timer > > PUBLIC SUB hTimer_Timer() > > PRINT "TIME" > > END > > PUBLIC SUB Main() > > hTimer = NEW Timer AS "hTimer" > hTimer.Delay = 100 > hTimer.Enabled = TRUE > > hProc = NEW ServerSocket > hProc.Port = 30000 > hProc.Listen() > > END > > Should I implement some special in the gb.net component? I suppose I > have not to reimplement the timer hook, as I have not main loop in > that component... However, If I use a Process with the "FOR READ" flag > instead of a ServerSocket, the code seems to work normally while there's > data to be read from the descriptor. > > > =========================================================================== >=========== > > 3) More strange things :-) If I try to write a loop at the end of the > main function so the program does not finish, the processor takes 100% > use: > > PRIVATE hProc AS ServerSocket > PRIVATE hTimer AS Timer > > PUBLIC SUB hTimer_Timer() > > PRINT "TIME" > > END > > PUBLIC SUB Main() > > hTimer = NEW Timer AS "hTimer" > hTimer.Delay = 100 > hTimer.Enabled = TRUE > > hProc = NEW ServerSocket > hProc.Port = 30000 > hProc.Listen() > > DO WHILE TRUE > WAIT 0.01 > LOOP > > END > > ...It can be fixed if I use WAIT 0.1 instead of 0.01, but in that case > the program is idle a lot of time sleeping... I'm not sure if this is > a bug or the normal effect of looping in short intervals. > > =========================================================================== > > Anyway, there are two main problems there: > > 1) A program with a timer should wait until the Timer is disabled. > 2) A program with a descriptor beeing watched (ServerSocket) works, but > if I add a timer it just finishes... > > > I made a temporally hack in the gbx_process.c file, so it waits when > there's a timer, and the program with the ServerSocket does not need > the loop, but I suppose there's more work to do it in the right way: > > static bool do_loop(bool canBlock, struct timeval *wait) > { > > .... > > if (EVENT_check_post()) > return FALSE; > > /* Hack */ > if (_timers) > { > if (ARRAY_count(_timers)) > { > ret=TRUE; > } > } > /* End of hack :-) */ > > return ret == 0; > } > > > > Regards, > > D. Campos > Hi, Daniel. Actually, the halt test of this do_loop() function was completely broken! I rewrote it correctly, and every bad bevahiour you noticed disappeared :-) Now the event loop stops only if there is no active watched file descriptors, AND no active timers. Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Tue Sep 13 11:54:41 2005 From: gambas at ...1... (Benoit Minisini) Date: Tue, 13 Sep 2005 11:54:41 +0200 Subject: [Gambas-devel] Gambas 1.0.11 installation bug In-Reply-To: References: Message-ID: <200509131154.41293.gambas@...1...> On Monday 12 September 2005 23:10, Guido Ostkamp wrote: > Hello, > > I just reported a bug against gambas2 in another mail. > Here is the almost similar problem with gambas 1.0.11: > > $ cd /home/testuser > $ tar xvjf /tmp/gambas-1.0.11.tar.bz2 > $ cd gambas-1.0.11 > $ ./configure --prefix=/home/testuser/local > $ make > $ make install > > fails with > > Making symbolic links in /usr/bin... > rm: cannot remove `/usr/bin/gbx': Permission denied > ln: creating symbolic link `/usr/bin/gbx' to > `/home/testuser/local/bin/gbx': File exists > rm: cannot remove `/usr/bin/gbc': Permission denied > ln: creating symbolic link `/usr/bin/gbc' to > `/home/testuser/local/bin/gbc': File exists > rm: cannot remove `/usr/bin/gba': Permission denied > ln: creating symbolic link `/usr/bin/gba' to > `/home/testuser/local/bin/gba': File exists > rm: cannot remove `/usr/bin/gbi': Permission denied > ln: creating symbolic link `/usr/bin/gbi' to > `/home/testuser/local/bin/gbi': File exists > make[2]: *** [install-exec-local] Error 1 > make[2]: Leaving directory `/home/testuser/gambas-1.0.11' > make[1]: *** [install-am] Error 2 > make[1]: Leaving directory `/home/testuser/gambas-1.0.11' > make: *** [install-recursive] Error 1 > > The 'file exists' is because I have another older installation in the > /usr/bin etc. directories. This however, should have no influence, as I > have ordered to place everything under /home/testuser/local. > > I would appreciate, if this bug could be fixed in the next release. > > Thanx in advance, > > Guido > Gambas needs a symbolic link in /usr/bin to work. So /usr/bin/gbx for gambas 1.0.x and /usr/bin/gbx2 for gambas 1.9.x. Because of the '#!/usr/bin/gbx2 -x' stuff at the beginning of each executable. The other symbolic links are not needed, and may be removed in a next release. If you can find a way not doing this, I will take it. But until now, I found no way to avoid this symbolic link. Regards, -- Benoit Minisini mailto:gambas at ...1... From rjek at ...347... Tue Sep 13 16:05:19 2005 From: rjek at ...347... (Rob Kendrick) Date: Tue, 13 Sep 2005 15:05:19 +0100 Subject: [Gambas-devel] Gambas 1.0.11 installation bug In-Reply-To: <200509131154.41293.gambas@...1...> References: <200509131154.41293.gambas@...1...> Message-ID: <1126620319.9262.17.camel@...326...> On Tue, 2005-09-13 at 11:54 +0200, Benoit Minisini wrote: > Gambas needs a symbolic link in /usr/bin to work. So /usr/bin/gbx for gambas > 1.0.x and /usr/bin/gbx2 for gambas 1.9.x. Because of the '#!/usr/bin/gbx2 -x' > stuff at the beginning of each executable. Another solution, which is more elegant than this way away, is one I suggested many months ago: Generate real executables that consist of a stub that dlopens a shared object version of the interpreter, and passes it the bytecode contained within. This also gives you versioning of runtimes and such in a much more elegant way. The only disadvantage this has is that you have to have a real linker available. I don't think it's all that likely that somebody developing software on their machine, even if it is in Gambas, won't have one of those. > The other symbolic links are not needed, and may be removed in a next release. > > If you can find a way not doing this, I will take it. But until now, I found > no way to avoid this symbolic link. The traditional way of getting around this is to use #!/usr/bin/env instead. (ie, #!/usr/bin/env gbx2, such that the gbx2 executable can be anywhere, as long as it is pointed to by the PATH environment variable.) -- Rob Kendrick From rjek at ...347... Tue Sep 13 16:43:03 2005 From: rjek at ...347... (Rob Kendrick) Date: Tue, 13 Sep 2005 15:43:03 +0100 Subject: [Gambas-devel] Building 1.9.20 under Ubuntu 5.04 / AMD64 Message-ID: <1126622583.9262.22.camel@...326...> Hi, Having trouble building Gambas here, on an AMD64 box with Ubuntu 5.04. Developement packages I installed before I started are: libx11-dev postgresql-dev libmysqlclient14-dev libsqlite3-dev libcurl3-dev libsdl-dev libsdl-mixer1.2-dev libxml-dev libxslt-dev libgtk2.0-dev kdebase-dev kdelibs4-dev libqt3-mt-dev libarts1-dev First attempt at building (http://www.rjek.com/original.txt.gz) results in failures with PCRE. Second attempt with --disable-pcre (http://www.rjek.com/no-pcre.txt.gz) generates failures when installing (segmentation fault.) Looking at the warnings that go by, might this be a bug caused by assumptions that are no longer true on AMD64? -- Rob Kendrick From danielcampos at ...45... Tue Sep 13 18:16:21 2005 From: danielcampos at ...45... (danielcampos at ...45...) Date: Tue, 13 Sep 2005 18:16:21 +0200 Subject: [Gambas-devel] Building 1.9.20 under Ubuntu 5.04 / AMD64 Message-ID: Benoit is working just now to adapt Gambas to AMD-64, so I suppose it will work in the next versions... Regards, D. Campos ------------------------------------------------------------- NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Web/Wap : www.netcourrier.com T?l?phone/Fax : 08 92 69 00 21 (0,34 ? TTC/min) Minitel: 3615 NETCOURRIER (0,16 ? TTC/min) From sourceforge-raindog2 at ...19... Tue Sep 13 18:33:14 2005 From: sourceforge-raindog2 at ...19... (Rob Kudla) Date: Tue, 13 Sep 2005 12:33:14 -0400 Subject: [Gambas-devel] Gambas 1.0.11 installation bug In-Reply-To: <200509131154.41293.gambas@...1...> References: <200509131154.41293.gambas@...1...> Message-ID: <200509131233.16864.sourceforge-raindog2@...19...> On Tue September 13 2005 05:54, Benoit Minisini wrote: > If you can find a way not doing this, I will take it. But until > now, I found no way to avoid this symbolic link. Well, the most obvious way is to put the interpreter into a library and give /usr/bin/gbx(2) and each Gambas executable a stub that just passes the arguments to some function in that library. In the case of the Gambas executable, you could add a pointer to the p-code that lies within the executable. I know it's more complicated than just putting #!... followed by the p-code (and I have no idea how to actually do it myself) but I really think it would enable us to do some cooler stuff down the road. Rob From sourceforge-raindog2 at ...19... Tue Sep 13 18:37:54 2005 From: sourceforge-raindog2 at ...19... (Rob Kudla) Date: Tue, 13 Sep 2005 12:37:54 -0400 Subject: [Gambas-devel] Building 1.9.20 under Ubuntu 5.04 / AMD64 In-Reply-To: <1126622583.9262.22.camel@...326...> References: <1126622583.9262.22.camel@...326...> Message-ID: <200509131237.58267.sourceforge-raindog2@...19...> On Tue September 13 2005 10:43, Rob Kendrick wrote: > First attempt at building (http://www.rjek.com/original.txt.gz) > results in failures with PCRE. Second attempt with --disable-pcre > (http://www.rjek.com/no-pcre.txt.gz) generates failures when > installing (segmentation fault.) > > Looking at the warnings that go by, might this be a bug caused by > assumptions that are no longer true on AMD64? Gambas is DEFINITELY not 64-bit safe at present. I have to plead no contest as far as gb.pcre goes, too, because I only just bought my first amd64 box and it's sitting in its box still due to a lack of free time. Rob From gambas at ...345... Tue Sep 13 19:08:55 2005 From: gambas at ...345... (Guido Ostkamp) Date: Tue, 13 Sep 2005 19:08:55 +0200 (CEST) Subject: [Gambas-devel] Gambas 1.0.11 installation bug In-Reply-To: <200509131154.41293.gambas@...1...> References: <200509131154.41293.gambas@...1...> Message-ID: Benoit, > Gambas needs a symbolic link in /usr/bin to work. So /usr/bin/gbx for > gambas 1.0.x and /usr/bin/gbx2 for gambas 1.9.x. Because of the > '#!/usr/bin/gbx2 -x' stuff at the beginning of each executable. > > The other symbolic links are not needed, and may be removed in a next > release. > > If you can find a way not doing this, I will take it. But until now, I > found no way to avoid this symbolic link. the '#!/usr/bin/gbx2 -x' stuff at the beginning is created by Gambas itself when it creates the executable. Gambas is compiled with the knowledge of what has been provided in the "--prefix=..." option - this should be available as header file. So, where is the problem, to have Gambas compiled in a way that it creates '#!/home/testuser/local/bin/gbx2 -x' entries for the binaries, which would be correct for my installation? This is the way used by nearly all OpenSource applications which work with 'configure' - have it include the configured pathes in the binaries & libraries for further use. Another more generic way would be to use '#!/usr/bin/env gbx2' as somebody else has already pointed out. Regards, Guido From csorda at ...69... Mon Sep 19 19:44:35 2005 From: csorda at ...69... (csorda@libero.it) Date: Mon, 19 Sep 2005 19:44:35 +0200 Subject: [Gambas-devel] Gambas 1.0.11 installation bug Message-ID: hi, this error appears when I make distribution package. Executing(%prep): /bin/sh -e /home/user/csorda/RPM/tmp/rpm-tmp.50479 + umask 022 + cd /home/user/csorda/RPM/BUILD + rm -rf /home/user/csorda/RPM/tmp/doprocessor-buildroot + cd /home/user/csorda/RPM/BUILD + rm -rf DOProcessor + /usr/bin/bzip2 -dc /home/user/csorda/RPM/SOURCES/doprocessor-1.0.tar.bz2 + tar -xf - tar: DOProcessor/icons: implausibly old time stamp 1970-01-01 01:00:00 tar: DOProcessor/logs: implausibly old time stamp 1970-01-01 01:00:00 tar: DOProcessor/help: implausibly old time stamp 1970-01-01 01:00:00 + STATUS=0 + '[' 0 -ne 0 ']' + cd DOProcessor + exit 0 Executing(%build): /bin/sh -e /home/user/csorda/RPM/tmp/rpm-tmp.74253 + umask 022 + cd /home/user/csorda/RPM/BUILD + cd DOProcessor + /usr/local/bin/gbc2 -a -t OK + gba + exit 0 Executing(%install): /bin/sh -e /home/user/csorda/RPM/tmp/rpm-tmp.18380 + umask 022 + cd /home/user/csorda/RPM/BUILD + cd DOProcessor + install -d /home/user/csorda/RPM/tmp/doprocessor-buildroot/usr/bin + install -p DOProcessor /home/user/csorda/RPM/tmp/doprocessor-buildroot/usr/bin/doprocessor install: cannot stat `DOProcessor': No such file or directory error: Bad exit status from /home/user/csorda/RPM/tmp/rpm-tmp.18380 (%install) RPM build errors: Bad exit status from /home/user/csorda/RPM/tmp/rpm-tmp.18380 (%install) Can you help me? From nigel at ...2... Tue Sep 20 20:33:13 2005 From: nigel at ...2... (nigel at ...2...) Date: Tue, 20 Sep 2005 20:33:13 +0200 (CEST) Subject: [Gambas-devel] Inability to change table data within Datamanager 1.9.20 Message-ID: <9928316.1127241193479.JavaMail.www@...207...> Benoit, I've just noticed that data cannot be changed for the latest development version of the database manager. When comparing to the stable release 1.0.11 (which does work), I note that the function WriteData in FData.class is slightly different. When reapplying the differences, the change of data works; e.g. WITH tbvData Connection.Handle.Begin $rData.MoveFirst FOR EACH $rData =========================> Remove this line! FOR iInd = 0 TO $rData.Count - 1 =================>Add This line IF $cDelete.Exist(iInd) THEN $rData.Delete ELSE IF $cData.Exist(iInd) THEN FOR EACH vVal IN $cData[iInd] sField = $cData[iInd].Key IF IsObject(Vval) THEN $rData[sField] = NULL ELSE $rData[sField] = vVal ENDIF NEXT $rData.Update ENDIF $rData.MoveNext ===========================> Add this line NEXT regards Nigel From daniel at ...318... Thu Sep 22 22:14:30 2005 From: daniel at ...318... (Daniel) Date: Thu, 22 Sep 2005 22:14:30 +0200 Subject: [Gambas-devel] driver for firebird Message-ID: <433310A6.2000009@...318...> hi benoit i've just finished with the driver for firebird, where upload the code please daniel From gambas at ...1... Sun Sep 25 15:59:14 2005 From: gambas at ...1... (Benoit Minisini) Date: Sun, 25 Sep 2005 15:59:14 +0200 Subject: [Gambas-devel] driver for firebird In-Reply-To: <433310A6.2000009@...318...> References: <433310A6.2000009@...318...> Message-ID: <200509251559.14686.gambas@...1...> On Thursday 22 September 2005 22:14, Daniel wrote: > hi benoit > i've just finished with the driver for firebird, where upload the code > please > > daniel > If the code is not too important (tar.gz size < 256K) , just post it on the devel mailing-list. Otherwise, find a server on the internet, put your source in, and send us a link on the mailing-list. Regards, -- Benoit Minisini mailto:gambas at ...1... From daniel at ...318... Tue Sep 27 01:59:22 2005 From: daniel at ...318... (Daniel) Date: Tue, 27 Sep 2005 01:59:22 +0200 Subject: [Gambas-devel] driver for firebird In-Reply-To: <200509251559.14686.gambas@...1...> References: <433310A6.2000009@...318...> <200509251559.14686.gambas@...1...> Message-ID: <43388B5A.2040507@...318...> Benoit Minisini wrote: >On Thursday 22 September 2005 22:14, Daniel wrote: > > >>hi benoit >>i've just finished with the driver for firebird, where upload the code >>please >> >>daniel >> >> >> > >If the code is not too important (tar.gz size < 256K) , just post it on the >devel mailing-list. Otherwise, find a server on the internet, put your source >in, and send us a link on the mailing-list. > >Regards, > > > ok the code is on ftp://littlesaigon.homedns.org/gb.db.firebird.tar.gz daniel