From jdsantos1978 at ...626... Sat Apr 1 01:08:01 2006 From: jdsantos1978 at ...626... (Dani Santos) Date: Sat, 01 Apr 2006 01:08:01 +0200 Subject: [Gambas-user] Bug executing SQLs containing Ampersands ? Message-ID: <1143846481.9124.0.camel@...1222...> This might be resolved cause I'm currently using 1.9.20 but, 'por si las moscas' (anyway) ... I'm working against a mysql 4.0.24 database. One of the tables of my database is created with the following code: --------------------------------------------------------------------- PRIVATE FUNCTION createTableTemasPreguntas() AS String DIM sql AS String sql = "CREATE TABLE `preguntas` (" sql = sql & "`id` INT UNSIGNED NOT NULL ," sql = sql & "`idApartado` INT UNSIGNED NOT NULL ," sql = sql & "`idUsuario` INT UNSIGNED NOT NULL ," sql = sql & "`fecha` DATE NOT NULL ," sql = sql & "`pregunta` TEXT NOT NULL ," sql = sql & "`observaciones` TEXT NULL ," sql = sql & "`resAleatorias` TINYINT NOT NULL ," sql = sql & "`comprobada` TINYINT NOT NULL ," sql = sql & "`fechaUltimaModificacion` DATE NOT NULL ," sql = sql & "PRIMARY KEY( `id` ) ," sql = sql & "INDEX( `idApartado` )" sql = sql & ")TYPE = innodb;" RETURN sql END --------------------------------------------------------------------- I modify records to this database with the following procedure (I add records with a similar one): --------------------------------------------------------------------- PUBLIC SUB Tests_Modificar(IdPregunta AS Long, IdApartado AS Long, Fecha AS Date, Pregunta AS String, Observaciones AS String, respuestasAleatorias AS Boolean, comprobada AS Boolean, exportable AS Boolean) ' ' Creado el 03/03/2003 por Daniel. ' Modificaciones: ' - 16/09/2003 Se a?ade el par?metro respuestasAleatorias y se a?ade en la SQL. ' DIM strSQL AS String DIM intResAleatorias AS Integer DIM intComprobada AS Integer DIM intExportable AS Integer ' Valor que toma esta variable. ?nicamente para construir la SQL. intResAleatorias = 0 IF respuestasAleatorias THEN intResAleatorias = 1 intComprobada = 0 IF comprobada THEN intComprobada = 1 intExportable = 0 IF exportable THEN intExportable = 1 strSQL = " UPDATE preguntas SET " strSQL = strSQL & " idApartado = " & IdApartado & ", " strSQL = strSQL & " fecha = '" & Format(Fecha, "yyyy/mm/dd") & "', " strSQL = strSQL & " pregunta = '" & Trim(Pregunta) & "', " strSQL = strSQL & " observaciones = '" & Trim(Observaciones) & "', " strSQL = strSQL & " resAleatorias = " & intResAleatorias & ", " strSQL = strSQL & " comprobada = " & intComprobada & ", " strSQL = strSQL & " exportable = " & intExportable & ", " strSQL = strSQL & " fechaUltimaModificacion = CURDATE() " strSQL = strSQL & "WHERE id = " & Str(idPregunta) m_db.Exec(strSQL) END SUB --------------------------------------------------------------------- I've found out that if the 'Pregunta' variable contains an ampersand (&), I must add an ampersand at the beginning of the variable or it will not appear at the database when the SQL is executed. This is not neccesary with the 'Observaciones' variable. On the other hand, if 'Pregunta' variable DOES NOT contains and ampersand (&) and the 'Observaciones' variable DO contains it, the ampersand at the 'Observaciones' variable will not appear at the database when the SQL is executed. This happens either adding or updating records. I've provissionaly solved it with the following code before creating the SQL statements: --------------------------------------------------------------------- ' Posible bug de Gambas? Quitar cdo se resuelva: IF InStr(Pregunta, "&") <> 0 OR InStr(Observaciones, "&") <> 0 THEN Pregunta = "&" & Pregunta ENDIF --------------------------------------------------------------------- Regards. -- Dani Santos From ronstk at ...239... Sat Apr 1 10:35:44 2006 From: ronstk at ...239... (ron) Date: Sat, 1 Apr 2006 10:35:44 +0200 Subject: [Gambas-user] Bug executing SQLs containing Ampersands ? In-Reply-To: <1143846481.9124.0.camel@...1222...> References: <1143846481.9124.0.camel@...1222...> Message-ID: <200604011035.44898.ronstk@...239...> On Saturday 01 April 2006 01:08, Dani Santos wrote: > ? sql = sql & "`pregunta` TEXT NOT NULL ," > ? sql = sql & "`observaciones` TEXT NULL ," > Here why the difference in behaviour with the ampersand If it is in then seams it try to write a NULL content and that is for 'pregunta' not allowed but for 'observaciones' OK. Yes you should update, this problem is between your version and latest detected by other and now supported. mails where at 8 and 9 feb 2006 From ronstk at ...239... Sat Apr 1 11:08:04 2006 From: ronstk at ...239... (ron) Date: Sat, 1 Apr 2006 11:08:04 +0200 Subject: [Gambas-user] 1.9.28 IDE doesn't come up In-Reply-To: <200603311525.48291.ronstk@...239...> References: <442A4E52.4080907@...221...> <442CDF02.1010800@...221...> <200603311525.48291.ronstk@...239...> Message-ID: <200604011108.04922.ronstk@...239...> On Friday 31 March 2006 15:25, ron wrote: > At the place you unpack gambas > > app <--- > spec > src <--- > doc.cgi > gambas2 <-- renme to 'gambas2-sdi' > gambas2-old <-- rename to 'gambas2-mdi' > gambas2-with-editor > comp > examples > ... > > do in direcrtory src a shortlink as: ln -s gambas2-mdi gambas2 > go back to > do 'make install' > Just did try myself for verify and it worked! I had to verify better. The link as gambas2 -> gambas2-xxx makes gambas2-xxx as runtime instead of gambas2. Idea to do it twice, once link to -sdi and once to -mdi Then you could have two working versions to choose :) > > (Maybe a 'make install' in the 'app' directory works too, more quick) No this does not work --- Ron From arcalis.prod at ...11... Sat Apr 1 15:12:45 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 1 Apr 2006 15:12:45 +0200 Subject: [Gambas-user] About gambas new IDE Message-ID: <200604011512.45320.arcalis.prod@...11...> Hi, I'm come back ;-P I've tested the gambas 1.9.28 IDE... lol... nothing really new. But it's time i think for all of us to tell to you (Benoit), what are our dreams for this new IDE. So this is for my part my ideas: - First a fully dockable tool windows it's possible now with the reparent function to move windows childs everywhere we need. (so have the flexibility of gimp/adobe/ and some kde tools) - Single Mdichild editor or tabbed editor ? in my mind an editor need to be stored in a tabstrip... (okok i already heard some poeple tha say me ... i want to compare some time two codes... but i think there is certainly some possibilities. - I think the new ide will need to have a project conf file stored in the user confdir or directly in the project. - gambas need to have more and more drag and drop facilities. for example ? we a little intereting thing in qt and gtk toolkits... the stock function that link to standards icons from the current toolkit. so imagin you just have to click and drag to add a new picture in a button ? One off the first problem i see is the stock structure... it's not really gambas oriented. I explain : If i want an open icon in kde, it's not the same key than the gtk one ! I think a thing like a dictionary (hem), to traduce an user keyword will be better. sorry for this bad explanation. pic = Stock("open_file") I've trying to make a version for kde but i was not able to find automatiquely the current icon theme path. Always about editor facilities: ctrl + Click on a widjet will open an input windows to set the caption (more easy than search the text field in properties(maybe a shortcut will be sufficient). Ive mabe some others ideas... but i need to wait a little bit before talk about them... Maybe just one query to Benoit : Can you explain me exactly what was doing you report manager in vb ... (in private mail if you want) Now to other gambasian maybe have you some ideas to the future gambas ide... tell us:) Regards, Fabien Bodard From almanova at ...1228... Sat Apr 1 16:31:17 2006 From: almanova at ...1228... (Almanova Sistemi) Date: Sat, 01 Apr 2006 16:31:17 +0200 Subject: [Gambas-user] Delete an object In-Reply-To: <200604011512.45320.arcalis.prod@...11...> References: <200604011512.45320.arcalis.prod@...11...> Message-ID: <442E8EB5.8010408@...1228...> I delete a text area (TextArea.Delete). The on-line help says: Note that a destroyed control becomes an invalid object. How can I delete an object whitout an invalid object as result? Thank's Massimo From sourceforge-raindog2 at ...94... Sat Apr 1 19:03:37 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Sat, 1 Apr 2006 12:03:37 -0500 Subject: [Gambas-user] Delete an object In-Reply-To: <442E8EB5.8010408@...1228...> References: <200604011512.45320.arcalis.prod@...11...> <442E8EB5.8010408@...1228...> Message-ID: <200604011203.38322.sourceforge-raindog2@...94...> On Sat April 1 2006 09:31, Almanova Sistemi wrote: > I delete a text area (TextArea.Delete). The on-line help says: > Note that a destroyed control becomes an invalid object. > How can I delete an object whitout an invalid object as > result? You can assign null to the object reference, but either way it's going to throw an error if you access it without checking it first with isObject or something.... Rob From gambas at ...1... Sun Apr 2 01:13:18 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 2 Apr 2006 01:13:18 +0200 Subject: [Gambas-user] Delete an object In-Reply-To: <442E8EB5.8010408@...1228...> References: <200604011512.45320.arcalis.prod@...11...> <442E8EB5.8010408@...1228...> Message-ID: <200604020113.18526.gambas@...1...> On Saturday 01 April 2006 16:31, Almanova Sistemi wrote: > I delete a text area (TextArea.Delete). The on-line help says: Note that > a destroyed control becomes an invalid object. > How can I delete an object whitout an invalid object as result? > > Thank's > > Massimo > Why do you want to use something that does not exist anymore? :-) -- Benoit Minisini From stefanopalmeri at ...152... Sun Apr 2 02:14:08 2006 From: stefanopalmeri at ...152... (Stefano Palmeri) Date: Sun, 2 Apr 2006 02:14:08 +0200 Subject: [Gambas-user] 1.9.28 IDE doesn't come up In-Reply-To: <200604011108.04922.ronstk@...239...> References: <442A4E52.4080907@...221...> <200603311525.48291.ronstk@...239...> <200604011108.04922.ronstk@...239...> Message-ID: <200604020214.08976.stefanopalmeri@...152...> Alle 11:08, sabato 1 aprile 2006, ron ha scritto: > On Friday 31 March 2006 15:25, ron wrote: > > > > At the place you unpack gambas > > > > app <--- > > spec > > src <--- > > doc.cgi > > gambas2 <-- renme to 'gambas2-sdi' > > gambas2-old <-- rename to 'gambas2-mdi' > > gambas2-with-editor > > comp > > examples > > ... > > > > do in direcrtory src a shortlink as: ln -s gambas2-mdi gambas2 > > go back to > > do 'make install' > > Just did try myself for verify and it worked! > > I had to verify better. > The link as gambas2 -> gambas2-xxx makes gambas2-xxx as runtime > instead of gambas2. > > Idea to do it twice, once link to -sdi and once to -mdi > Then you could have two working versions to choose :) > > > > > > > (Maybe a 'make install' in the 'app' directory works too, more quick) > > No this does not work > > > --- > Ron Hi, Ron. cd in the directory .../gambas2-1.9.28/app/src/gambas2-old then run: gbc2 --all and then: gba2 you will have in that directory the executable "gambas2-old.gambas". Hope this help. Saluti, Stefano P.S. This works if gbc2 and gba2 were correctly installed. From ronstk at ...239... Sun Apr 2 09:41:21 2006 From: ronstk at ...239... (ron) Date: Sun, 2 Apr 2006 09:41:21 +0200 Subject: [Gambas-user] 1.9.28 IDE doesn't come up In-Reply-To: <200604020214.08976.stefanopalmeri@...152...> References: <442A4E52.4080907@...221...> <200604011108.04922.ronstk@...239...> <200604020214.08976.stefanopalmeri@...152...> Message-ID: <200604020941.22000.ronstk@...239...> On Sunday 02 April 2006 02:14, Stefano Palmeri wrote: > > --- > > Ron > > Hi, Ron. > > cd in the directory .../gambas2-1.9.28/app/src/gambas2-old > > then run: > > gbc2 --all > > and then: > > gba2 > > you will have in that directory the executable "gambas2-old.gambas". > > Hope this help. > > Saluti, > > Stefano > > P.S. This works if gbc2 and gba2 were correctly installed. > LOL I'm stupid :) I did know there must be a easy way but this one ?!?!?! That's to easy to think about :) From maillists at ...1367... Mon Apr 3 00:49:25 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sun, 02 Apr 2006 15:49:25 -0700 Subject: [Gambas-user] Controlling dynamic objects Message-ID: <1144018166.29643.4.camel@...1368...> I think I asked this question before and got the reply: "use LAST" This works in some instances but I was wondering if I could assign whatever object "LAST" is at that time to a temporary object name and access it's child controls as well? Something like: myobject = LAST.object myobject.listview1.clear or something like this? TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From sourceforge-raindog2 at ...94... Mon Apr 3 01:03:39 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Sun, 2 Apr 2006 18:03:39 -0500 Subject: [Gambas-user] Controlling dynamic objects In-Reply-To: <1144018166.29643.4.camel@...1368...> References: <1144018166.29643.4.camel@...1368...> Message-ID: <200604021903.39533.sourceforge-raindog2@...94...> On Sun April 2 2006 18:49, GuruLounge - MailLists wrote: > This works in some instances but I was wondering if I could > assign whatever object "LAST" is at that time to a temporary > object name and access it's child controls as well? Something > like: > > myobject = LAST.object > myobject.listview1.clear Or just dim myobject as Object myobject = LAST myobject.clear I think that's what you're trying to do, anyway.... Rob From almanova at ...1228... Mon Apr 3 10:22:08 2006 From: almanova at ...1228... (Almanova Sistemi) Date: Mon, 03 Apr 2006 10:22:08 +0200 Subject: [Gambas-user] Delete an object In-Reply-To: <200604020113.18526.gambas@...1...> References: <200604011512.45320.arcalis.prod@...11...> <442E8EB5.8010408@...1228...> <200604020113.18526.gambas@...1...> Message-ID: <4430DB30.5070800@...1228...> Benoit Minisini ha scritto: >On Saturday 01 April 2006 16:31, Almanova Sistemi wrote: > > >>I delete a text area (TextArea.Delete). The on-line help says: Note that >>a destroyed control becomes an invalid object. >>How can I delete an object whitout an invalid object as result? >> >>Thank's >> >>Massimo >> >> >> > >Why do you want to use something that does not exist anymore? :-) > > > No, I don't want to use an object that not exist. This is my problem: I have a panel and I want add and/or delete some objetcts from them. Now, the objects are stored in a collection and when I delete them from the panel, delete also from the collection. When I insert (into the panel and into the collection) a new object (Text Area, Drawing Area etc.) and select them I get an invalid object. This is a fragment of code: .... PRIVATE hForm AS Object PRIVATE hBorder AS Integer PRIVATE hTag AS String PRIVATE Height AS Integer PRIVATE Width AS Integer PRIVATE hObj AS NEW Collection .... *'--- this get the position of the object and activate the border* PUBLIC SUB vForm_Enter() DIM iI AS Integer DIM Xa AS Integer DIM Xb AS Integer DIM Xc AS Integer DIM Xd AS Integer DIM Ya AS Integer DIM Yb AS Integer DIM Yc AS Integer DIM Yd AS Integer DIM W AS Integer DIM H AS Integer IF Selected THEN $MX = Mouse.ScreenX $MY = Mouse.ScreenY $X = LAST.X $Y = LAST.Y IF Right(hForm.Tag, 1) = "T" THEN hForm.ReadOnly = TRUE END IF END IF FOR iI = 1 TO hObj.Count MX = Mouse.ScreenX MY = Mouse.ScreenY W = hObj[iI].Width '*<-- here I get Not an object* H = hObj[iI].Height Xa = hObj[iI].ScreenX Xb = Xa + W Xc = Xa Xd = Xb Ya = hObj[iI].ScreenY Yb = Ya Yc = Ya + H Yd = Yc IF Xa <= MX AND Xb >= MX AND Ya <= MY AND Yc >= MY THEN hForm = hObj[iI] END IF NEXT hBorder = hForm.Border hForm.Border = Border.Plain END .... *'--- this insert a new Text Area* PUBLIC SUB Testo_Click() Unselect(hForm) hForm = NEW TextArea(pnaEtichetta) AS "vForm" hForm.Font.Name = cmbBoxFontName[cmbBoxFontName.Index].Text hForm.Font.Size = Val(cmbBoxFontSize[2].Text) hForm.X = 20 hForm.Y = 10 hForm.Visible = TRUE hForm.Enabled = TRUE hForm.Resize(pnaEtichetta.Width - 24, 24) Height = hForm.Height Stile() iI = iI + 1 hForm.Tag = Str(iI) & "T" hObj.Add(hForm, iI) Select(hForm, TRUE) END .... '*--- this delete the object *PUBLIC SUB hTaglia_Click() IF Left(hForm.Tag,1) ="S" THEN hObj.Remove(Mid(hForm.Tag, 2, 1)) unselect(hForm) hForm.Delete END IF -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick.jacquot at ...1387... Mon Apr 3 10:21:44 2006 From: patrick.jacquot at ...1387... (Patrick JACQUOT) Date: Mon, 03 Apr 2006 10:21:44 +0200 Subject: [Gambas-user] Wiki: DO doesn't answer In-Reply-To: <200603302159.25121.ronstk@...239...> References: <442A63F6.7000107@...221...> <442BFD9E.9010609@...221...> <200603301821.51120.gambas@...1...> <200603302159.25121.ronstk@...239...> Message-ID: <4430DB18.2070509@...1387...> ron wrote: >On Thursday 30 March 2006 18:21, Benoit Minisini wrote: > > >>Do it for one structure, and I will tell you if I find it good :-) and if you >>can do the same for the other structures. >> >> >> > >First the VB/PB examples >They tell you clear the while|until can be used only once, after DO or after LOOP. >This is better then PB. >The VB 'Remarks' explaining the parts in detail is not so bad. >PB is misleading you can use the expresion at two places. > >About condition and expresion. >In fact VB is correct with condition. > >From history we have different kinds of expresion. > >Kind/type Sign/Signature >Conditional as =, IS , NOT >Relational as <, >, =, <>, => an <= >Arithmetic as +, -, *, /, ^ >Logical as AND, OR, NOT, XOR, (and the shift plus rotate) > >The first two has as result true/false >The last two has as result a nummerical value. >Also the last two can be converted to Boolean true/false >by using "FALSE" if value is 0 and else it is "TRUE". >It is not invalid to name each of those four "expresion" but note >the difference between them. > >Like car, boot, train as transport but transport is not car if used on sea. > >In real here is "expresion" equal to "(expresion kind expresion)" >Shorted to "E" equal to "(E K E)". >For every "E" you be able to use then second "(E K E)" as replacement >and the ( and ) tell you the inner must be first evaluated. >For every K you can use one of the types C|R|A|L by using the Sign for it. > >In the background however the difference of the kinds determines how >the result must be obtained by the interpreter/compiler. > >For easynes in manuals they are mostly written as "expresion" as PB does. >By the way the automatic conversions of the expresion to the kind of >expresion in need it is easy to write "expresion" too. >Not wrong but also not clear what form to use as "expresion". > >Gambas is in this way also clever to do auto-conversion. >So using *expresion* as PB does is not incorrect(correct) for Gambas too. > >The suggestion made by Eilert about layout is IMHO a good one. > >--- >Ron > > Why not use "boolean expression"? From maillists at ...1367... Mon Apr 3 10:40:41 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Mon, 03 Apr 2006 01:40:41 -0700 Subject: [Gambas-user] Delete an object In-Reply-To: <4430DB30.5070800@...1228...> References: <200604011512.45320.arcalis.prod@...11...> <442E8EB5.8010408@...1228...> <200604020113.18526.gambas@...1...> <4430DB30.5070800@...1228...> Message-ID: <1144053641.11020.6.camel@...1368...> It looks like you're trying to access object properties using a collection but the collection isn't associated with the object in any way. Here's a test I did trying to do something similar: DIM newObj AS Object[] '<-- NOTE: I use an Object[] array, NOT a collection. DIM newForm AS Form newform = NEW form newobj = NEW Object[] newobj.Add(newform) newobj[0].text = "test1" newobj[0].show newform = NEW FormMain newobj.Add(newform) newobj[1].text = "test2" newobj[1].show My point here is that I noticed in the area where you are having problems... W = hObj[iI].Width '<-- here I get Not an object H = hObj[iI].Height ...you aren't using any objects, so how can you possibly access it's properties? I'm not entirely sure how to solve your problem but I think changing the hObj type from Collection to Object[] might help. HTH, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- An HTML attachment was scrubbed... URL: From timothy.marshal-nichols at ...247... Mon Apr 3 17:56:31 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Mon, 3 Apr 2006 16:56:31 +0100 Subject: [Gambas-user] Delete an object In-Reply-To: <4430DB30.5070800@...1228...> Message-ID: Should you have FOR iI = 0 TO (hObj.Count -1) You have hObj.Count objects. But they are numbered 0 to (hObj.Count -1). In the original you have an error when you go past the end of the collection. Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of Almanova Sistemi Sent: Monday, 03 April 2006 09:22 To: gambas-user at lists.sourceforge.net Subject: Re: [Gambas-user] Delete an object Benoit Minisini ha scritto: On Saturday 01 April 2006 16:31, Almanova Sistemi wrote: I delete a text area (TextArea.Delete). The on-line help says: Note that a destroyed control becomes an invalid object. How can I delete an object whitout an invalid object as result? Thank's Massimo Why do you want to use something that does not exist anymore? :-) No, I don't want to use an object that not exist. This is my problem: I have a panel and I want add and/or delete some objetcts from them. Now, the objects are stored in a collection and when I delete them from the panel, delete also from the collection. When I insert (into the panel and into the collection) a new object (Text Area, Drawing Area etc.) and select them I get an invalid object. This is a fragment of code: .... PRIVATE hForm AS Object PRIVATE hBorder AS Integer PRIVATE hTag AS String PRIVATE Height AS Integer PRIVATE Width AS Integer PRIVATE hObj AS NEW Collection .... '--- this get the position of the object and activate the border PUBLIC SUB vForm_Enter() DIM iI AS Integer DIM Xa AS Integer DIM Xb AS Integer DIM Xc AS Integer DIM Xd AS Integer DIM Ya AS Integer DIM Yb AS Integer DIM Yc AS Integer DIM Yd AS Integer DIM W AS Integer DIM H AS Integer IF Selected THEN $MX = Mouse.ScreenX $MY = Mouse.ScreenY $X = LAST.X $Y = LAST.Y IF Right(hForm.Tag, 1) = "T" THEN hForm.ReadOnly = TRUE END IF END IF FOR iI = 1 TO hObj.Count MX = Mouse.ScreenX MY = Mouse.ScreenY W = hObj[iI].Width '<-- here I get Not an object H = hObj[iI].Height Xa = hObj[iI].ScreenX Xb = Xa + W Xc = Xa Xd = Xb Ya = hObj[iI].ScreenY Yb = Ya Yc = Ya + H Yd = Yc IF Xa <= MX AND Xb >= MX AND Ya <= MY AND Yc >= MY THEN hForm = hObj[iI] END IF NEXT hBorder = hForm.Border hForm.Border = Border.Plain END .... '--- this insert a new Text Area PUBLIC SUB Testo_Click() Unselect(hForm) hForm = NEW TextArea(pnaEtichetta) AS "vForm" hForm.Font.Name = cmbBoxFontName[cmbBoxFontName.Index].Text hForm.Font.Size = Val(cmbBoxFontSize[2].Text) hForm.X = 20 hForm.Y = 10 hForm.Visible = TRUE hForm.Enabled = TRUE hForm.Resize(pnaEtichetta.Width - 24, 24) Height = hForm.Height Stile() iI = iI + 1 hForm.Tag = Str(iI) & "T" hObj.Add(hForm, iI) Select(hForm, TRUE) END .... '--- this delete the object PUBLIC SUB hTaglia_Click() IF Left(hForm.Tag,1) ="S" THEN hObj.Remove(Mid(hForm.Tag, 2, 1)) unselect(hForm) hForm.Delete END IF -------------- next part -------------- An HTML attachment was scrubbed... URL: From maillists at ...1367... Mon Apr 3 21:49:56 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Mon, 03 Apr 2006 12:49:56 -0700 Subject: [Gambas-user] Cleaning up memory. Message-ID: <1144093796.27789.2.camel@...1368...> I'm working on an app that displays thumbnails and images. Unfortunately after a while considerable memory gets used. Currently in Gambas 1.0.14 picture.flush doesn't work. I'm waiting for Fedora to drop the new packages in their repository. In the meantime I was wondering what tactics I can use to free up memory for images and unused arrays. TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From gambas at ...1... Mon Apr 3 23:28:58 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 3 Apr 2006 23:28:58 +0200 Subject: [Gambas-user] Cleaning up memory. In-Reply-To: <1144093796.27789.2.camel@...1368...> References: <1144093796.27789.2.camel@...1368...> Message-ID: <200604032328.58384.gambas@...1...> On Monday 03 April 2006 21:49, GuruLounge - MailLists wrote: > I'm working on an app that displays thumbnails and images. > Unfortunately after a while considerable memory gets used. > > Currently in Gambas 1.0.14 picture.flush doesn't work. I'm waiting for > Fedora to drop the new packages in their repository. > > In the meantime I was wondering what tactics I can use to free up memory > for images and unused arrays. > > TIA, > Jeff You should be able to remove a picture from the cache by doing Picture["xxx"] = NULL Regards, -- Benoit Minisini From picander78 at ...325... Tue Apr 4 16:29:37 2006 From: picander78 at ...325... (Marco Gusy) Date: Tue, 4 Apr 2006 16:29:37 +0200 Subject: [Gambas-user] Cleaning up memory. In-Reply-To: <200604032328.58384.gambas@...1...> References: <1144093796.27789.2.camel@...1368...> <200604032328.58384.gambas@...1...> Message-ID: <200604041629.37443.picander78@...325...> Alle 23:28, luned? 3 aprile 2006, Benoit Minisini ha scritto: > > You should be able to remove a picture from the cache by doing Picture["xxx"] > = NULL > > Regards, By the way, aren't classes auto cleaned when the sub that created them ends? Marco From dcamposf at ...626... Wed Apr 5 10:23:13 2006 From: dcamposf at ...626... (Daniel Campos) Date: Wed, 5 Apr 2006 10:23:13 +0200 Subject: [Gambas-user] Gambas Art Message-ID: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> Hi: Nice pictures made by the new "Junior Gambas Hacker" Marcos Morales here at gnuLinex. Feel free to use them for any Gambas related purpose: http://gambas.gnulinex.org/art/1.png http://gambas.gnulinex.org/art/2.png http://gambas.gnulinex.org/art/3.png http://gambas.gnulinex.org/art/4.png http://gambas.gnulinex.org/art/5.png http://gambas.gnulinex.org/art/6.png http://gambas.gnulinex.org/art/7.png Animation (requires flash): http://gambas.gnulinex.org/art/animation.swf Regards, Daniel Campos -------------- next part -------------- An HTML attachment was scrubbed... URL: From sourceforge-raindog2 at ...94... Wed Apr 5 16:06:03 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Wed, 5 Apr 2006 10:06:03 -0400 Subject: [Gambas-user] Gambas Art In-Reply-To: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> References: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> Message-ID: <200604051006.03269.sourceforge-raindog2@...94...> On Wed April 5 2006 04:23, Daniel Campos wrote: > Nice pictures made by the new "Junior Gambas Hacker" Marcos > Morales here at gnuLinex. Feel free to use them for any Gambas > related purpose: Thanks, Marcos, those are pretty neat. Rob From sourceforge-raindog2 at ...94... Wed Apr 5 16:15:18 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Wed, 5 Apr 2006 10:15:18 -0400 Subject: [Gambas-user] I got A Beginner's Guide to Gambas Message-ID: <200604051015.18183.sourceforge-raindog2@...94...> I had to cancel my order from January which never shipped, but the one I ordered last week arrived a few days ago. We should all be familiar with the content of John's book by now, so I'll just mention the physical presentation: a bit larger than most tech books and the paper sort of reminded me of my workbooks from high school, and the front cover is a bit pixelated for some reason, but overall it's a well put-together, professional looking trade paperback. I would recommend it to anyone in its intended audience. And it's a steal for US$26 with free shipping from Amazon. I look forward to a version 2 someday, when Gambas 2 finally gets frozen ;) Rob From maillists at ...1367... Wed Apr 5 20:38:50 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 05 Apr 2006 11:38:50 -0700 Subject: [Gambas-user] Bugs found in 1.0.14 Message-ID: <1144262330.31158.11.camel@...1368...> Okay. I've been working pretty intensively on a program and have come across a few unexplainable things in the Gambas 1.0.14 RUNTIME. I don't think these are documented as I've seen nothing on them: 1) Floating points: when I use floating points I get a sig #11 crash in my program (not the IDE) unless I include "str(myfloat)" directly after referencing the float. Str doesn't have to do anything in particular other than convert the float to some dummy string variable. i.e.: myfloat = myfloat + someotherfloat strDummy = str(myfloat) 2) It seems "mypicture.load" requires "mypicture = new picture" prior to using it otherwise a sig #11 crash in the program occurs. i.e.: mypicture = new picture mypicture.load(mypath) Actually, it seems proper to clear the picture before loading a new picture. But perhaps this should be built-in to the load function. 3) Columnview control doesn't handle keypresses quite the same way Iconview does (iconview-way is preferred). Those are the bugs I've found. I've managed work-arounds for them (except the last one) so otherwise everything is fine. Thought you should know, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- An HTML attachment was scrubbed... URL: From jscops at ...11... Wed Apr 5 22:33:18 2006 From: jscops at ...11... (Jacky) Date: Wed, 5 Apr 2006 22:33:18 +0200 Subject: [Gambas-user] Gambas Art In-Reply-To: <200604051006.03269.sourceforge-raindog2@...94...> References: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> <200604051006.03269.sourceforge-raindog2@...94...> Message-ID: <200604052233.18263.jscops@...11...> Le Mercredi 5 Avril 2006 10:23, Daniel Campos a ?crit : > Hi: > > Nice pictures made by the new "Junior Gambas Hacker" Marcos Morales > here at gnuLinex. Feel free to use them for any Gambas related purpose: Marcos Morales is a very good arstit. He move Gambas to the third dimension and that is a dream. Thank you as well to give those to the gambas users. Jscops From jscops at ...11... Wed Apr 5 19:37:45 2006 From: jscops at ...11... (Jacky) Date: Wed, 5 Apr 2006 19:37:45 +0200 Subject: [Gambas-user] Cleaning up memory. In-Reply-To: <200604041629.37443.picander78@...325...> References: <1144093796.27789.2.camel@...1368...> <200604032328.58384.gambas@...1...> <200604041629.37443.picander78@...325...> Message-ID: <200604051937.45464.jscops@...11...> From maillists at ...1367... Wed Apr 5 23:17:34 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 05 Apr 2006 14:17:34 -0700 Subject: [Gambas-user] Getting Gambas runtime version info. Message-ID: <1144271854.2834.0.camel@...1368...> How can I retrieve gambas runtime version within my project? TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From arcalis.prod at ...11... Wed Apr 5 23:28:28 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Wed, 5 Apr 2006 23:28:28 +0200 Subject: [Gambas-user] Gambas Art In-Reply-To: <200604051006.03269.sourceforge-raindog2@...94...> References: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> <200604051006.03269.sourceforge-raindog2@...94...> Message-ID: <200604052328.28846.arcalis.prod@...11...> Le Mercredi 5 Avril 2006 16:06, Rob Kudla a ?crit?: > On Wed April 5 2006 04:23, Daniel Campos wrote: > > Nice pictures made by the new "Junior Gambas Hacker" Marcos > > Morales here at gnuLinex. Feel free to use them for any Gambas > > related purpose: > > Thanks, Marcos, those are pretty neat. > > Rob where can we contact Marcos ? it's really good but for me i think it look a little bit too serious. Can he doing a mix of the both but make something more professionnal than my logo ? Regards, Fabien From gambas at ...1... Wed Apr 5 23:57:33 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 5 Apr 2006 23:57:33 +0200 Subject: [Gambas-user] Bugs found in 1.0.14 In-Reply-To: <1144262330.31158.11.camel@...1368...> References: <1144262330.31158.11.camel@...1368...> Message-ID: <200604052357.33264.gambas@...1...> On Wednesday 05 April 2006 20:38, GuruLounge - MailLists wrote: > Okay. I've been working pretty intensively on a program and have come > across a few unexplainable things in the Gambas 1.0.14 RUNTIME. I don't > think these are documented as I've seen nothing on them: > > > 1) Floating points: when I use floating points I get a sig #11 > crash in my program (not the IDE) unless I include > "str(myfloat)" directly after referencing the float. Str doesn't > have to do anything in particular other than convert the float > to some dummy string variable. i.e.: > > > myfloat = myfloat + someotherfloat > strDummy = str(myfloat) > > > 2) It seems "mypicture.load" requires "mypicture = new picture" > prior to using it otherwise a sig #11 crash in the program > occurs. i.e.: > > > mypicture = new picture > mypicture.load(mypath) > > Actually, it seems proper to clear the picture before > loading a new picture. But perhaps this should be > built-in to the load function. Please send me a complete gambas project that makes the interpreter crash, otherwise I can't guess what happens! > > > 3) Columnview control doesn't handle keypresses quite the same > way Iconview does (iconview-way is preferred). > Can you be more precise please? Regards, -- Benoit Minisini From gambas at ...1... Wed Apr 5 23:58:13 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 5 Apr 2006 23:58:13 +0200 Subject: [Gambas-user] Getting Gambas runtime version info. In-Reply-To: <1144271854.2834.0.camel@...1368...> References: <1144271854.2834.0.camel@...1368...> Message-ID: <200604052358.13810.gambas@...1...> On Wednesday 05 April 2006 23:17, GuruLounge - MailLists wrote: > How can I retrieve gambas runtime version within my project? > > TIA, > Jeff You can't. You can just get the major interpreter version in the development version. Regards, -- Benoit Minisini From ronstk at ...239... Thu Apr 6 00:08:10 2006 From: ronstk at ...239... (ron) Date: Thu, 6 Apr 2006 00:08:10 +0200 Subject: [Gambas-user] Gambas Art In-Reply-To: <200604052328.28846.arcalis.prod@...11...> References: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> <200604051006.03269.sourceforge-raindog2@...94...> <200604052328.28846.arcalis.prod@...11...> Message-ID: <200604060008.11012.ronstk@...239...> On Wednesday 05 April 2006 23:28, fabien Bodard wrote: > Le Mercredi 5 Avril 2006 16:06, Rob Kudla a ??crit??: > > On Wed April 5 2006 04:23, Daniel Campos wrote: > > > Nice pictures made by the new "Junior Gambas Hacker" Marcos > > > Morales here at gnuLinex. Feel free to use them for any Gambas > > > related purpose: > > > > Thanks, Marcos, those are pretty neat. > > > > Rob > > where can we contact Marcos ? it's really good but for me i think it look a > little bit too serious. Can he doing a mix of the both but make something more > professionnal than my logo ? > > Regards, > Fabien > Your logo, the mascotte, is for me professionnal. It is the thing I miss in the new MDI :) I know, many people hate Clippie in other OS. The 3D icon is also IMHO nice. ---- Ron From peter.moers at ...626... Thu Apr 6 00:12:02 2006 From: peter.moers at ...626... (Peter Moers) Date: Thu, 6 Apr 2006 00:12:02 +0200 Subject: [Gambas-user] direct printer port access Message-ID: <6cb911930604051512id141c39hf9ce13a6eb6bbfa4@...627...> hi, I'm trying to get direct access to the printer port to control a CNC router. This means I need to be able to set individual pins high and low. I've found some examples to print text to lp1 etc. but I didn't find a way to set/read the current state of the pins. Is this possible and if so how? Regards, -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be -------------- next part -------------- An HTML attachment was scrubbed... URL: From maillists at ...1367... Thu Apr 6 02:44:40 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 05 Apr 2006 17:44:40 -0700 Subject: [Gambas-user] Bugs found in 1.0.14 In-Reply-To: <200604052357.33264.gambas@...1...> References: <1144262330.31158.11.camel@...1368...> <200604052357.33264.gambas@...1...> Message-ID: <1144284280.8705.9.camel@...1368...> The first two problems don't seem to be a problem now. I don't know what I changed that fixed it but it's working now. I'll watch it and see if it happens again. It's a fairly large project. It's basically a Nautilus clone that's not quite so fat. Regarding the columnview control -- well, in contrast, when I use the iconview control and I press a key on the keyboard, the iconview control cycles thru each item that begins with the letter or character that I press (includes files and folders). The columnview control doesn't do this -- at least not very well, i.e.: If I have this list in a columnview (caps being folders): .AUTOMOUNT BIN BOOT CD-IMAGES DEV .autofsck disconnect.png if I have "BIN" selected and press "C", nothing happens. If I press "B" then it selects "BOOT"... THEN if I press "C" then "CD-IMAGES" gets selected. Simply put, it doesn't cycle thru the items beginning with the letter or character I press on the keyboard... And I'm also saying that I think it should cycle thru these items in the same way Iconview does. Iconview does this perfectly. Using Gambas 1.0.14 on FC4. HTH, Jeff On Wed, 2006-04-05 at 23:57 +0200, Benoit Minisini wrote: > Please send me a complete gambas project that makes the interpreter crash, > otherwise I can't guess what happens! > > > > > > > 3) Columnview control doesn't handle keypresses quite the same > > way Iconview does (iconview-way is preferred). > > > > Can you be more precise please? > > Regards, > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From brian at ...1334... Thu Apr 6 05:03:54 2006 From: brian at ...1334... (Christopher Brian Jack) Date: Wed, 05 Apr 2006 20:03:54 -0700 (PDT) Subject: [Gambas-user] Gambas Art In-Reply-To: <200604060008.11012.ronstk@...239...> References: <7259b5ae0604050123p6478d1e4hfca84244130a18fa@...627...> <200604051006.03269.sourceforge-raindog2@...94...> <200604052328.28846.arcalis.prod@...11...> <200604060008.11012.ronstk@...239...> Message-ID: <20060405195151.G45481@...1337...> On Thu, 6 Apr 2006, ron wrote: > Your logo, the mascotte, is for me professionnal. > > It is the thing I miss in the new MDI :) > I know, many people hate Clippie in other OS. > > The 3D icon is also IMHO nice. I like the mascot and it could be of use in the IDE for some folks. Make it a preference setting or something like that. I think he could be given a good suite of active project management tools (again preference settings would be needed to determine which behaviors should be enabled -- something Clippie doesn't have and hence he likes to interrupt many folks in unwanted ways at undesirable times hence his bittersweet reputation). .=================================================. | Christopher BRIAN Jack aka "Gau of the Veldt" | +=================================================' | brian _AT_ brians-anime _DOT_ com `=================================================- Hi Spambots, my email address is sputnik at ...1334... From nando_f at ...1382... Thu Apr 6 12:09:47 2006 From: nando_f at ...1382... (nando) Date: Thu, 6 Apr 2006 06:09:47 -0400 Subject: [Gambas-user] direct printer port access In-Reply-To: <6cb911930604051512id141c39hf9ce13a6eb6bbfa4@...627...> References: <6cb911930604051512id141c39hf9ce13a6eb6bbfa4@...627...> Message-ID: <20060406100713.M39815@...1382...> I used the example for SERIAL PORT works. Start there. I used it to do pin control and direct access for a unique serial device. Zero problems. Works terrific. -Fernando ---------- Original Message ----------- From: "Peter Moers" To: gambas-user at lists.sourceforge.net Sent: Thu, 6 Apr 2006 00:12:02 +0200 Subject: [Gambas-user] direct printer port access > hi, > I'm trying to get direct access to the printer port to control a CNC router. > This means I need to be able to set individual pins high and low. I've > found some examples to print text to lp1 etc. but I didn't find a way > to set/read the current state of the pins. Is this possible and if so how? > > Regards, > > -- > Peter Moers > peter.moers at ...1417... > Divides Webdesign - http://www.divides.be > Startpagina - http://www.321start.be ------- End of Original Message ------- From nando_f at ...1382... Thu Apr 6 12:13:19 2006 From: nando_f at ...1382... (nando) Date: Thu, 6 Apr 2006 06:13:19 -0400 Subject: [Gambas-user] direct printer port access In-Reply-To: <20060406100713.M39815@...1382...> References: <6cb911930604051512id141c39hf9ce13a6eb6bbfa4@...627...> <20060406100713.M39815@...1382...> Message-ID: <20060406101154.M50557@...1382...> My error. I thought you meant Serial Port. I have not yet met a CNC machine using Parallel. ---------- Original Message ----------- From: "nando" To: gambas-user at lists.sourceforge.net Sent: Thu, 6 Apr 2006 06:09:47 -0400 Subject: Re: [Gambas-user] direct printer port access > I used the example for SERIAL PORT works. Start there. > I used it to do pin control and direct access for a unique serial device. > Zero problems. Works terrific. > -Fernando > > ---------- Original Message ----------- > From: "Peter Moers" > To: gambas-user at lists.sourceforge.net > Sent: Thu, 6 Apr 2006 00:12:02 +0200 > Subject: [Gambas-user] direct printer port access > > > hi, > > I'm trying to get direct access to the printer port to control a CNC router. > > This means I need to be able to set individual pins high and low. I've > > found some examples to print text to lp1 etc. but I didn't find a way > > to set/read the current state of the pins. Is this possible and if so how? > > > > Regards, > > > > -- > > Peter Moers > > peter.moers at ...1417... > > Divides Webdesign - http://www.divides.be > > Startpagina - http://www.321start.be > ------- End of Original Message ------- > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as- > us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user ------- End of Original Message ------- From supermarcos at ...626... Thu Apr 6 14:26:55 2006 From: supermarcos at ...626... (Marcos Morales) Date: Thu, 6 Apr 2006 12:26:55 +0000 Subject: [Gambas-user] the 3D crustacean Message-ID: A lot of thanks for everybody! I didn't think that the "freak" going to be that success... Well, I make that things only as a hobby... but, again, a lot of thanks... In this case, I was thinking in a rotate function for gambas2, and, this is the result... jejeje Really It's great pleasure know that any work is appreciated for the people... thank you. Best regards. Marcos Morales Rodrigo. P.D: sorry... my english is ugly... -------------- next part -------------- An HTML attachment was scrubbed... URL: From gambas at ...1... Thu Apr 6 14:51:10 2006 From: gambas at ...1... (Benoit Minisini) Date: Thu, 6 Apr 2006 14:51:10 +0200 Subject: [Gambas-user] the 3D crustacean In-Reply-To: References: Message-ID: <200604061451.10971.gambas@...1...> On Thursday 06 April 2006 14:26, Marcos Morales wrote: > A lot of thanks for everybody! > > I didn't think that the "freak" going to be that success... > Well, I make that things only as a hobby... but, again, a lot of thanks... > In this case, I was thinking in a rotate function for gambas2, and, this is > the result... jejeje > > Really It's great pleasure know that any work is appreciated for the > people... thank you. > > Best regards. > > Marcos Morales Rodrigo. > > P.D: sorry... my english is ugly... Great job. Do you think that you could display your shrimp with OpenGL in Gambas ? -- Benoit Minisini From arcalis.prod at ...11... Thu Apr 6 22:07:36 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Thu, 6 Apr 2006 22:07:36 +0200 Subject: [Gambas-user] the 3D crustacean In-Reply-To: <200604061451.10971.gambas@...1...> References: <200604061451.10971.gambas@...1...> Message-ID: <200604062207.37100.arcalis.prod@...11...> Le Jeudi 6 Avril 2006 14:51, Benoit Minisini a ?crit?: > On Thursday 06 April 2006 14:26, Marcos Morales wrote: > > A lot of thanks for everybody! > > > > I didn't think that the "freak" going to be that success... > > Well, I make that things only as a hobby... but, again, a lot of > > thanks... In this case, I was thinking in a rotate function for gambas2, > > and, this is the result... jejeje > > > > Really It's great pleasure know that any work is appreciated for the > > people... thank you. > > > > Best regards. > > > > Marcos Morales Rodrigo > > > > P.D: sorry... my english is ugly... > > Great job. Do you think that you could display your shrimp with OpenGL in > Gambas ? Yes it's possible ! :-) but we need a known 3d format file like .obj extention. in that case i think it's possible ! Regards, Fabien Bodard From peter.moers at ...626... Sat Apr 8 14:03:21 2006 From: peter.moers at ...626... (Peter Moers) Date: Sat, 8 Apr 2006 14:03:21 +0200 Subject: [Gambas-user] installation configuration problem Message-ID: <6cb911930604080503h79f3d67dn51cda43c7f0ba4e1@...627...> hi, I had the stable version running but now I want want to update to the latest version. I'm using an Ubuntu hd installation with kde installed. Since the debian sources doesn't work I'm trying to compile from the sources. When I execute ./configure it keeps running it says it's creating config.h etc but then it starts all over again. Should I be more patient or will this never stop? Regards, -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From ronstk at ...239... Sat Apr 8 14:18:02 2006 From: ronstk at ...239... (ron) Date: Sat, 8 Apr 2006 14:18:02 +0200 Subject: [Gambas-user] installation configuration problem In-Reply-To: <6cb911930604080503h79f3d67dn51cda43c7f0ba4e1@...627...> References: <6cb911930604080503h79f3d67dn51cda43c7f0ba4e1@...627...> Message-ID: <200604081418.02929.ronstk@...239...> On Saturday 08 April 2006 14:03, Peter Moers wrote: > hi, > I had the stable version running but now I want want to update to the > latest version. I'm using an Ubuntu hd installation with kde > installed. Since the debian sources doesn't work I'm trying to compile > from the sources. When I execute ./configure it keeps running it says > it's creating config.h etc but then it starts all over again. Should I > be more patient or will this never stop? > > Regards, > -- > Peter Moers > peter.moers at ...1417... > Divides Webdesign - http://www.divides.be > Startpagina - http://www.321start.be I belive it will do it 27 times. The ./configure is run full in every component map Takes some time. Ron From peter.moers at ...626... Sat Apr 8 14:21:26 2006 From: peter.moers at ...626... (Peter Moers) Date: Sat, 8 Apr 2006 14:21:26 +0200 Subject: [Gambas-user] installation configuration problem In-Reply-To: <200604081418.02929.ronstk@...239...> References: <6cb911930604080503h79f3d67dn51cda43c7f0ba4e1@...627...> <200604081418.02929.ronstk@...239...> Message-ID: <6cb911930604080521w4dbf5d4agfa3d2aafdfb0c362@...627...> thx, I'll let it run :) 2006/4/8, ron : > On Saturday 08 April 2006 14:03, Peter Moers wrote: > > hi, > > I had the stable version running but now I want want to update to the > > latest version. I'm using an Ubuntu hd installation with kde > > installed. Since the debian sources doesn't work I'm trying to compile > > from the sources. When I execute ./configure it keeps running it says > > it's creating config.h etc but then it starts all over again. Should I > > be more patient or will this never stop? > > > > Regards, > > -- > > Peter Moers > > peter.moers at ...1417... > > Divides Webdesign - http://www.divides.be > > Startpagina - http://www.321start.be > > I belive it will do it 27 times. > > The ./configure is run full in every component map > Takes some time. > > Ron > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From peter.moers at ...626... Sat Apr 8 17:40:46 2006 From: peter.moers at ...626... (Peter Moers) Date: Sat, 8 Apr 2006 17:40:46 +0200 Subject: [Gambas-user] direct printer port access In-Reply-To: <20060406101154.M50557@...1382...> References: <6cb911930604051512id141c39hf9ce13a6eb6bbfa4@...627...> <20060406100713.M39815@...1382...> <20060406101154.M50557@...1382...> Message-ID: <6cb911930604080840l121aef5cm37bba4b5ee597de2@...627...> To get around my parallel port problem I learned a bit of C and made a program that runs from command line and sets the pins like I want them. Now I want to do: SHELL "lptio 'write " & value & '"" But that doesn't work since I have to be root to access te port. So the next thing I tried was: SHELL "sudo lptio 'write " & value & '"" but ofcourse I can't give the password :) or can I? Regards, 2006/4/6, nando : > My error. I thought you meant Serial Port. > I have not yet met a CNC machine using Parallel. > > > ---------- Original Message ----------- > From: "nando" > To: gambas-user at lists.sourceforge.net > Sent: Thu, 6 Apr 2006 06:09:47 -0400 > Subject: Re: [Gambas-user] direct printer port access > > > I used the example for SERIAL PORT works. Start there. > > I used it to do pin control and direct access for a unique serial device. > > Zero problems. Works terrific. > > -Fernando > > > > ---------- Original Message ----------- > > From: "Peter Moers" > > To: gambas-user at lists.sourceforge.net > > Sent: Thu, 6 Apr 2006 00:12:02 +0200 > > Subject: [Gambas-user] direct printer port access > > > > > hi, > > > I'm trying to get direct access to the printer port to control a CNC router. > > > This means I need to be able to set individual pins high and low. I've > > > found some examples to print text to lp1 etc. but I didn't find a way > > > to set/read the current state of the pins. Is this possible and if so how? > > > > > > Regards, > > > > > > -- > > > Peter Moers > > > peter.moers at ...1417... > > > Divides Webdesign - http://www.divides.be > > > Startpagina - http://www.321start.be > > ------- End of Original Message ------- > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > > that extends applications into web and mobile media. Attend the live webcast > > and join the prime developer group breaking into this new coding territory! > > http://sel.as- > > us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------- End of Original Message ------- > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From na2492 at ...9... Sat Apr 8 21:31:22 2006 From: na2492 at ...9... (Charlie Reinl) Date: Sat, 8 Apr 2006 21:31:22 00200 Subject: [Gambas-user] direct printer port access Message-ID: <44380f8a.3be.0@...9...> >To get around my parallel port problem I learned a bit of C and made a >program that runs from command line and sets the pins like I want >them. Now I want to do: >SHELL "lptio 'write " & value & '"" >But that doesn't work since I have to be root to access te port. So >the next thing I tried was: >SHELL "sudo lptio 'write " & value & '"" >but ofcourse I can't give the password :) or can I? > >Regards, > Salut, in sudoers you can declare users or a group like the followed : # Uncomment to allow people in group wheel to run all commands # %wheel ALL=(ALL) ALL # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL have a look in man sudoers Amicalment Charlie * Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de * From peter.moers at ...626... Sat Apr 8 21:51:56 2006 From: peter.moers at ...626... (Peter Moers) Date: Sat, 8 Apr 2006 21:51:56 +0200 Subject: [Gambas-user] direct printer port access In-Reply-To: <44380f8a.3be.0@...9...> References: <44380f8a.3be.0@...9...> Message-ID: <6cb911930604081251o7998cb96t3906adca60a65b49@...627...> I did it this way: SHELL "echo " & txtPass.Text & "|sudo -S lptio write " & value This works but is to slow so right now I'm trying to make a component to control te parallel port. My knowlege of C is getting larger... :) Sat, 8 Apr 2006 21:31:22 00200, Charlie Reinl : > >To get around my parallel port problem I learned a bit of C and made a > >program that runs from command line and sets the pins like I want > >them. Now I want to do: > >SHELL "lptio 'write " & value & '"" > >But that doesn't work since I have to be root to access te port. So > >the next thing I tried was: > >SHELL "sudo lptio 'write " & value & '"" > >but ofcourse I can't give the password :) or can I? > > > >Regards, > > > Salut, > > in sudoers you can declare users or a group like the followed : > > # Uncomment to allow people in group wheel to run all commands > # %wheel ALL=(ALL) ALL > > # Same thing without a password > # %wheel ALL=(ALL) NOPASSWD: ALL > > have a look in man sudoers > > Amicalment > Charlie > * Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de * > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From admin at ...1080... Sun Apr 9 00:18:38 2006 From: admin at ...1080... (Werner Staudacher) Date: Sun, 09 Apr 2006 00:18:38 +0200 Subject: [Gambas-user] Tooltip from Treeview does not how expected Message-ID: <443836BE.8080002@...1080...> The tooltip is only shown over the scrollbars but not inside the "inner" control. In fact i was trying to give some info when the user moves the mouse over the items. I use gambas 1.0.13. Regards, staudi From maillists at ...1367... Sun Apr 9 03:25:18 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 08 Apr 2006 18:25:18 -0700 Subject: [Gambas-user] Problem resizing forms. Message-ID: <1144545918.5867.10.camel@...1368...> I've a project I've attached that manages how big or little a form gets using the resize event. It's a System Information utility for memory and disk space that some may find useful. But I'm having a couple minor problems with it. 1) It works okay when grabbing the form from the bottom or the right hand side. But when grabbing the form from the top or the left, the resize event doesn't seem to work properly -- only occasionally when grabbing the left and never when grabbing from the top. 2) The resize event is designed to keep the form from being larger than is necessary. So on the MAXIMIZE event this works fine, only making the form large enough to show all the controls but no larger -- in Gnome. But in fluxbox the height property doesn't seem to get managed right and it fills the screen from top to bottom. Any idea where these problems are coming from? Project is attached: Using Gambas 1.0.14 FC3 & 4 using Fluxbox 0.9.14. and Gnome 2.10 respectively. TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- A non-text attachment was scrubbed... Name: sysinfo.tgz Type: application/x-compressed-tar Size: 3562 bytes Desc: not available URL: From gambas at ...1... Sun Apr 9 11:22:15 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 9 Apr 2006 11:22:15 +0200 Subject: [Gambas-user] Problem resizing forms. In-Reply-To: <1144545918.5867.10.camel@...1368...> References: <1144545918.5867.10.camel@...1368...> Message-ID: <200604091122.15557.gambas@...1...> On Sunday 09 April 2006 03:25, GuruLounge - MailLists wrote: > I've a project I've attached that manages how big or little a form gets > using the resize event. > > It's a System Information utility for memory and disk space that some > may find useful. But I'm having a couple minor problems with it. > > 1) It works okay when grabbing the form from the bottom or the right > hand side. But when grabbing the form from the top or the left, the > resize event doesn't seem to work properly -- only occasionally when > grabbing the left and never when grabbing from the top. > > 2) The resize event is designed to keep the form from being larger than > is necessary. So on the MAXIMIZE event this works fine, only making the > form large enough to show all the controls but no larger -- in Gnome. > But in fluxbox the height property doesn't seem to get managed right and > it fills the screen from top to bottom. > > Any idea where these problems are coming from? > > Project is attached: > > Using Gambas 1.0.14 > FC3 & 4 using Fluxbox 0.9.14. and Gnome 2.10 respectively. > > TIA, > Jeff Can you send a complete archive of your project, by using the corresponding IDE menu entry? -- Benoit Minisini From gu_seifer at ...494... Sun Apr 9 11:13:39 2006 From: gu_seifer at ...494... (Gustavo Aparecido Batista da Silva) Date: Sun, 09 Apr 2006 09:13:39 +0000 Subject: [Gambas-user] Problen on make gb.db.postgresql Message-ID: <4438D043.9060202@...494...> The error: Making all in gb.db.postgresql make[2]: Entering directory `/home/gustavo/Desktop/gambas2-1.9.28/gambas2-1.9.28/gb.db.postgresql' make all-recursive make[3]: Entering directory `/home/gustavo/Desktop/gambas2-1.9.28/gambas2-1.9.28/gb.db.postgresql' /bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: syntax error: unexpected end of file make[3]: ** [all-recursive] Error 2 make[3]: Leaving directory `/home/gustavo/Desktop/gambas2-1.9.28/gambas2-1.9.28/gb.db.postgresql' make[2]: ** [all] Error 2 make[2]: Leaving directory `/home/gustavo/Desktop/gambas2-1.9.28/gambas2-1.9.28/gb.db.postgresql' make[1]: ** [all-recursive] Error 1 make[1]: Leaving directory `/home/gustavo/Desktop/gambas2-1.9.28/gambas2-1.9.28' make: ** [all] Error 2 bash-3.00$ _______________________________________________________ Abra sua conta no Yahoo! Mail: 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. http://br.info.mail.yahoo.com/ From maillists at ...1367... Sun Apr 9 19:28:00 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sun, 09 Apr 2006 10:28:00 -0700 Subject: [Gambas-user] Problem resizing forms. In-Reply-To: <200604091122.15557.gambas@...1...> References: <1144545918.5867.10.camel@...1368...> <200604091122.15557.gambas@...1...> Message-ID: <1144603680.8903.2.camel@...1368...> Okay, here we go again... Full project dir attached... I've a project I've attached that manages how big or little a form gets using the resize event. It's a System Information utility for memory and disk space that some may find useful. But I'm having a couple minor problems with it. 1) It works okay when grabbing the form from the bottom or the right hand side. But when grabbing the form from the top or the left, the resize event doesn't seem to work properly -- only occasionally when grabbing the left and never when grabbing from the top. 2) The resize event is designed to keep the form from being larger than is necessary. So on the MAXIMIZE event this works fine, only making the form large enough to show all the controls but no larger -- in Gnome. But in fluxbox the height property doesn't seem to get managed right and it fills the screen from top to bottom. Any idea where these problems are coming from? Project is attached: Using Gambas 1.0.14 FC3 & 4 using Fluxbox 0.9.14. and Gnome 2.10 respectively. TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- A non-text attachment was scrubbed... Name: sysinfo.tgz Type: application/x-compressed-tar Size: 9159 bytes Desc: not available URL: From sourceforge-raindog2 at ...94... Sun Apr 9 21:43:13 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Sun, 9 Apr 2006 15:43:13 -0400 Subject: [Gambas-user] Problem resizing forms. In-Reply-To: <1144545918.5867.10.camel@...1368...> References: <1144545918.5867.10.camel@...1368...> Message-ID: <200604091543.14025.sourceforge-raindog2@...94...> On Sat April 8 2006 21:25, GuruLounge - MailLists wrote: > 2) The resize event is designed to keep the form from being > larger than is necessary. So on the MAXIMIZE event this works > fine, only making the form large enough to show all the > controls but no larger -- in Gnome. But in fluxbox the height > property doesn't seem to get managed right and it fills the > screen from top to bottom. Unfortunately, if you don't want the user to be able to fill the screen (top to bottom, left to right, or both) with your app, you need to remove the maximize button. Resizing the window during a resize event caused by the user maximizing the window will have different and unpredictable results from WM to WM, as you've already discovered. You may be able to check Window.State and set it to Window.Normal if it's not there already, but that may look ugly to the user depending again on which WM they use. I don't know if it's possible to disable the maximize button in a window manager without disabling all resizing, but that's what you're up against. It might be helpful if Gambas exposed the maximum and minimum window size hints Qt provides (the QWidget methods setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, plus the corresponding properties), since I've run into similar issues with windows I wanted to prevent the user from making too small. Rob From wspinto at ...1405... Mon Apr 10 23:27:17 2006 From: wspinto at ...1405... (wspinto at ...1405...) Date: Mon, 10 Apr 2006 18:27:17 -0300 Subject: [Gambas-user] Falha de =?iso-8859-1?b?c2VnbWVudGHn428=?= (segmentation fails) In-Reply-To: <20060407030908.1B1858C19F@...763...> References: <20060407030908.1B1858C19F@...763...> Message-ID: <1144704437.443acdb5c4859@...1418...> HI! I'm using gambas2-1.9.26 and when i install the gambas2-1.9.27 or .28 not work. #./configure # make # make install # gambas2 Falha de segmenta??o (segmentation fails) If i am compilling with gambas2-1.9.26, work fine. why????????????????? I'm send my output file. My computer is AMD64 with Kurumin Linux 6 and gcc4 Reguards, Wellington ___________________________________________________________________________________ Click21 A Internet gr?tis com a qualidade Embratel Baixe agora o discador www.click21.com.br -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: output.txt URL: From gambas at ...1... Mon Apr 10 23:36:42 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 10 Apr 2006 23:36:42 +0200 Subject: [Gambas-user] Falha de =?iso-8859-15?q?segmenta=E7=E3o?= (segmentation fails) In-Reply-To: <1144704437.443acdb5c4859@...1418...> References: <20060407030908.1B1858C19F@...763...> <1144704437.443acdb5c4859@...1418...> Message-ID: <200604102336.42484.gambas@...1...> On Monday 10 April 2006 23:27, wspinto at ...1405... wrote: > HI! > > I'm using gambas2-1.9.26 and when i install the gambas2-1.9.27 or .28 not > work. > > #./configure > # make > # make install > # gambas2 > Falha de segmenta??o (segmentation fails) > > If i am compilling with gambas2-1.9.26, work fine. > > why????????????????? > > I'm send my output file. > > My computer is AMD64 with Kurumin Linux 6 and gcc4 > > Reguards, > > Wellington Can you send a backtrace of the crashing interpreter as explained on the troubleshooting page of the website? Thanks in advance, -- Benoit Minisini From peter.moers at ...626... Tue Apr 11 00:08:52 2006 From: peter.moers at ...626... (Peter Moers) Date: Tue, 11 Apr 2006 00:08:52 +0200 Subject: [Gambas-user] Least Common Multiple Message-ID: <6cb911930604101508h246de9a0ndc27584b38bb269a@...627...> hi, I'm trying to calculate the least common multiple of 3 integers I tried the following code but had to find out it doesn't work when xs,ys or zs equals 0. DIM vmax AS Integer = Max(xs, ys, zs) DIM loops AS Integer = vmax WHILE loops MOD xs <> 0 AND loops MOD ys <> 0 AND loops MOD zs <> 0 loops = loops + vmax WEND Now, I can split it up in 3 loops after checking the values for not being 0 but I think it must be able to do this with less code. Suggestions? Maybe LCM could implemented into the Gambas language, would be usefull. regards, -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From msumurph at ...626... Tue Apr 11 03:19:36 2006 From: msumurph at ...626... (Allen Murphy) Date: Mon, 10 Apr 2006 21:19:36 -0400 Subject: [Gambas-user] Least Common Multiple In-Reply-To: <6cb911930604101508h246de9a0ndc27584b38bb269a@...627...> References: <6cb911930604101508h246de9a0ndc27584b38bb269a@...627...> Message-ID: <4d1057440604101819g62b94be6idfe91f00927bda2f@...627...> If one or more of the values is zero then the LCM would have to be zero. That said, I think there is also a logic problem in you WHILE statement. With "AND" all the remainders would have to be non-zero, but as long as one is non-zero you need to keep looking. I used this code to test teh LCM and using "OR" gave the correct result (I tested with 3, 4, 6 and 3, 5, 7). STATIC PUBLIC SUB Main() DIM first AS Integer DIM secnd AS Integer DIM third AS Integer DIM vmax AS Integer DIM loops AS Integer PRINT "Enter three numbers:" INPUT first INPUT secnd INPUT third vmax = Max(first, secnd, third) loops = vmax IF first <> 0 AND secnd <> 0 AND third <> 0 THEN WHILE loops MOD first <> 0 OR loops MOD secnd <> 0 OR loops MOD third <> 0 PRINT "new = " & Str(loops) loops = loops + vmax WEND PRINT "LCM = " & Str(loops) ELSE PRINT "LCM = 0" END IF END Hope this helps, Allen On 4/10/06, Peter Moers wrote: > > hi, > > I'm trying to calculate the least common multiple of 3 integers I > tried the following code but had to find out it doesn't work when > xs,ys or zs equals 0. > > DIM vmax AS Integer = Max(xs, ys, zs) > DIM loops AS Integer = vmax > WHILE loops MOD xs <> 0 AND loops MOD ys <> 0 AND loops MOD zs <> 0 > loops = loops + vmax > WEND > > Now, I can split it up in 3 loops after checking the values for not > being 0 but I think it must be able to do this with less code. > Suggestions? > > Maybe LCM could implemented into the Gambas language, would be usefull. > > > regards, > > -- > Peter Moers > peter.moers at ...1417... > Divides Webdesign - http://www.divides.be > Startpagina - http://www.321start.be > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gambas at ...1... Tue Apr 11 10:44:31 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 11 Apr 2006 10:44:31 +0200 Subject: [Gambas-user] Tooltip from Treeview does not how expected In-Reply-To: <443836BE.8080002@...1080...> References: <443836BE.8080002@...1080...> Message-ID: <200604111044.32122.gambas@...1...> On Sunday 09 April 2006 00:18, Werner Staudacher wrote: > The tooltip is only shown over the scrollbars but not inside the "inner" > control. > In fact i was trying to give some info when the user moves the mouse > over the items. > I use gambas 1.0.13. > > Regards, staudi > I think I fixed the bug now. You will get it in the next stable version (and development too). Regards, -- Benoit Minisini From brian at ...1334... Tue Apr 11 10:53:16 2006 From: brian at ...1334... (Christopher Brian Jack) Date: Tue, 11 Apr 2006 01:53:16 -0700 (PDT) Subject: [Gambas-user] Fine tuning the syntax highlighting editor Message-ID: <20060411014951.H74998@...1337...> Is there a way to change the multiple of line numbers in the Editor control? The default uses multiples of ten and I'd like to set it to 1 if possible. What other undocumented features does this control have? .=================================================. | Christopher BRIAN Jack aka "Gau of the Veldt" | +=================================================' | brian _AT_ brians-anime _DOT_ com `=================================================- Hi Spambots, my email address is sputnik at ...1334... From gambas at ...1... Tue Apr 11 11:20:27 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 11 Apr 2006 11:20:27 +0200 Subject: [Gambas-user] Fine tuning the syntax highlighting editor In-Reply-To: <20060411014951.H74998@...1337...> References: <20060411014951.H74998@...1337...> Message-ID: <200604111120.28140.gambas@...1...> On Tuesday 11 April 2006 10:53, Christopher Brian Jack wrote: > Is there a way to change the multiple of line numbers in the Editor > control? The default uses multiples of ten and I'd like to set it to 1 if > possible. No. But it won't be difficult to add this property. > > What other undocumented features does this control have? Nothing is really documented yet. Consider that all the gambas specific part of this control may change without notice. Regards, -- Benoit Minisini From timothy.marshal-nichols at ...247... Tue Apr 11 11:55:38 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Tue, 11 Apr 2006 10:55:38 +0100 Subject: [Gambas-user] Least Common Multiple In-Reply-To: <4d1057440604101819g62b94be6idfe91f00927bda2f@...627...> Message-ID: Why limit yourself to 3 numbers. Here is a function that takes a integer array: PUBLIC SUB Main() DIM numbers AS Integer[3] ' Get numbers PRINT "Input three numbers: " INPUT numbers[0] INPUT numbers[1] INPUT numbers[2] PRINT "Least common multiple is " & LeastCommonMultiple(numbers) END PRIVATE FUNCTION LeastCommonMultiple(Numbers AS Integer[]) AS Integer DIM i AS Integer DIM loopNumber AS Integer ' If 0 is in the number array then the least common multiple is 0 IF Numbers.Find(0) <> -1 THEN RETURN 0 ' Find LCM loopNumber = 0 WHILE TRUE ' Add the max integer in the array to loop variable loopNumber += Numbers[Numbers.Max] ' Check if this is LCM FOR i = 0 TO Numbers.Count - 1 IF (loopNumber MOD Numbers[i]) <> 0 THEN ' Not LCM. So break out of for loop to ' try next value BREAK ELSE IF i = Numbers.Count - 1 THEN ' loopNumber MOD Numbers[i] is 0 for all integers ' in the array. So this is our LCM RETURN loopNumber END IF NEXT WEND END Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of Allen Murphy Sent: Tuesday, 11 April 2006 02:20 To: gambas-user at lists.sourceforge.net Subject: Re: [Gambas-user] Least Common Multiple If one or more of the values is zero then the LCM would have to be zero. That said, I think there is also a logic problem in you WHILE statement. With "AND" all the remainders would have to be non-zero, but as long as one is non-zero you need to keep looking. I used this code to test teh LCM and using "OR" gave the correct result (I tested with 3, 4, 6 and 3, 5, 7). STATIC PUBLIC SUB Main() DIM first AS Integer DIM secnd AS Integer DIM third AS Integer DIM vmax AS Integer DIM loops AS Integer PRINT "Enter three numbers:" INPUT first INPUT secnd INPUT third vmax = Max(first, secnd, third) loops = vmax IF first <> 0 AND secnd <> 0 AND third <> 0 THEN WHILE loops MOD first <> 0 OR loops MOD secnd <> 0 OR loops MOD third <> 0 PRINT "new = " & Str(loops) loops = loops + vmax WEND PRINT "LCM = " & Str(loops) ELSE PRINT "LCM = 0" END IF END Hope this helps, Allen On 4/10/06, Peter Moers wrote: hi, I'm trying to calculate the least common multiple of 3 integers I tried the following code but had to find out it doesn't work when xs,ys or zs equals 0. DIM vmax AS Integer = Max(xs, ys, zs) DIM loops AS Integer = vmax WHILE loops MOD xs <> 0 AND loops MOD ys <> 0 AND loops MOD zs <> 0 loops = loops + vmax WEND Now, I can split it up in 3 loops after checking the values for not being 0 but I think it must be able to do this with less code. Suggestions? Maybe LCM could implemented into the Gambas language, would be usefull. regards, -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.moers at ...626... Tue Apr 11 17:01:29 2006 From: peter.moers at ...626... (Peter Moers) Date: Tue, 11 Apr 2006 17:01:29 +0200 Subject: [Gambas-user] Least Common Multiple In-Reply-To: References: <4d1057440604101819g62b94be6idfe91f00927bda2f@...627...> Message-ID: <6cb911930604110801h45001005g8a08b59f6ee4c446@...627...> thanks for your help, I've got it working now. 2006/4/11, Timothy Marshal-Nichols : > > > Why limit yourself to 3 numbers. Here is a function that takes a integer > array: > > PUBLIC SUB Main() > DIM numbers AS Integer[3] > ' Get numbers > PRINT "Input three numbers: " > INPUT numbers[0] > INPUT numbers[1] > INPUT numbers[2] > PRINT "Least common multiple is " & LeastCommonMultiple(numbers) > END > > PRIVATE FUNCTION LeastCommonMultiple(Numbers AS Integer[]) AS Integer > DIM i AS Integer > DIM loopNumber AS Integer > ' If 0 is in the number array then the least common multiple is 0 > IF Numbers.Find(0) <> -1 THEN RETURN 0 > ' Find LCM > loopNumber = 0 > WHILE TRUE > ' Add the max integer in the array to loop variable > loopNumber += Numbers[Numbers.Max] > ' Check if this is LCM > FOR i = 0 TO Numbers.Count - 1 > IF (loopNumber MOD Numbers[i]) <> 0 THEN > ' Not LCM. So break out of for loop to > ' try next value > BREAK > ELSE IF i = Numbers.Count - 1 THEN > ' loopNumber MOD Numbers[i] is 0 for all integers > ' in the array. So this is our LCM > RETURN loopNumber > END IF > NEXT > WEND > END > > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf > Of Allen Murphy > Sent: Tuesday, 11 April 2006 02:20 > To: gambas-user at lists.sourceforge.net > Subject: Re: [Gambas-user] Least Common Multiple > > If one or more of the values is zero then the LCM would have to be zero. > That said, I think there is also a logic problem in you WHILE statement. > With "AND" all the remainders would have to be non-zero, but as long as one > is non-zero you need to keep looking. I used this code to test teh LCM and > using "OR" gave the correct result (I tested with 3, 4, 6 and 3, 5, 7). > > STATIC PUBLIC SUB Main() > > DIM first AS Integer > DIM secnd AS Integer > DIM third AS Integer > > DIM vmax AS Integer > DIM loops AS Integer > > PRINT "Enter three numbers:" > INPUT first > INPUT secnd > INPUT third > > vmax = Max(first, secnd, third) > loops = vmax > > IF first <> 0 AND secnd <> 0 AND third <> 0 THEN > > WHILE loops MOD first <> 0 OR loops MOD secnd <> 0 OR loops MOD third <> > 0 > PRINT "new = " & Str(loops) > loops = loops + vmax > WEND > > PRINT "LCM = " & Str(loops) > > ELSE > > PRINT "LCM = 0" > > END IF > > END > > Hope this helps, > Allen > > > On 4/10/06, Peter Moers wrote: > > hi, > > > > I'm trying to calculate the least common multiple of 3 integers I > > tried the following code but had to find out it doesn't work when > > xs,ys or zs equals 0. > > > > DIM vmax AS Integer = Max(xs, ys, zs) > > DIM loops AS Integer = vmax > > WHILE loops MOD xs <> 0 AND loops MOD ys <> 0 AND loops MOD zs <> 0 > > loops = loops + vmax > > WEND > > > > Now, I can split it up in 3 loops after checking the values for not > > being 0 but I think it must be able to do this with less code. > > Suggestions? > > > > Maybe LCM could implemented into the Gambas language, would be usefull. > > > > > > regards, > > > > -- > > Peter Moers > > peter.moers at ...1417... > > Divides Webdesign - http://www.divides.be > > Startpagina - http://www.321start.be > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > > that extends applications into web and mobile media. Attend the live > webcast > > and join the prime developer group breaking into this new coding > territory! > > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From peter.moers at ...626... Tue Apr 11 17:21:11 2006 From: peter.moers at ...626... (Peter Moers) Date: Tue, 11 Apr 2006 17:21:11 +0200 Subject: [Gambas-user] Reading from Process Message-ID: <6cb911930604110821n62337454h5b5272372df01e7c@...627...> hi, Yet another problem :). To control the parallel port I've written a small program in C that keeps running waiting for input. Sending text to the process goes good with PRINT #$hProc... But when I do printf("blah\n") in C Process_Read() isn't fired in Gambas. I tried to run my program in the console example and it has the same problem. When I make it crash (no error handling at all in my C program) I get the error message but not my data right before it ends. In a terminal it does what it has to do. It's probably something in the C program. I always end printf with \n but that seems not to be enough to fire Process_Read() although the program is EXEC ["lptcmd"] FOR READ WRITE. I just learned some C to write this program, so if printf() isn't good please explain what I should use and why. Maybe one day I'll speak C and Gambas fluently :) regards, -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From admin at ...1080... Tue Apr 11 23:02:09 2006 From: admin at ...1080... (Werner Staudacher) Date: Tue, 11 Apr 2006 23:02:09 +0200 Subject: [Gambas-user] Tooltip from Treeview does not how expected In-Reply-To: <200604111044.32122.gambas@...1...> References: <443836BE.8080002@...1080...> <200604111044.32122.gambas@...1...> Message-ID: <443C1951.9090101@...1080...> Benoit Minisini wrote: > On Sunday 09 April 2006 00:18, Werner Staudacher wrote: > >> The tooltip is only shown over the scrollbars but not inside the "inner" >> control. >> In fact i was trying to give some info when the user moves the mouse >> over the items. >> I use gambas 1.0.13. >> >> Regards, staudi >> >> > > I think I fixed the bug now. You will get it in the next stable version (and > development too). > > Regards, > > Wow, good service. Thank you very much. Regards, Staudi From wspinto at ...1405... Wed Apr 12 02:30:03 2006 From: wspinto at ...1405... (wspinto at ...1405...) Date: Tue, 11 Apr 2006 21:30:03 -0300 Subject: [Gambas-user] gb.image what works??? In-Reply-To: <20060411030717.C163C89789@...763...> References: <20060411030717.C163C89789@...763...> Message-ID: <1144801803.443c4a0b2da8c@...1418...> Hi! I'm like be whats works the gb.image property. my programmer nivel in gambas is beginner. If any people help me, please send examples of the gb.image (blur, gradient, etc...) Tks, Wellington ___________________________________________________________________________________ Click21 A Internet gr?tis com a qualidade Embratel Baixe agora o discador www.click21.com.br From gambas at ...1... Wed Apr 12 06:39:53 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 12 Apr 2006 06:39:53 +0200 Subject: [Gambas-user] Reading from Process In-Reply-To: <6cb911930604110821n62337454h5b5272372df01e7c@...627...> References: <6cb911930604110821n62337454h5b5272372df01e7c@...627...> Message-ID: <200604120639.54141.gambas@...1...> On Tuesday 11 April 2006 17:21, Peter Moers wrote: > hi, > Yet another problem :). > To control the parallel port I've written a small program in C that > keeps running waiting for input. Sending text to the process goes good > with PRINT #$hProc... But when I do printf("blah\n") in C > Process_Read() isn't fired in Gambas. I tried to run my program in the > console example and it has the same problem. When I make it crash (no > error handling at all in my C program) I get the error message but not > my data right before it ends. In a terminal it does what it has to do. > It's probably something in the C program. I always end printf with \n > but that seems not to be enough to fire Process_Read() although the > program is EXEC ["lptcmd"] FOR READ WRITE. > I just learned some C to write this program, so if printf() isn't good > please explain what I should use and why. Maybe one day I'll speak C > and Gambas fluently :) > > regards, > > -- > Peter Moers > peter.moers at ...1417... > Divides Webdesign - http://www.divides.be > Startpagina - http://www.321start.be > What happens if you call 'fflush(stdout)' just after your printf() ? -- Benoit Minisini From maillists at ...1367... Wed Apr 12 10:08:36 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 12 Apr 2006 01:08:36 -0700 Subject: [Gambas-user] gb.image what works??? In-Reply-To: <1144801803.443c4a0b2da8c@...1418...> References: <20060411030717.C163C89789@...763...> <1144801803.443c4a0b2da8c@...1418...> Message-ID: <1144829316.19986.1.camel@...1368...> I've attached a simple image viewer I use in my browser project. Uses Gambas 1.0.14. Jeff On Tue, 2006-04-11 at 21:30 -0300, wspinto at ...1405... wrote: > Hi! > > I'm like be whats works the gb.image property. > my programmer nivel in gambas is beginner. > > If any people help me, please send examples of the gb.image (blur, gradient, > etc...) > > Tks, > > Wellington -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- A non-text attachment was scrubbed... Name: imageviewer.tgz Type: application/x-compressed-tar Size: 17048 bytes Desc: not available URL: From maillists at ...1367... Wed Apr 12 10:15:52 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 12 Apr 2006 01:15:52 -0700 Subject: [Gambas-user] gb.image what works??? In-Reply-To: <1144829316.19986.1.camel@...1368...> References: <20060411030717.C163C89789@...763...> <1144801803.443c4a0b2da8c@...1418...> <1144829316.19986.1.camel@...1368...> Message-ID: <1144829752.20202.1.camel@...1368...> Oops. Found a small bug in the last one. Please use this one instead. Regards, Jeff On Wed, 2006-04-12 at 01:08 -0700, GuruLounge - MailLists wrote: > I've attached a simple image viewer I use in my browser project. Uses > Gambas 1.0.14. > > Jeff > > On Tue, 2006-04-11 at 21:30 -0300, wspinto at ...1405... wrote: > > Hi! > > > > I'm like be whats works the gb.image property. > > my programmer nivel in gambas is beginner. > > > > If any people help me, please send examples of the gb.image (blur, gradient, > > etc...) > > > > Tks, > > > > Wellington > -- .^. /V\ /( )\ ^^-^^ Linux Advocate -------------- next part -------------- A non-text attachment was scrubbed... Name: imageviewer.tgz Type: application/x-compressed-tar Size: 17172 bytes Desc: not available URL: From rohnny at ...1248... Wed Apr 12 20:22:07 2006 From: rohnny at ...1248... (R. Stormo) Date: Wed, 12 Apr 2006 11:22:07 -0700 (PDT) Subject: [Gambas-user] Dapper qt problem gambas2 - 28 Message-ID: <3887181.post@...1379...> Still fighting to get gambas2 to compile with ubuntu dapper. I have manually installed qt3 to be shure that they would be installed, but still gb.qt are disabled. :( Setter opp libqt3-headers (3.3.6-1ubuntu3) ... Setter opp libqt3-mt (3.3.6-1ubuntu3) ... Setter opp libqt3-mt-dev (3.3.6-1ubuntu3) ... Setter opp libqt3-mt-sqlite (3.3.6-1ubuntu3) ... Setter opp libqt3-compat-headers (3.3.6-1ubuntu3) ... Please could someone help? -- Regards R. Stormo ----------------------------------------- Gambas brings Basic to Linux. My Gambas Community http://forum.stormweb.no -- View this message in context: http://www.nabble.com/Dapper-qt-problem-gambas2---28-t1439741.html#a3887181 Sent from the gambas-user forum at Nabble.com. From mwebb at ...1362... Thu Apr 13 08:04:18 2006 From: mwebb at ...1362... (mike webb) Date: Thu, 13 Apr 2006 06:04:18 +0000 Subject: [Gambas-user] code correction/change in example program database Message-ID: <443DE9E2.3040807@...1362...> in gambas 2-1.9.28 in the example program "database": in the file ftest.class. in the sub form_open() you have the following lines: with databrowser1.tableview .columns[0].text = "id" .columns[0].width = 48 .columns[1].text = "active" .columns[2].text = "name" end with i think the lines .columns[*].text are no longer needed because you now fill that info in via the propertys window ?? when i comment them out everything still seems to work. From m0nty at ...31... Fri Apr 14 08:49:49 2006 From: m0nty at ...31... (monty) Date: Fri, 14 Apr 2006 08:49:49 +0200 Subject: [Gambas-user] Gambas 1.0.15 Message-ID: <200604140849.49992.m0nty@...31...> Hello. When I build a SUSE-RPM of my Programm, the generated tar.bz2 in /RPM/SOURCES should be gbShoutcast-0.0.3.tar.bz2 but it is &1-&2.&3.tar.bz2gbShoutcast-0.0.tar.bz2 and the IDE crashes with this Popup: This application has raised an unexpected error and must abort. [-1] error: File /home/monty/RPM/SOURCES/gbShoutcast-&1.&20.0.tar.bz2: No such file or directory . Package.MakePackage.440 This is just since 1.0.15. 1.0.13/14 worked fine. Im using SUSE10.0, KDE 3.5.1a Thx, montY From gambas at ...1... Fri Apr 14 13:04:12 2006 From: gambas at ...1... (Benoit Minisini) Date: Fri, 14 Apr 2006 13:04:12 +0200 Subject: [Gambas-user] Gambas 1.0.15 In-Reply-To: <200604140849.49992.m0nty@...31...> References: <200604140849.49992.m0nty@...31...> Message-ID: <200604141304.12560.gambas@...1...> On Friday 14 April 2006 08:49, monty wrote: > Hello. > > When I build a SUSE-RPM of my Programm, the generated tar.bz2 > in /RPM/SOURCES should be > > gbShoutcast-0.0.3.tar.bz2 > > but it is > > &1-&2.&3.tar.bz2gbShoutcast-0.0.tar.bz2 > > and the IDE crashes with this Popup: > > This application has raised an unexpected > error and must abort. > [-1] error: File /home/monty/RPM/SOURCES/gbShoutcast-&1.&20.0.tar.bz2: No > such file or directory . > Package.MakePackage.440 > > > This is just since 1.0.15. > 1.0.13/14 worked fine. > > Im using SUSE10.0, KDE 3.5.1a > > > Thx, montY > > There is a bug in the Subst() function in 1.0.15. I will make a 1.0.16 with a fix as soon as possible. Regards, -- Benoit Minisini From peter.moers at ...626... Fri Apr 14 23:14:46 2006 From: peter.moers at ...626... (Peter Moers) Date: Fri, 14 Apr 2006 23:14:46 +0200 Subject: [Gambas-user] Reading from Process In-Reply-To: <200604120639.54141.gambas@...1...> References: <6cb911930604110821n62337454h5b5272372df01e7c@...627...> <200604120639.54141.gambas@...1...> Message-ID: <6cb911930604141414j33ef205wdaf4713ad7136087@...627...> fflush(stdout); did the job for the command line example moved my procedure from a module to the main form and now things go fine. thanks for your help! 2006/4/12, Benoit Minisini : > On Tuesday 11 April 2006 17:21, Peter Moers wrote: > > hi, > > Yet another problem :). > > To control the parallel port I've written a small program in C that > > keeps running waiting for input. Sending text to the process goes good > > with PRINT #$hProc... But when I do printf("blah\n") in C > > Process_Read() isn't fired in Gambas. I tried to run my program in the > > console example and it has the same problem. When I make it crash (no > > error handling at all in my C program) I get the error message but not > > my data right before it ends. In a terminal it does what it has to do. > > It's probably something in the C program. I always end printf with \n > > but that seems not to be enough to fire Process_Read() although the > > program is EXEC ["lptcmd"] FOR READ WRITE. > > I just learned some C to write this program, so if printf() isn't good > > please explain what I should use and why. Maybe one day I'll speak C > > and Gambas fluently :) > > > > regards, > > > > -- > > Peter Moers > > peter.moers at ...1417... > > Divides Webdesign - http://www.divides.be > > Startpagina - http://www.321start.be > > > > What happens if you call 'fflush(stdout)' just after your printf() ? > > -- > Benoit Minisini > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Peter Moers peter.moers at ...1417... Divides Webdesign - http://www.divides.be Startpagina - http://www.321start.be From kztyrvlq at ...966... Sat Apr 15 01:12:06 2006 From: kztyrvlq at ...966... (A Person) Date: Fri, 14 Apr 2006 20:42:06 -0230 Subject: [Gambas-user] UnRandom (?) Rnd - 1.0.14 Message-ID: <44402C46.9080400@...966...> Good Day All . . . I wrote a game that starts with a randomly chosen player. I have run the game in development hundreds (thousands?) of times and I noticed that Player 4 seemed to be getting most of the starts. I created the following code to test the Randomize() and Rnd features and in every run up to 100, to 1000, to 10000, to 100000, to 1000000, to 10000000, and to 100000000 (a long time, almost 7 minutes) the results were the same. Player 1 got the least hits. Player 2 got the second least hits. Player 3 got the second most hits and Player 4 got the most hits. The printed product of the below code on my machine is: Most Player 4 46,210,088 46.2% 2nd Most Player 3 26,145,322 26.1% 2nd Least Player 2 15,446,635 15.4% Least Player 1 12,197,955 12.1% A second run gave me: Most Player 4 47,863,756 47.8% 2nd Most Player 3 25,075,674 25.1% 2nd Least Player 2 14,560,201 14.6% Least Player 1 12,500,369 12.5% It doesn't seem to be more than 1 percentage point out on each run. One hundred million is an excellent testing base. Player 5 is added only to check for any leakage. It was always zero. I do not have 1.0.15 yet but is this a problem? As always, what am I doing wrong? p.s. I realise that Gambas has other mechanisms for random number generation. . . . PUBLIC SUB Form_Open() DIM iLap AS Integer DIM i1 AS Integer DIM i2 AS Integer DIM i3 AS Integer DIM i4 AS Integer DIM i5 AS Integer DO UNTIL iLap = 100000000 ' one hundred million Randomize() SELECT CASE Int(Rnd(1, 5)) CASE 1 i1 = i1 + 1 CASE 2 i2 = i2 + 1 CASE 3 i3 = i3 + 1 CASE 4 i4 = i4 + 1 CASE 5 i5 = i5 + 1 END SELECT iLap = iLap + 1 LOOP PRINT i1, i2, i3, i4, i5 End . . . Paul From frankberg at ...390... Sat Apr 15 02:16:57 2006 From: frankberg at ...390... (Frank Berg) Date: Sat, 15 Apr 2006 02:16:57 +0200 Subject: [Gambas-user] UnRandom (?) Rnd - 1.0.14 References: <44402C46.9080400@...966...> Message-ID: <000c01c66021$e8ab8560$0200a8c0@...391...> Hi, i was correct the code frank ps the Randomize() will init the rnd procedre.. and then the rnd() get the next random number. to use every time Randomize(), is starting every time a new random sequence. you can see in you code, the output you receive is not a realy random. > . . . > PUBLIC SUB Form_Open() > > DIM iLap AS Integer > DIM i1 AS Integer > DIM i2 AS Integer > DIM i3 AS Integer > DIM i4 AS Integer > DIM i5 AS Integer > Randomize() ' insert here > DO UNTIL iLap = 100000000 ' one hundred million ******> Randomize() ' is here to delete > SELECT CASE Int(Rnd(1, 5)) > CASE 1 > i1 = i1 + 1 > CASE 2 > i2 = i2 + 1 > CASE 3 > i3 = i3 + 1 > CASE 4 > i4 = i4 + 1 > CASE 5 > i5 = i5 + 1 > END SELECT > iLap = iLap + 1 > LOOP > > PRINT i1, i2, i3, i4, i5 > > End > . . . > > Paul > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > From marco.colnaghi at ...69... Sun Apr 16 17:07:36 2006 From: marco.colnaghi at ...69... (Marco Colnaghi) Date: Sun, 16 Apr 2006 17:07:36 +0200 Subject: [Gambas-user] Getting sound duration Message-ID: <200604161707.36432.marco.colnaghi@...69...> Hi everybody, I'm using gambas 1.0.15 and I can't figure out how to obtain a sound file (mp3,ogg,wav) duration. I chceked sdl component but I did not find any useful methot for that. Thanks for your help! Bye,Marco. From kztyrvlq at ...966... Sun Apr 16 17:18:19 2006 From: kztyrvlq at ...966... (A Person) Date: Sun, 16 Apr 2006 12:48:19 -0230 Subject: [Gambas-user] Re: Re: UnRandom (?) Rnd - 1.0.14 Message-ID: <4442603B.60303@...966...> Thank You for the reply. Good Bye . . . Paul From gambas at ...1... Sun Apr 16 20:17:59 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 16 Apr 2006 20:17:59 +0200 Subject: [Gambas-user] Getting sound duration In-Reply-To: <200604161707.36432.marco.colnaghi@...69...> References: <200604161707.36432.marco.colnaghi@...69...> Message-ID: <200604162017.59461.gambas@...1...> On Sunday 16 April 2006 17:07, Marco Colnaghi wrote: > Hi everybody, > > I'm using gambas 1.0.15 and > I can't figure out how to obtain a sound file (mp3,ogg,wav) duration. > I chceked sdl component but I did not find any useful methot for that. > > Thanks for your help! > > Bye,Marco. > Alas there is no way to get the duration of a sound with sdl. I hope it will be possible in a next version. Regards, -- Benoit Minisini From ronstk at ...239... Sun Apr 16 21:18:12 2006 From: ronstk at ...239... (ron) Date: Sun, 16 Apr 2006 21:18:12 +0200 Subject: [Gambas-user] How do I get the database name from Connection.Databases Message-ID: <200604162118.13896.ronstk@...239...> I want to get the names of the databases on a connection dim hConn as connection set user,pass etc and hConn.open now I should be able to get from hConn.Dataases the names but how ? The local help says only: PROPERTY Databases AS Object The website says: ----------- Connection.Databases (gb.db) PROPERTY Databases AS .ConnectionDatabases ----------- the link: .ConnectionDatabases says: .ConnectionDatabases (gb.db) This is a collection of all databases managed by the database server. You may not see every database if the user you used to connect to the server do not have sufficient rights. This class inherits .SubCollection in gb - Gambas Internal native classes. In the link to 'gb - Gambas Internal native classes' there is no sign of SubCollection ? This class is enumerable with the FOR EACH keyword. Properties: Count & length Method: Add, Exist & Remove note: bit stupid to generate keys for Exist() of 1...n char of a-zA-Z0-9 ----------- for .SubCollection (gb) I get This virtual class is the parent class of every collection of sub-objects. Properties: Count & length Method: Exist This class is enumerable with the FOR EACH keyword. ----------- Both tell me the FOR EACH but how to do that excact? FOR EACH Variable IN Expression Expression must be a reference to an enumerable object: for example, a collection, or an array. The Expression is .ConnectionDatabases or .SubCollection The Variable must be what kind of datatype if any FOR EACH Expression This syntax must be used when Expression is a enumerable object that is not a real container: for example, the result of a database query. FOR EACH hconn.Databases print hconn.Databases[key] ' the key is the thing I want NEXT FOR Variable = Expression TO Expression [ STEP Expression ] FOR x = 0 TO hconn.Databases.length - 1 print "database name=" & ????? hconn.Databases[x] NEXT In hconn.Databases[x] x must be the key as string If it is the name then it does not work, I don't know the names and just want them. If x can be a integer wich property tell me the name for that key as index? Currently I do PRIVATE SUB FillListBox(sql AS String, obj AS ListBox) DIM res AS Result res = hconn.Exec(sql) WITH obj .Clear WHILE res.Available .Add(res[0]) res.MoveNext WEND END WITH END PUBLIC SUB ListBoxDBUpdate() DIM sql AS String sql = "show databases" FillListBox(sql, ListboxDB) END As work arround the res = hconn.Exec(sql). However I should not use the .Exec as told in the help. if hConn.Databases returns a String[] and the list property of the listbox ask for a String[] the next line solved everything ListBox1.list = hConn.Databases For ListBox.List PROPERTY List AS String Returns or sets the ListBox contents with a string. Each element in the string must be delimited by a newline character. ListBox1.list = hConn.Databases.Join("\n") ListBox1.list So my request is what does Connection.Databases give me in real live. In fact the Connection.Tables is the same problem. ---- mfg Ron From gambas at ...1... Sun Apr 16 22:10:34 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 16 Apr 2006 22:10:34 +0200 Subject: [Gambas-user] Wiki is down Message-ID: <200604162210.34497.gambas@...1...> Hi, I'm currently trying to update the wiki, so it is down until I finish! Regards, -- Benoit Minisini From ronstk at ...239... Sun Apr 16 23:30:34 2006 From: ronstk at ...239... (ron) Date: Sun, 16 Apr 2006 23:30:34 +0200 Subject: [Gambas-user] Wiki is down In-Reply-To: <200604162210.34497.gambas@...1...> References: <200604162210.34497.gambas@...1...> Message-ID: <200604162330.34690.ronstk@...239...> On Sunday 16 April 2006 22:10, Benoit Minisini wrote: > Hi, > > I'm currently trying to update the wiki, so it is down until I finish! > > Regards, > Please add in the body of the index.html a message that if no refresh/redirect is done in 1 second to click at a link as Goto the Help Sometimes people has that auto refresh switched off with purpose With that message he/she remembers it is switched off. On a empty page I go to another site (/. to read news i.e). Or say the gambasdoc site is again f***up :( TIA --- Ron From eeller at ...826... Mon Apr 17 05:21:36 2006 From: eeller at ...826... (Eldon Eller) Date: Sun, 16 Apr 2006 20:21:36 -0700 Subject: [Gambas-user] gambas will not run Message-ID: <444309C0.7090206@...826...> I recently upgraded from suse 9.2 to 10.0. Now, neither gambas nor my gambas applications will run. I see two possibilities, there may be others. 1. I occasionally get a alert saying, "Could not find mime type application/octet-stream. (not upon trying to open gambas, however). I can add a mime type octet-stream, but I do not know what application to apply. 2. Maybe the file that lists the locations to be searched for gambas does not have the right location, but I forget the name of that file and how to find it. Any suggestions would be appreciated. EEE From hendri at ...1354... Mon Apr 17 09:19:45 2006 From: hendri at ...1354... (hendri) Date: Mon, 17 Apr 2006 15:19:45 +0800 Subject: [Gambas-user] about key check In-Reply-To: <444309C0.7090206@...826...> Message-ID: <002001c661ef$4ea19c50$a400a8c0@...1355...> can someone lead me to an example of how I can check for keyboard's keypressed so I can trap for : 01. upper case only when user type something, and 02. permits only numeric input thanks. From maillists at ...1367... Mon Apr 17 11:17:04 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Mon, 17 Apr 2006 02:17:04 -0700 Subject: [Gambas-user] about key check In-Reply-To: <002001c661ef$4ea19c50$a400a8c0@...1355...> References: <002001c661ef$4ea19c50$a400a8c0@...1355...> Message-ID: <1145265424.6232.10.camel@...1368...> You generally have to use the KeyPress event of a particular control then read the "key.code" integer for the key that was pressed. There are a number of constants related to different keys. I've browsed the info under "help". I should note that I've had trouble with the "ENTER" key. The keypad ENTER and regular ENTER have different codes so I've had to monitor them with the direct values 4100 and 4101 which isn't recommended. All the same I still scan for regular ASCII codes when using "key.code". example: PUBLIC SUB textbox1_KeyPress() intkeycode = key.code if ((intkeycode = 4100) or (intkeycode = 4101)) then 'ENTER key was pressed (keypad or regular). endif if ((intkeycode > 96) and (intkeycode < 123)) then 'lowercase letter endif if ((intkeycode > 64) and (intkeycode < 91)) then 'UPPERCASE LETTER endif if ((intkeycode > 47) and (intkeycode < 58)) then 'number endif END HTH, Jeff On Mon, 2006-04-17 at 15:19 +0800, hendri wrote: > can someone lead me to an example of how I can check for keyboard's > keypressed so I can trap for : > > 01. upper case only when user type something, and > 02. permits only numeric input > > thanks. -- .^. /V\ /( )\ ^^-^^ Linux Advocate From ronstk at ...239... Mon Apr 17 13:11:28 2006 From: ronstk at ...239... (ron) Date: Mon, 17 Apr 2006 13:11:28 +0200 Subject: [Gambas-user] gambas will not run In-Reply-To: <444309C0.7090206@...826...> References: <444309C0.7090206@...826...> Message-ID: <200604171311.28959.ronstk@...239...> On Monday 17 April 2006 05:21, Eldon Eller wrote: > I recently upgraded from suse 9.2 to 10.0. Now, neither gambas nor my > gambas applications will run. I see two possibilities, there may be others. > > 1. I occasionally get a alert saying, "Could not find mime type > application/octet-stream. (not upon trying to open gambas, however). I > can add a mime type octet-stream, but I do not know what application to > apply. > > 2. Maybe the file that lists the locations to be searched for gambas > does not have the right location, but I forget the name of that file and > how to find it. > > Any suggestions would be appreciated. EEE > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > I found just the stinky file on my box again look in :/home/ron/.kde/share/mimelnk/application octet-stream.desktop [Desktop Entry] Comment=FLash Video Hidden=false Icon= Patterns=*.flv octet-stream.desktop.goaway [Desktop Entry] Hidden=true MimeType=application/octet-stream Type=MimeType /home/ron/.kde/share/mimelnk/.home/ron/.kde/share/mimelnk/application octet-stream.desktop [Desktop Entry] Hidden=true MimeType=application/octet-stream Type=MimeType If I delete the accociation for the *.flv i wil get the same problem. /home/ron/.kde/share/mimelnk/application /home/ron/.kde/share/mimelnk/.home/ron/.kde/share/mimelnk/application Both should not exist. The 'octet-stream.desktop.goaway' I made in the past to remmenber this problem. How did I get the one with Flas Video? In konqueror i had a file ending in .flv Use of menubar->edit->edit_file_type There was no entry for *.flv so i add a extension and add the 'Flash Video' as description for it. Then add a program to use for it, kmplayer from the applications window. I do not remember if I typed or selected in the multimedia folder. This problem with 'octet-stream' has hapend more and is a bug somewhere in KDE. /home/ron/.kde/share/mimelnk/.home/ron/.kde/share/mimelnk/application is a good sign of it. Bit stupid to say: '.home/ron/.kde/share/mimelnk/application inside' '/home/ron/.kde/share/mimelnk/' I think the '.home' in the path makes it not resolvable and then the write the whole path at the wrong place to be sure it exist. BTW I'm not shure of KDE only because as I found also many where using SuSE so it can be SuSE/KDE. Rename the 'octet-stream.desktop' in you home path and ccheck it is gone. One of your _own_ accociations is gone to, read them with editor and you know wich. ---- Ron From ronstk at ...239... Mon Apr 17 13:28:31 2006 From: ronstk at ...239... (ron) Date: Mon, 17 Apr 2006 13:28:31 +0200 Subject: [Gambas-user] about key check In-Reply-To: <002001c661ef$4ea19c50$a400a8c0@...1355...> References: <002001c661ef$4ea19c50$a400a8c0@...1355...> Message-ID: <200604171328.31647.ronstk@...239...> On Monday 17 April 2006 09:19, hendri wrote: > can someone lead me to an example of how I can check for keyboard's > keypressed so I can trap for : > > 01. upper case only when user type something, and > 02. permits only numeric input > > thanks. > huu???? Where was that message you reply? Re: [Gambas-user] about key check Normal if I want to ask something different I start 'New Message' instead 'Reply' Many use the messages in tread view and only see messages without the 'RE:' That way you do not mess up questions from other people. X-Mailer: Microsoft Outlook, Build 10.0.2627 can do the 'Treaded View' and 'New Message' too. With treaded view you see the messages in a ordered way by subject and not by received day wich give a mess in your messages list to find the first message the reply (RE:) is. Special for Maillists, like gambas, it will serve you well. BTW: Are you running gambas on a windows box? Greets ---- Ron From ronstk at ...239... Mon Apr 17 13:42:26 2006 From: ronstk at ...239... (ron) Date: Mon, 17 Apr 2006 13:42:26 +0200 Subject: [Gambas-user] gambas will not run In-Reply-To: <444309C0.7090206@...826...> References: <444309C0.7090206@...826...> Message-ID: <200604171342.26220.ronstk@...239...> On Monday 17 April 2006 05:21, Eldon Eller wrote: > I recently upgraded from suse 9.2 to 10.0. Now, neither gambas nor my > gambas applications will run. I see two possibilities, there may be others. > > 1. I occasionally get a alert saying, "Could not find mime type > application/octet-stream. (not upon trying to open gambas, however). I > can add a mime type octet-stream, but I do not know what application to > apply. > > 2. Maybe the file that lists the locations to be searched for gambas > does not have the right location, but I forget the name of that file and > how to find it. > > Any suggestions would be appreciated. EEE Oh and think about RE: messages filters against spam. Rule if 'To' contains 'gambas-*@lists.sourceforge.net' move to folder 'gambas-*' if header contains 'X-Mailer: Microsoft Outlook, ' and if header contains 'X-MimeOLE: Produced By Microsoft MimeOLE' and if message is reply and subject is not equal message the reply is move to trash For me now already move to spam if both header lines occur. Well known people/addresses are in the whitelist. Very effective against those watch and stock market spam. --- Ron From gambas at ...1... Mon Apr 17 13:53:43 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 17 Apr 2006 13:53:43 +0200 Subject: [Gambas-user] Wiki is down In-Reply-To: <200604162330.34690.ronstk@...239...> References: <200604162210.34497.gambas@...1...> <200604162330.34690.ronstk@...239...> Message-ID: <200604171353.43812.gambas@...1...> On Sunday 16 April 2006 23:30, ron wrote: > On Sunday 16 April 2006 22:10, Benoit Minisini wrote: > > Hi, > > > > I'm currently trying to update the wiki, so it is down until I finish! > > > > Regards, > > Please add in the body of the index.html a message that if no > refresh/redirect is done in 1 second to click at a link as > Goto the Help > > Sometimes people has that auto refresh switched off with purpose > With that message he/she remembers it is switched off. > > On a empty page I go to another site (/. to read news i.e). > > Or say the gambasdoc site is again f***up :( > > TIA > --- > Ron > OK, done. The wiki is up again. Now you can upload images to the server. The convention is that every page whose name begins with ':' is an image. For example, the '/:logo' path points at the new Gambas logo. To insert it into a page, use the link syntax: '[/:logo]'. The problem is that images are not yet displayed. This need a server restart, which I cannot do myself. Regards, -- Benoit Minisini From ronstk at ...239... Mon Apr 17 15:10:34 2006 From: ronstk at ...239... (ron) Date: Mon, 17 Apr 2006 15:10:34 +0200 Subject: [Gambas-user] gambas will not run In-Reply-To: <444309C0.7090206@...826...> References: <444309C0.7090206@...826...> Message-ID: <200604171510.35406.ronstk@...239...> On Monday 17 April 2006 05:21, Eldon Eller wrote: > I recently upgraded from suse 9.2 to 10.0. Now, neither gambas nor my > gambas applications will run. I see two possibilities, there may be others. > > 1. I occasionally get a alert saying, "Could not find mime type > application/octet-stream. (not upon trying to open gambas, however). I > can add a mime type octet-stream, but I do not know what application to > apply. > > 2. Maybe the file that lists the locations to be searched for gambas > does not have the right location, but I forget the name of that file and > how to find it. > > Any suggestions would be appreciated. EEE I have renamed both octet-stream and the .flv is gone. however every octet-stream can be played with 'kmplayer' i.e. i found a link to a library libpcre.so.0 (not valid anymore) File type says 'Flash Video' can be played with? kmplayer :) Select the application in your place Use Edit and go to tab Application Search in the mime type list the entry application/octed-stream See for Description 'Unknown' (after the rename of the desktop files is done) Now you should be safe to delete that entry to prevent your assigned application on the RMB (RightMouseButton) menu. In the File associations remove the app by application/octed-stream In a terminal/konsole run 'kbuildsycoca' (optional, to refresh everything) Start a new konqueror and look at the *.flv (my case) and see the file again as 'Unknown' is back. After this done the .gambas, to play with 'kmplayer' is again 'Unknown' If this problem started may be after you made a entry for gambas, copy one as example to you desktop. Edit apropiate and rename to gambas.desktop place it in the '/home/ron/.kde/share/mimelnk/application' and/or in the '/share/mimelnk/application' (as root) folder. I did the next now for test and to have it to. In the File associations, add new type. say 'application/x-gambas2' add Filename pattern '*.gambas' enter description 'Gambas exe' Add application and type 'gbr2' or '/usr/bin/gbr2' in the textbox. press OK Verify now with the Edit button at tab 'Application' Command is gbr2 and use the Advanced options, set 'Run in Terminal' on Try out on a *.gambas file The terminal stays open for duration of the gambas app works :) If all works OK then 'run in terminal' can switched off. Take a look in '/home/ron/.kde/share/mimelnk/application' Find the file 'x-gambas2.desktop' with content: [Desktop Entry] Comment=Gambas executable Hidden=false Icon= MimeType=application/x-gambas2 Patterns=*.gambas Type=MimeType goto '/home/ron/.kde/share/applnk/.hidden' Find file 'gbr2.desktop' with content: [Desktop Entry] Comment= Comment[en_US]= Exec=gbr2 GenericName= GenericName[en_US]= Icon= InitialPreference=2 MimeType=application/x-gambas2 Name=gbr2 Name[en_US]=gbr2 Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DCOP-ServiceType=none X-KDE-SubstituteUID=false X-KDE-Username= These both files are now new on my box and it works. SuSE 9.2, KDE 3.5.0 (a) SuSE version If you add these as files direct you must run kbuildsycoca !!! Have fun ---- Ron From ronstk at ...239... Mon Apr 17 15:45:37 2006 From: ronstk at ...239... (ron) Date: Mon, 17 Apr 2006 15:45:37 +0200 Subject: [Gambas-user] Wiki is down In-Reply-To: <200604171353.43812.gambas@...1...> References: <200604162210.34497.gambas@...1...> <200604162330.34690.ronstk@...239...> <200604171353.43812.gambas@...1...> Message-ID: <200604171545.37755.ronstk@...239...> On Monday 17 April 2006 13:53, Benoit Minisini wrote: > On Sunday 16 April 2006 23:30, ron wrote: > > On Sunday 16 April 2006 22:10, Benoit Minisini wrote: -------8<---- > > > > OK, done. > Thanks, much better ow :) > The wiki is up again. > > Now you can upload images to the server. The convention is that every page > whose name begins with ':' is an image. > > For example, the '/:logo' path points at the new Gambas logo. To insert it > into a page, use the link syntax: '[/:logo]'. > > The problem is that images are not yet displayed. This need a server restart, > which I cannot do myself. > > Regards, > LOL A simple gambas script should be able to take down? :) :) Then the admin must start it again. Can I get access to the wiki for edit/add/translate The last is expected to be a very big job. My intention with translate is only the descriptive text to do. The terms as 'expression/Components' etc not to translate but a kind of dictionary for explaining what it maen. Ron From hendri at ...1354... Tue Apr 18 05:07:35 2006 From: hendri at ...1354... (hendri) Date: Tue, 18 Apr 2006 11:07:35 +0800 Subject: [Gambas-user] about key check In-Reply-To: <200604171328.31647.ronstk@...239...> Message-ID: <000801c66295$3df7b190$a400a8c0@...1355...> Yes, I'm really sorry about this... I'm so lazy to make a new message and click To: button so I reply from other message but I forget to delete the 'RE:' in Subject... Forgive me for this. I run gambas in Fedora Core 4. I send this e-mail via other computer running windows xp. I'm in middle of trying to migrate to gambas (from vb and vf programming) Thanks. -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net] On Behalf Of ron Sent: Monday, April 17, 2006 7:29 PM To: gambas-user at lists.sourceforge.net Subject: Re: [Gambas-user] about key check On Monday 17 April 2006 09:19, hendri wrote: > can someone lead me to an example of how I can check for keyboard's > keypressed so I can trap for : > > 01. upper case only when user type something, and > 02. permits only numeric input > > thanks. > huu???? Where was that message you reply? Re: [Gambas-user] about key check Normal if I want to ask something different I start 'New Message' instead 'Reply' Many use the messages in tread view and only see messages without the 'RE:' That way you do not mess up questions from other people. X-Mailer: Microsoft Outlook, Build 10.0.2627 can do the 'Treaded View' and 'New Message' too. With treaded view you see the messages in a ordered way by subject and not by received day wich give a mess in your messages list to find the first message the reply (RE:) is. Special for Maillists, like gambas, it will serve you well. BTW: Are you running gambas on a windows box? Greets ---- Ron ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From ronstk at ...239... Tue Apr 18 05:48:25 2006 From: ronstk at ...239... (ron) Date: Tue, 18 Apr 2006 05:48:25 +0200 Subject: [Gambas-user] about key check In-Reply-To: <000801c66295$3df7b190$a400a8c0@...1355...> References: <000801c66295$3df7b190$a400a8c0@...1355...> Message-ID: <200604180548.25611.ronstk@...239...> On Tuesday 18 April 2006 05:07, hendri wrote: > Yes, I'm really sorry about this... > I'm so lazy to make a new message and click To: button so I reply from > other message but I forget to delete the 'RE:' in Subject... Forgive me > for this. > > I run gambas in Fedora Core 4. I send this e-mail via other computer > running windows xp. I'm in middle of trying to migrate to gambas (from > vb and vf > programming) > > Thanks. > > LOL If you use the Reply: button you do not need use the To: button, at least with a well written email program. That's a bit more work then use the new message button. If you use the To: button you have to search your whole adress book This also is more work then using New message. I'm using kmail and I can simple use New Mesage on the folder icon because the folder the messages are inside belong to a maillist. This way I have no extra work, To: is ready and new message presented to enter with a clean Subject line. I asume you are fresh on linux based system so welcome, i'm 3 years back switched also from VB and Access. Will be a hard job to forget the behaviours of it with gambas. Have a nice day ---- Ron BTW the other mail is gone by accident to the orginal poster of the thread My fault. From timothy.marshal-nichols at ...247... Tue Apr 18 14:11:59 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Tue, 18 Apr 2006 13:11:59 +0100 Subject: [Gambas-user] How do I get the database name from Connection.Databases In-Reply-To: <200604162118.13896.ronstk@...239...> Message-ID: Listing the databases on a connection and tables in a database is not as complex as you make out. But a quick example may make things easier to understand. PRIVATE SUB ListDatabases() DIM c AS NEW Connection DIM d AS Database c.Type = "mysql" c.Host = "localhost" c.Name = "" ' No need to set database name c.Login = "mysql" c.Password = "password" TRY c.Open IF ERROR THEN Message.Warning("Could not find databases\n\n" & ERROR.Text) RETURN END IF Listbox1.Clear() FOR EACH d IN c.Databases PRINT d.Name Listbox1.Add(d.Name) NEXT c.Close END PRIVATE SUB ListTables() DIM c AS NEW Connection DIM t AS Table c.Type = "mysql" c.Host = "localhost" c.Name = "GambasExample" c.Login = "mysql" c.Password = "password" TRY c.Open IF ERROR THEN Message.Warning("Could not find tables\n\n" & ERROR.Text) RETURN END IF Listbox1.Clear() FOR EACH t IN c.Tables PRINT t.Name Listbox1.Add(t.Name) NEXT c.Close END Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of ron Sent: Sunday, 16 April 2006 20:18 To: gambas-user at lists.sourceforge.net Subject: [Gambas-user] How do I get the database name from Connection.Databases I want to get the names of the databases on a connection dim hConn as connection set user,pass etc and hConn.open now I should be able to get from hConn.Dataases the names but how ? The local help says only: PROPERTY Databases AS Object The website says: ----------- Connection.Databases (gb.db) PROPERTY Databases AS .ConnectionDatabases ----------- the link: .ConnectionDatabases says: .ConnectionDatabases (gb.db) This is a collection of all databases managed by the database server. You may not see every database if the user you used to connect to the server do not have sufficient rights. This class inherits .SubCollection in gb - Gambas Internal native classes. In the link to 'gb - Gambas Internal native classes' there is no sign of SubCollection ? This class is enumerable with the FOR EACH keyword. Properties: Count & length Method: Add, Exist & Remove note: bit stupid to generate keys for Exist() of 1...n char of a-zA-Z0-9 ----------- for .SubCollection (gb) I get This virtual class is the parent class of every collection of sub-objects. Properties: Count & length Method: Exist This class is enumerable with the FOR EACH keyword. ----------- Both tell me the FOR EACH but how to do that excact? FOR EACH Variable IN Expression Expression must be a reference to an enumerable object: for example, a collection, or an array. The Expression is .ConnectionDatabases or .SubCollection The Variable must be what kind of datatype if any FOR EACH Expression This syntax must be used when Expression is a enumerable object that is not a real container: for example, the result of a database query. FOR EACH hconn.Databases print hconn.Databases[key] ' the key is the thing I want NEXT FOR Variable = Expression TO Expression [ STEP Expression ] FOR x = 0 TO hconn.Databases.length - 1 print "database name=" & ????? hconn.Databases[x] NEXT In hconn.Databases[x] x must be the key as string If it is the name then it does not work, I don't know the names and just want them. If x can be a integer wich property tell me the name for that key as index? Currently I do PRIVATE SUB FillListBox(sql AS String, obj AS ListBox) DIM res AS Result res = hconn.Exec(sql) WITH obj .Clear WHILE res.Available .Add(res[0]) res.MoveNext WEND END WITH END PUBLIC SUB ListBoxDBUpdate() DIM sql AS String sql = "show databases" FillListBox(sql, ListboxDB) END As work arround the res = hconn.Exec(sql). However I should not use the .Exec as told in the help. if hConn.Databases returns a String[] and the list property of the listbox ask for a String[] the next line solved everything ListBox1.list = hConn.Databases For ListBox.List PROPERTY List AS String Returns or sets the ListBox contents with a string. Each element in the string must be delimited by a newline character. ListBox1.list = hConn.Databases.Join("\n") ListBox1.list So my request is what does Connection.Databases give me in real live. In fact the Connection.Tables is the same problem. ---- mfg Ron ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From timothy.marshal-nichols at ...247... Tue Apr 18 21:26:54 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Tue, 18 Apr 2006 20:26:54 +0100 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <200604180548.25611.ronstk@...239...> Message-ID: I am using the Gambas database objects to create a database. Why on earth does Gambas always convert field names into lower case. You enter a field name of 'CreateDate' and Gambas always converts it to 'createdate'. I find this really annoying. It does not do this to table names or database names or the primary key field name!!! Why the hell does it mess up my field names. It's just plain stupid. Thanks 8-{)} Timothy Marshal-Nichols From gambas at ...1... Tue Apr 18 22:09:51 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 18 Apr 2006 22:09:51 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: References: Message-ID: <200604182209.52067.gambas@...1...> On Tuesday 18 April 2006 21:26, Timothy Marshal-Nichols wrote: > I am using the Gambas database objects to create a database. > > Why on earth does Gambas always convert field names into lower case. You > enter a field name of 'CreateDate' and Gambas always converts it to > 'createdate'. I find this really annoying. It does not do this to table > names or database names or the primary key field name!!! Why the hell does > it mess up my field names. It's just plain stupid. > > > Thanks > > 8-{)} Timothy Marshal-Nichols > > Because some database systems have case sensitive field names, and some others are not. The aim was to have the same code run whatever the database backend is. The solution I used was always converting field names to lowercase. If you have a better solution... Note that I find that annoying too. :-) Regards, -- Benoit Minisini From ronstk at ...239... Wed Apr 19 01:49:05 2006 From: ronstk at ...239... (ron) Date: Wed, 19 Apr 2006 01:49:05 +0200 Subject: [Gambas-user] How do I get the database name from Connection.Databases In-Reply-To: References: Message-ID: <200604190149.05711.ronstk@...239...> On Tuesday 18 April 2006 14:11, Timothy Marshal-Nichols wrote: > > Listing the databases on a connection and tables in a database is not as complex as you make out. But a quick example may make things easier to understand. > > PRIVATE SUB ListDatabases() > DIM c AS NEW Connection > DIM d AS Database > c.Type = "mysql" > c.Host = "localhost" > c.Name = "" ' No need to set database name > c.Login = "mysql" > c.Password = "password" > TRY c.Open > IF ERROR THEN > Message.Warning("Could not find databases\n\n" & ERROR.Text) > RETURN > END IF > Listbox1.Clear() > FOR EACH d IN c.Databases > PRINT d.Name > Listbox1.Add(d.Name) > NEXT > c.Close > END > > PRIVATE SUB ListTables() > DIM c AS NEW Connection > DIM t AS Table > c.Type = "mysql" > c.Host = "localhost" > c.Name = "GambasExample" > c.Login = "mysql" > c.Password = "password" > TRY c.Open > IF ERROR THEN > Message.Warning("Could not find tables\n\n" & ERROR.Text) > RETURN > END IF > Listbox1.Clear() > FOR EACH t IN c.Tables > PRINT t.Name > Listbox1.Add(t.Name) > NEXT > c.Close > END > > Thanks > > 8-{)} Timothy Marshal-Nichols ----8<--- OK, I do have more or less the same now. A explanation of the problem. The internal help says: PROPERTY Databases AS Object The website says: PROPERTY Databases AS .ConnectionDatabases and for .ConnectionDatabases it inherits .SubCollection None of them have the .Name property. For the property name it hints for multiple Database objects. DIM myDBs as Databases ' Databases does not exist DIM myDBs as Database[] ' Database[] is wrong myDBS = hConn.Databases 'not allowed for virtual class myDB =myDBs[index] \__ can't be done Print myDB.Name / myDB =hConn.Databases[index] 'OK Print myDB.Name 'OK You can't assing a variable with the content of a vitual class but can use the construction 'hConn.Databases' as the variable DIM db AS Database db = hConn.Databases[sKey] Now here the sKey is a String, say the help, I asume here it is the name of the Database to use as in other implementations/languages is done. The help would be more correct if told indexed by a String or Integer. If it is an index _number_ in the array it would/should be db = hConn.Databases[iIndex] If I must use DIM myDB as Object then print myDB.???? , the .Name does not exist for object Using Object for variable names is with the completion not good working by design :) Because I did not get a clear (data)type for Databases I did DIM v as Variant v=hConn.Databases[sKey] Using single step with gambas and a breakpoint at the v=hCo... I was able to see clearly that v was changed from Variant to Database. Now I know what I can use for the Properties/Methods/Events of the object under test and in this case a Database (no events (yet)). The missing point here is the explanation for .ConnectionDatabases and the Object. PROPERTY Databases AS .ConnectionDatabases The .ConnectionDatabases consists of a .Subcollection of multiple Database objects and a manager to add and remove a Database to the .SubCollection. .ConnectionDatabases AS Object | +--- the .SubCollection of 1 or more Database objects | | | --- .Exists() | ---- and manager to .Add and .Remove from .SubCollection For using a database you can use hConnection.DataBase[sKey as String] or the FOR EACH xx in hConnection.Databases method. Examples DIM myDB as Database myDB = hConnection.Database[sKey] DIM yourDB as Database FOR EACH yourDB in hConnection.Databases Print yourDB.Name 'calling a subroutine ShowTables(yourDB.Tables) NEXT Anyway thanks for the example as it can still be usefull for others to. ---- Ron From ronstk at ...239... Wed Apr 19 02:03:12 2006 From: ronstk at ...239... (ron) Date: Wed, 19 Apr 2006 02:03:12 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <200604182209.52067.gambas@...1...> References: <200604182209.52067.gambas@...1...> Message-ID: <200604190203.12214.ronstk@...239...> On Tuesday 18 April 2006 22:09, Benoit Minisini wrote: > On Tuesday 18 April 2006 21:26, Timothy Marshal-Nichols wrote: > > I am using the Gambas database objects to create a database. > > > > Why on earth does Gambas always convert field names into lower case. You > > enter a field name of 'CreateDate' and Gambas always converts it to > > 'createdate'. I find this really annoying. It does not do this to table > > names or database names or the primary key field name!!! Why the hell does > > it mess up my field names. It's just plain stupid. > > > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > Because some database systems have case sensitive field names, and some others > are not. The aim was to have the same code run whatever the database backend > is. > > The solution I used was always converting field names to lowercase. If you > have a better solution... > > Note that I find that annoying too. :-) > > Regards, > Let the names as the user it enters. It is his fault if the backend does not now the name in the case he ask. If some systems are case sensitive and are created with mixed case field names and gambas converting to lower case the user is in trouble now. He enters as field name 'CreateDate' as in the databse definied. gambas send 'createdate' and the backend don't understand it. It is the users requirement to enter the correct names or he has troubles. By auto changing to lowercase gambas is giving him the troubles. My 2 cents :) Ron From muthus_post at ...43... Wed Apr 19 06:27:46 2006 From: muthus_post at ...43... (Muthiah Annamalai) Date: Tue, 18 Apr 2006 21:27:46 -0700 (PDT) Subject: [Gambas-user] Mono & Gambas, In-Reply-To: <20060419030906.BFA721291C@...773...> Message-ID: <20060419042746.62190.qmail@...1419...> Hey guys! Gambas just compiled out of the Box on my FC3 machine, and I really like its friendliness, website,docs and basically the whole project. I was wondering if you guys know about the open source implementation of the .NET platform in MONO project. www.mono-project.com Is there an effort to implement your language over the MONO platform? BTW I think your GUI Editor is way way ahead of the generic editors. Thanks Muthu --------------------------------- Blab-away for as little as 1?/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronstk at ...239... Wed Apr 19 07:08:07 2006 From: ronstk at ...239... (ron) Date: Wed, 19 Apr 2006 07:08:07 +0200 Subject: [Gambas-user] No text visible in textbox Message-ID: <200604190708.08186.ronstk@...239...> db records 1 "medium text" 2 "very long text to show nothing when short follows" 3 "short" 4 "medium text again" The 4 buttons 'first' 'prev' 'next' and 'last' Textbox1 with size of record 4 characters txtPosit with the hResult.Index as position indicator When 'first' followed by a serie of 'next' then if the record 3 should be shown the textbox1 looks empty. After click in textbox1 when it looks empty the text occurs. If the focus (blinking cursor) stays in textbox1 and I click on the navigation buttons the text stays visible in that box. I verify with second Textbox2 and the same content as textbox1 IF hRecordData.Available THEN sKey = sFLDinProc textbox1.Text = hRecordData[sKey] textbox1.SetFocus textbox2.Text = hRecordData[sKey] textbox2.SetFocus txtPosit.Text = hRecordData.Index + 1 ENDIF Blinking cursor is during navigation in textbox2 and textbox1 look still blank so .SetFocus did not help. It occurs if a (very) long text is replaced by a short text by code. What is wrong? Ron From timothy.marshal-nichols at ...247... Wed Apr 19 09:55:17 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Wed, 19 Apr 2006 08:55:17 +0100 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <200604190203.12214.ronstk@...239...> Message-ID: Thanks. I was a bit annoyed when I sent that email. I have charmed down now. First thoughts. How about: 1. Send the field name to the database in the case entered by the user. 2. Before the field name is sent to the database check the name is unique in the table with a case insensitive test. Do not allow field names that fail the case insensitive test. Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of ron Sent: Wednesday, 19 April 2006 01:03 To: gambas-user at lists.sourceforge.net Subject: Re: [Gambas-user] RE: Database Field Names On Tuesday 18 April 2006 22:09, Benoit Minisini wrote: > On Tuesday 18 April 2006 21:26, Timothy Marshal-Nichols wrote: > > I am using the Gambas database objects to create a database. > > > > Why on earth does Gambas always convert field names into lower case. You > > enter a field name of 'CreateDate' and Gambas always converts it to > > 'createdate'. I find this really annoying. It does not do this to table > > names or database names or the primary key field name!!! Why the hell does > > it mess up my field names. It's just plain stupid. > > > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > Because some database systems have case sensitive field names, and some others > are not. The aim was to have the same code run whatever the database backend > is. > > The solution I used was always converting field names to lowercase. If you > have a better solution... > > Note that I find that annoying too. :-) > > Regards, > Let the names as the user it enters. It is his fault if the backend does not now the name in the case he ask. If some systems are case sensitive and are created with mixed case field names and gambas converting to lower case the user is in trouble now. He enters as field name 'CreateDate' as in the databse definied. gambas send 'createdate' and the backend don't understand it. It is the users requirement to enter the correct names or he has troubles. By auto changing to lowercase gambas is giving him the troubles. My 2 cents :) Ron ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From maillists at ...1367... Wed Apr 19 11:36:41 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 19 Apr 2006 02:36:41 -0700 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: References: Message-ID: <1145439402.9411.2.camel@...1368...> If you're stuck with lowercase in field names you could always get a little bit creative and try to store the field names in an optional field the keeps the case. Maybe even create a separate table just for field names and create unique field names based on that. Might be a b*tch for search and the like but it could be a work-around. HTH, Jeff On Wed, 2006-04-19 at 08:55 +0100, Timothy Marshal-Nichols wrote: > Thanks. I was a bit annoyed when I sent that email. I have charmed down now. > > First thoughts. How about: > > 1. Send the field name to the database in the case entered by the user. > 2. Before the field name is sent to the database check the name is unique in > the table with a case insensitive test. Do not allow field names that fail > the case insensitive test. > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From patrick.jacquot at ...1387... Wed Apr 19 12:59:22 2006 From: patrick.jacquot at ...1387... (Patrick JACQUOT) Date: Wed, 19 Apr 2006 12:59:22 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <1145439402.9411.2.camel@...1368...> References: <1145439402.9411.2.camel@...1368...> Message-ID: <4446180A.1060303@...1387...> GuruLounge - MailLists wrote: >If you're stuck with lowercase in field names you could always get a >little bit creative and try to store the field names in an optional >field the keeps the case. Maybe even create a separate table just for >field names and create unique field names based on that. > >Might be a b*tch for search and the like but it could be a work-around. > >HTH, >Jeff > >On Wed, 2006-04-19 at 08:55 +0100, Timothy Marshal-Nichols wrote: > > >>Thanks. I was a bit annoyed when I sent that email. I have charmed down now. >> >>First thoughts. How about: >> >>1. Send the field name to the database in the case entered by the user. >>2. Before the field name is sent to the database check the name is unique in >>the table with a case insensitive test. Do not allow field names that fail >>the case insensitive test. >> >>Thanks >> >>8-{)} Timothy Marshal-Nichols >> >> >> >> >> > > > AFAIK the case-insensitiveness of field names (and table names) is required by the SQL standard. Some SGBD allow case sensitiveness by various means e.g. in PostgreSQL when the name is enclosed in double quotes -- Patrick From ronstk at ...239... Wed Apr 19 15:36:40 2006 From: ronstk at ...239... (ron) Date: Wed, 19 Apr 2006 15:36:40 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <1145439402.9411.2.camel@...1368...> References: <1145439402.9411.2.camel@...1368...> Message-ID: <200604191536.41225.ronstk@...239...> On Wednesday 19 April 2006 11:36, GuruLounge - MailLists wrote: > If you're stuck with lowercase in field names you could always get a > little bit creative and try to store the field names in an optional > field the keeps the case. Maybe even create a separate table just for > field names and create unique field names based on that. > > Might be a b*tch for search and the like but it could be a work-around. > > HTH, > Jeff Yes it is creative with extra field to keep the orginal name but you miss the point The orginal field is on a db and case sensitive or the creator want it that way. Gambas should then use the extra field to get the fake lowercase name for a field with mixed case, stupid a simple locase("FieldName") does it. Think about SET FieldName1,FieldName2 IN MyTable Value(1,2) and for FieldName1 SELECT mixname FROM lookuptable WHERE locase='fieldname1' and same for FieldName2. That must be done in the above SQL line with the SET Gambas can do the lookup but can't use it because gambas convert that name again to lower case and can't access the mixed case field. When I do a select query and type 'FieldName' and the database has 'fieldname' but accept it then it is fine. If the DB engine does not accept it I have to enter as 'fieldname' The same when I type 'fieldname' and the DB has 'FieldName' For the topic starter it happens during the creation of the table. Then nothing should change the case he, you or I decide to use. Some people use as accented as 'field_name' other' FieldName' and that is the decision of the creator/programmer and not of the software he use for it. Maybe a Connection option to use lowercase to DB handler for fieldnames so the programmer can use mixed case on his wish but lower to DB. But consider the Column caption will be lowercase that way to on read. In MS Access you could enter the fieldname in mixed case and so the caption on display is also mixed. For extreem short names as 'adr' or 'fld_addres' or those with prefix as 'phpbb2_postal_address' you could enter a separate caption to use in the table designer for the tableview and field labels on the forms. No that is not the same as SELECT 'phpbb2_postal_address' AS Address FROM table It is the programmer that should use the correct case if the DB engine is case sensitive. The alias with _mixcase AS MixCase_ can help. Ron From ronstk at ...239... Wed Apr 19 16:08:12 2006 From: ronstk at ...239... (ron) Date: Wed, 19 Apr 2006 16:08:12 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: <4446180A.1060303@...1387...> References: <1145439402.9411.2.camel@...1368...> <4446180A.1060303@...1387...> Message-ID: <200604191608.12947.ronstk@...239...> On Wednesday 19 April 2006 12:59, Patrick JACQUOT wrote: > GuruLounge - MailLists wrote: > > >If you're stuck with lowercase in field names you could always get a > >little bit creative and try to store the field names in an optional > >field the keeps the case. Maybe even create a separate table just for > >field names and create unique field names based on that. > > > >Might be a b*tch for search and the like but it could be a work-around. > > > >HTH, > >Jeff > > > >On Wed, 2006-04-19 at 08:55 +0100, Timothy Marshal-Nichols wrote: > > > > > >>Thanks. I was a bit annoyed when I sent that email. I have charmed down now. > >> > >>First thoughts. How about: > >> > >>1. Send the field name to the database in the case entered by the user. > >>2. Before the field name is sent to the database check the name is unique in > >>the table with a case insensitive test. Do not allow field names that fail > >>the case insensitive test. > >> > >>Thanks > >> > >>8-{)} Timothy Marshal-Nichols > >> > >> > >> > >> > >> > > > > > > > AFAIK the case-insensitiveness of field names (and table names) is > required by the SQL standard. > Some SGBD allow case sensitiveness by various means > e.g. in PostgreSQL when the name is enclosed in double quotes > > -- > Patrick > For MySQL it is case sensitive for database and table names and not for fieldnames in phpmyadmin on linux and also gambas to http://dev.mysql.com/doc/refman/4.1/en/name-case-sensitivity.html 9.2.2. Identifier Case Sensitivity ---------------------------------- In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system determines the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default filesystem type (HFS+) that is not case sensitive. However, Mac OS X also supports UFS volumes, which are case sensitive just as on any Unix. See Section 1.9.4, ?MySQL Extensions to Standard SQL?. The lower_case_table_names system variable also affects how the server handles identifier case sensitivity, as described later in this section. Note: Although database and table names are not case sensitive on some platforms, you should not refer to a given database or table using different cases within the same statement. The following statement would not work because it refers to a table both as my_table and as MY_TABLE: From sourceforge-raindog2 at ...94... Wed Apr 19 17:58:34 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Wed, 19 Apr 2006 11:58:34 -0400 Subject: [Gambas-user] Mono & Gambas, In-Reply-To: <20060419042746.62190.qmail@...1419...> References: <20060419042746.62190.qmail@...1419...> Message-ID: <200604191158.35379.sourceforge-raindog2@...94...> On Wed April 19 2006 00:27, Muthiah Annamalai wrote: > Is there an effort to implement your language over the > MONO platform? Many people, up to and including Richard Stallman, have asked this question. I think the Mono guys are working on their own port of VB.net, and having a not-quite-compatible BASIC variant competing with it would be a waste of time. Speaking only for myself, I want to code in Gambas, not VB. Besides that, see here: http://gambasdoc.org/help/doc/faq Rob From gurpreet_bimbro at ...43... Thu Apr 20 13:35:12 2006 From: gurpreet_bimbro at ...43... (gurpreet singh) Date: Thu, 20 Apr 2006 04:35:12 -0700 (PDT) Subject: [Gambas-user] how to implement system calls in gambas Message-ID: <20060420113512.98786.qmail@...1420...> Hi everbody, I am new user to gambas and have experience in Visual Basics programming. I want to make system calls to communicate with the device. I want to use the system calls like the "open, read, write" function calls which deal with low level device drivers. The device is shown in the /dev directory. If someone had done some experience using system calls in gambas. please reply. Thank you Gurpreet --------------------------------- How low will we go? Check out Yahoo! Messenger?s low PC-to-Phone call rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maillists at ...1367... Thu Apr 20 17:00:42 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Thu, 20 Apr 2006 08:00:42 -0700 Subject: [Gambas-user] Gambas 1.0.15 RPMs. Message-ID: <1145545243.20603.1.camel@...1368...> Hello, Are the 1.0.15 RPMs available yet? Thanx, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From thiodor at ...626... Thu Apr 20 20:04:55 2006 From: thiodor at ...626... (Teodor) Date: Thu, 20 Apr 2006 21:04:55 +0300 Subject: [Gambas-user] Problem with Package maker Message-ID: <82a7421e0604201104v439afb1cr@...627...> Hello everyone.I've just updates gambas from 1.0.12 to 1.0.15 and here is the list of files i have installed: gambas-gb-qt-kde-1.0.15-1.gbv.suse93 gambas-gb-qt-1.0.15-1.gbv.suse93 gambas-gb-eval-1.0.15-1.gbv.suse93 gambas-1.0.15-1.gbv.suse93 gambas-gb-xml-1.0.15-1.gbv.suse93 gambas-gb-net-1.0.15-1.gbv.suse93 gambas-gb-compress-1.0.15-1.gbv.suse93 gambas-gb-vb-1.0.15-1.gbv.suse93 gambas-ide-1.0.15-1.gbv.suse93 gambas-gb-db-1.0.15-1.gbv.suse93 gambas-gb-debug-1.0.10-0.gbv.1 gambas-gb-db-mysql-1.0.12-0.gbv.1 gambas-gb-qt-ext-1.0.15-1.gbv.suse93 gambas-runtime-1.0.15-1.gbv.suse93 gambas-gb-qt-kde-html-1.0.15-1.gbv.suse93 gambas-gb-qt-editor-1.0.15-1.gbv.suse93 Before the update i could make rpm and install them without any problem at all. For after the update i'm getting an error at the last dialog(the one which actually make the rpm).Here's the error: This application has raised an unexpected error and must abort. [-1] error: File /home/thiodor/RPM/SOURCES/cx-&1.&20.0.tar.bz2: No such file or directory . Package.MakePackage.440 Take a look at the bold characters.These are not correspont with the applications version,neither its name. I am using gambas with SUSE 9.3. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gambas at ...1... Fri Apr 21 00:54:22 2006 From: gambas at ...1... (Benoit Minisini) Date: Fri, 21 Apr 2006 00:54:22 +0200 Subject: [Gambas-user] Release of gambas 1.9.29 Message-ID: <200604210054.23265.gambas@...1...> Hi, This release is intended to compile and run on FreeBSD, and other non-Linux systems that do not support ioctl(...,FIONREAD,...) on any file descriptor. It fixes many important bugs too: * SUPER keyword now should work in any case. * Auto-creatable classes now can be enumerated safely. * Subst() was rewritten and fixed, and will be backported to the stable version as soon as possible. * Val("") returns NULL now, and not a null date anymore. * Tooltips work correctly on view controls now. * Blob management was fixed in mysql driver. * Void lines in mails are correctly sent by the SMTP component now. See the ChangeLog for the other changes. I'm waiting information about problems on PowerPC before releasing a 1.0.16 version that will fix the Subst() function. Regards, -- Benoit Minisini From gambas at ...1... Fri Apr 21 00:57:48 2006 From: gambas at ...1... (Benoit Minisini) Date: Fri, 21 Apr 2006 00:57:48 +0200 Subject: [Gambas-user] RE: Database Field Names In-Reply-To: References: Message-ID: <200604210057.48516.gambas@...1...> On Wednesday 19 April 2006 09:55, Timothy Marshal-Nichols wrote: > Thanks. I was a bit annoyed when I sent that email. I have charmed down > now. > > First thoughts. How about: > > 1. Send the field name to the database in the case entered by the user. > 2. Before the field name is sent to the database check the name is unique > in the table with a case insensitive test. Do not allow field names that > fail the case insensitive test. > > Thanks > > 8-{)} Timothy Marshal-Nichols > > Maybe this is the better idea. It seems that there is a syntax to force 'case insensitiveness', but, of course, it is not standard, and I'm not sure all DBMS have it. Regards, -- Benoit Minisini From maillists at ...1367... Fri Apr 21 04:39:21 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Thu, 20 Apr 2006 19:39:21 -0700 Subject: [Gambas-user] Gambas 1.0.15 RPMs. In-Reply-To: <1145545243.20603.1.camel@...1368...> References: <1145545243.20603.1.camel@...1368...> Message-ID: <1145587161.20506.3.camel@...1368...> Jeff On Thu, 2006-04-20 at 08:00 -0700, GuruLounge - MailLists wrote: > Hello, > > Are the 1.0.15 RPMs available yet? > > Thanx, > Jeff > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From sourceforge-raindog2 at ...94... Fri Apr 21 05:23:17 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Thu, 20 Apr 2006 23:23:17 -0400 Subject: [Gambas-user] Gambas 1.0.15 RPMs. In-Reply-To: <1145587161.20506.3.camel@...1368...> References: <1145545243.20603.1.camel@...1368...> <1145587161.20506.3.camel@...1368...> Message-ID: <200604202323.17909.sourceforge-raindog2@...94...> > On Thu, 2006-04-20 at 08:00 -0700, GuruLounge - MailLists >wrote: On Thu April 20 2006 22:39, GuruLounge - MailLists wrote: > > > Are the 1.0.15 RPMs available yet? Well, it's not like you specified a distribution or anything.... if you meant Mandriva 2006, I have built them but didn't upload them because of the bug in Subst. If you meant Mandriva Cooker, you'd have to look there, and no one else announces their RPM releases on the mailing lists. Rob From maillists at ...1367... Fri Apr 21 08:52:03 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Thu, 20 Apr 2006 23:52:03 -0700 Subject: [Gambas-user] Gambas 1.0.15 RPMs. In-Reply-To: <200604202323.17909.sourceforge-raindog2@...94...> References: <1145545243.20603.1.camel@...1368...> <1145587161.20506.3.camel@...1368...> <200604202323.17909.sourceforge-raindog2@...94...> Message-ID: <1145602324.26444.0.camel@...1368...> Many sorries. I use Fedora Core 4. Jeff On Thu, 2006-04-20 at 23:23 -0400, Rob Kudla wrote: > > On Thu, 2006-04-20 at 08:00 -0700, GuruLounge - MailLists > >wrote: > On Thu April 20 2006 22:39, GuruLounge - MailLists wrote: > > > > > Are the 1.0.15 RPMs available yet? > > Well, it's not like you specified a distribution or anything.... > if you meant Mandriva 2006, I have built them but didn't upload > them because of the bug in Subst. If you meant Mandriva Cooker, > you'd have to look there, and no one else announces their RPM > releases on the mailing lists. > > Rob > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- .^. /V\ /( )\ ^^-^^ Linux Advocate From josemar_mariano at ...494... Fri Apr 21 15:04:14 2006 From: josemar_mariano at ...494... (josemar mariano) Date: Fri, 21 Apr 2006 10:04:14 -0300 (ART) Subject: [Gambas-user] how to access mysql 5 In-Reply-To: <20060421031502.A47A389866@...763...> Message-ID: <20060421130414.18853.qmail@...1421...> hello i use slack 10.1, i have problem access mysql 5 with gambas 1.0.15. error: cannot find for driver database Tks sorry my very bad english _______________________________________________________ Abra sua conta no Yahoo! Mail: 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. http://br.info.mail.yahoo.com/ From gandor at ...1422... Fri Apr 21 15:22:19 2006 From: gandor at ...1422... (Shannon Kuchler) Date: Fri, 21 Apr 2006 08:22:19 -0500 Subject: [Gambas-user] Question about DataBrowser In-Reply-To: <20060421130414.18853.qmail@...1421...> References: <20060421130414.18853.qmail@...1421...> Message-ID: <200604210822.19721.gandor@...1422...> How would i go about sorting the field data by clicking on it's header? Ive looked for an event to do this but i cant find one Thanks, Gandor From cjro99 at ...67... Fri Apr 21 15:48:55 2006 From: cjro99 at ...67... (javier romero) Date: Fri, 21 Apr 2006 13:48:55 +0000 Subject: [Gambas-user] Drawing Message-ID: Hi, I'm new in gambas, i need help with this: I have a this proyect: ' Gambas class file PUBLIC p1 AS Drawing PUBLIC pag AS DrawingArea PUBLIC SUB _new() p1 = NEW Drawing draw.Begin(p1) draw.Text("Hello", 0, 0) draw.End END PUBLIC SUB Form_Open() pag = NEW DrawingArea(sv1) pag.Cached = TRUE pag.Clear pag.BackColor = color.White pag.Width = printer.Width pag.Height = printer.Height pag.Border = 1 draw.Begin(pag) draw.Drawing(p1, 0, 0) draw.End ' This works OK pag.Visible = TRUE END PUBLIC SUB Button1_Click() draw.Begin(printer) draw.drawing(p1,0,0, pag.Width, pag.Height) draw.End ' This doesn't works END I need print a text in a DrawingArea an then when push a button this text is printed into the printer. The first part works OK, I print a text in a Drawing object and then put that in a DrawingArea with the Draw method, but when i do the sane with the printer , it does'nt works, only print an empty page, the text is not printed. Please i aprecite someone helps me. Sorry about my English is so bad Thanks Javier Romero _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH From gambas at ...1... Fri Apr 21 21:16:10 2006 From: gambas at ...1... (Benoit Minisini) Date: Fri, 21 Apr 2006 21:16:10 +0200 Subject: [Gambas-user] Stupid bug in 1.9.29 Message-ID: <200604212116.10454.gambas@...1...> Hi, There is a stupid bug in the Val() function in 1.9.29: Val("True") or Val("False") always returns NULL instead of returning their corresponding boolean values. Here is a patch, and sorry for the inconvenience! Regards, -- Benoit Minisini -------------- next part -------------- A non-text attachment was scrubbed... Name: gbx_value.c Type: text/x-csrc Size: 25987 bytes Desc: not available URL: From whoknowz at ...626... Sat Apr 22 01:23:33 2006 From: whoknowz at ...626... (whoknowz) Date: Sat, 22 Apr 2006 04:23:33 +0500 Subject: [Gambas-user] Re: Gambas-user digest, Vol 1 #1801 - 6 msgs In-Reply-To: <20060421191801.33DB312A5F@...773...> References: <20060421191801.33DB312A5F@...773...> Message-ID: <3bab1b020604211623t15135579p991c4def62fc3c25@...627...> Hello Everyone, I am using Gambas Dev. version 1.9.29 and there seems to be a minor problem of displaying the ToolBox. The ToolBox only appears when I maximize the form (which inturns makes the form invisible but the toolbox visible). It would be much convienient if it appears just like the properties window. Any patches available? Regards, Ahmed Nashith -------------- next part -------------- An HTML attachment was scrubbed... URL: From maillists at ...1367... Sat Apr 22 03:49:12 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Fri, 21 Apr 2006 18:49:12 -0700 Subject: [Gambas-user] GBX uses considerable CPU Message-ID: <1145670552.3978.1.camel@...1368...> I've been running a gambas program on one of my computers and noticed that GBX is using 60%-85% of the CPU. The program really isn't doing anything. It's just idle, waiting for user input. Any idea what would be causing this or how I can lower the CPU usage for GBX? FC3 - Gambas 1.0.15 TIA, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From eeller at ...826... Sat Apr 22 06:49:14 2006 From: eeller at ...826... (Eldon Eller) Date: Fri, 21 Apr 2006 21:49:14 -0700 Subject: [Gambas-user] Using gambas to dial phone Message-ID: <4449B5CA.1000503@...826...> I would like to dial a selected phone number from a gambas application. My computer has a 56k winmodem on the mother board, which I expect could be used for this purpose. I also note that a winmodem driver came with my distro (SuSE 10.0). It is called Intel-536ep - Driver for Intel's 536EP v92 modem. I have not yet installed it, but easily could. Does anyone have experience doing this? A code example would be perfect. Thanks in advance, EEE From gambas at ...1... Sat Apr 22 09:10:47 2006 From: gambas at ...1... (Benoit Minisini) Date: Sat, 22 Apr 2006 09:10:47 +0200 Subject: [Gambas-user] Re: Gambas-user digest, Vol 1 #1801 - 6 msgs In-Reply-To: <3bab1b020604211623t15135579p991c4def62fc3c25@...627...> References: <20060421191801.33DB312A5F@...773...> <3bab1b020604211623t15135579p991c4def62fc3c25@...627...> Message-ID: <200604220910.47281.gambas@...1...> On Saturday 22 April 2006 01:23, whoknowz wrote: > Hello Everyone, > > I am using Gambas Dev. version 1.9.29 and there seems to be a minor problem > of displaying the ToolBox. > The ToolBox only appears when I maximize the form (which inturns makes the > form invisible but the toolbox visible). It would be much convienient if it > appears just like the properties window. > > Any patches available? > > Regards, > > Ahmed Nashith No patch yet, but try to delete ~/.config/gambas/gambas2.conf to start again with inital windows positions. Ragards, -- Benoit Minisini From gambas at ...1... Sat Apr 22 09:11:23 2006 From: gambas at ...1... (Benoit Minisini) Date: Sat, 22 Apr 2006 09:11:23 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <1145670552.3978.1.camel@...1368...> References: <1145670552.3978.1.camel@...1368...> Message-ID: <200604220911.23638.gambas@...1...> On Saturday 22 April 2006 03:49, GuruLounge - MailLists wrote: > I've been running a gambas program on one of my computers and noticed > that GBX is using 60%-85% of the CPU. > > The program really isn't doing anything. It's just idle, waiting for > user input. > > Any idea what would be causing this or how I can lower the CPU usage for > GBX? > > FC3 - Gambas 1.0.15 > > TIA, > Jeff How can we tell you without seeing the source code ???? -- Benoit Minisini From maillists at ...1367... Sat Apr 22 10:02:09 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 22 Apr 2006 01:02:09 -0700 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604220911.23638.gambas@...1...> References: <1145670552.3978.1.camel@...1368...> <200604220911.23638.gambas@...1...> Message-ID: <1145692929.11064.3.camel@...1368...> Here it is. Just run the program with the --desktop option at the cmdline and let it sit a while. If it doesn't do anything unusual, try right-clicking the "QuickDesk" icon and open System Information and let that run a while. FC3 (& 4), Gambas 1.0.15 TIA, Jeff On Sat, 2006-04-22 at 09:11 +0200, Benoit Minisini wrote: > On Saturday 22 April 2006 03:49, GuruLounge - MailLists wrote: > > I've been running a gambas program on one of my computers and noticed > > that GBX is using 60%-85% of the CPU. > > > > The program really isn't doing anything. It's just idle, waiting for > > user input. > > > > Any idea what would be causing this or how I can lower the CPU usage for > > GBX? > > > > FC3 - Gambas 1.0.15 > > > > TIA, > > Jeff > > How can we tell you without seeing the source code ???? > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From gambasfr at ...11... Sat Apr 22 11:02:22 2006 From: gambasfr at ...11... (Fabien) Date: Sat, 22 Apr 2006 11:02:22 +0200 (CEST) Subject: [Gambas-user] GBX uses considerable CPU Message-ID: <26100127.1145696542335.JavaMail.www@...1423...> hi, Just add a WAIT keyword in your loop Fabien Bodard > Message du 22/04/06 09:59 > De : "GuruLounge - MailLists" > A : gambas-user at lists.sourceforge.net > Copie ? : > Objet : Re: [Gambas-user] GBX uses considerable CPU > > Here it is. Just run the program with the --desktop option at the > cmdline and let it sit a while. If it doesn't do anything unusual, try > right-clicking the "QuickDesk" icon and open System Information and let > that run a while. > > FC3 (& 4), Gambas 1.0.15 > > TIA, > Jeff > > > On Sat, 2006-04-22 at 09:11 +0200, Benoit Minisini wrote: > > On Saturday 22 April 2006 03:49, GuruLounge - MailLists wrote: > > > I've been running a gambas program on one of my computers and noticed > > > that GBX is using 60%-85% of the CPU. > > > > > > The program really isn't doing anything. It's just idle, waiting for > > > user input. > > > > > > Any idea what would be causing this or how I can lower the CPU usage for > > > GBX? > > > > > > FC3 - Gambas 1.0.15 > > > > > > TIA, > > > Jeff > > > > How can we tell you without seeing the source code ???? > > > -- > > .^. > /V\ > /( )\ > ^^-^^ > Linux Advocate > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > From ronstk at ...239... Sat Apr 22 11:22:55 2006 From: ronstk at ...239... (ron) Date: Sat, 22 Apr 2006 11:22:55 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <1145670552.3978.1.camel@...1368...> References: <1145670552.3978.1.camel@...1368...> Message-ID: <200604221122.55558.ronstk@...239...> On Saturday 22 April 2006 03:49, GuruLounge - MailLists wrote: > I've been running a gambas program on one of my computers and noticed > that GBX is using 60%-85% of the CPU. > > The program really isn't doing anything. It's just idle, waiting for > user input. > > Any idea what would be causing this or how I can lower the CPU usage for > GBX? > > FC3 - Gambas 1.0.15 > > TIA, > Jeff > >BM >How can we tell you without seeing the source code ???? >Jeff >Here it is. ?Just run the program with the --desktop option at the ^^^^^^-- where ??? >cmdline and let it sit a while. ?If it doesn't do anything unusual, try >right-clicking the "QuickDesk" icon and open System Information and let ^^^^^^^^^---------------^^^^^^^^^^^^^--- where?? >that run a while. Are QD and SI in your program os from FC >Fabien Bodard >Just add a WAIT keyword in your loop What does Fabian have to know there is a Loop in it ? Ron From maillists at ...1367... Sat Apr 22 12:26:55 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 22 Apr 2006 03:26:55 -0700 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604221122.55558.ronstk@...239...> References: <1145670552.3978.1.camel@...1368...> <200604221122.55558.ronstk@...239...> Message-ID: <1145701616.14741.5.camel@...1368...> On Sat, 2006-04-22 at 11:22 +0200, ron wrote: > Are QD and SI in your program os from FC > What's "OD" and "SI"? > >Fabien Bodard > >Just add a WAIT keyword in your loop > What loop?? Am I looping? where? SysInfo loops. I thought about that. I thought it might be the constant creation and destruction of progress bars for device usage. But CPU still shows quiet (see below). > What does Fabian have to know there is a Loop in it ? My "Oops" email with attachment -- that DID go thru didn't it?? > Ron FYI: All's quiet on my server. I've QuickDesk running on it with no CPU usage. Don't understand. Could be a false alarm. Thanx anyway, Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From gambas at ...1... Sat Apr 22 12:33:15 2006 From: gambas at ...1... (Benoit Minisini) Date: Sat, 22 Apr 2006 12:33:15 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <1145701616.14741.5.camel@...1368...> References: <1145670552.3978.1.camel@...1368...> <200604221122.55558.ronstk@...239...> <1145701616.14741.5.camel@...1368...> Message-ID: <200604221233.15698.gambas@...1...> On Saturday 22 April 2006 12:26, GuruLounge - MailLists wrote: > On Sat, 2006-04-22 at 11:22 +0200, ron wrote: > > Are QD and SI in your program os from FC > > What's "OD" and "SI"? > > > >Fabien Bodard > > >Just add a WAIT keyword in your loop > > What loop?? Am I looping? where? SysInfo loops. I thought about > that. I thought it might be the constant creation and destruction of > progress bars for device usage. But CPU still shows quiet (see below). > > > What does Fabian have to know there is a Loop in it ? > > My "Oops" email with attachment -- that DID go thru didn't it?? > > > Ron > > FYI: All's quiet on my server. I've QuickDesk running on it with no > CPU usage. Don't understand. Could be a false alarm. > > Thanx anyway, > Jeff Did you send your project somewhere, or I missed something ? -- Benoit Minisini From ronstk at ...239... Sat Apr 22 18:13:15 2006 From: ronstk at ...239... (ron) Date: Sat, 22 Apr 2006 18:13:15 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <1145701616.14741.5.camel@...1368...> References: <1145670552.3978.1.camel@...1368...> <200604221122.55558.ronstk@...239...> <1145701616.14741.5.camel@...1368...> Message-ID: <200604221813.15757.ronstk@...239...> On Saturday 22 April 2006 12:26, GuruLounge - MailLists wrote: > On Sat, 2006-04-22 at 11:22 +0200, ron wrote: > > > Are QD and SI in your program os from FC > > > What's "OD" and "SI"? typo for OD must me QD QD for Quickdesk and SI for SystemInfo :) > > > >Fabien Bodard > > >Just add a WAIT keyword in your loop > > > What loop?? Am I looping? where? SysInfo loops. I thought about > that. I thought it might be the constant creation and destruction of > progress bars for device usage. But CPU still shows quiet (see below). > > > What does Fabian have to know there is a Loop in it ? > > My "Oops" email with attachment -- that DID go thru didn't it?? > I did not got a attachment here from sourceforge > > Ron > > FYI: All's quiet on my server. I've QuickDesk running on it with no > CPU usage. Don't understand. Could be a false alarm. > > Thanx anyway, > Jeff Your welcome, Ron From sourceforge-raindog2 at ...94... Sat Apr 22 19:54:44 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Sat, 22 Apr 2006 13:54:44 -0400 Subject: [Gambas-user] Using gambas to dial phone In-Reply-To: <4449B5CA.1000503@...826...> References: <4449B5CA.1000503@...826...> Message-ID: <200604221354.44410.sourceforge-raindog2@...94...> On Sat April 22 2006 00:49, Eldon Eller wrote: > I would like to dial a selected phone number from a gambas > application. My computer has a 56k winmodem on the mother > board, which I expect could be used for this purpose. I also > note that a winmodem driver came with my distro (SuSE 10.0). > It is called Intel-536ep - Driver for Intel's 536EP v92 modem. > I have not yet installed it, but easily could. Does anyone > have experience doing this? A code example would be perfect. Getting the modem working is up to you, but after that it should just be a matter of opening the serial port created by its driver and sending "ATDT12345551212" or whatever the number is. There is a serial port example that comes with Gambas if you need help with the actual opening of the serial port, and google for "AT commands" if you need help with the standard set of commands that modems accept, letting you control the speaker, the wait time before hanging up, the response codes, etc. Rob From sourceforge-raindog2 at ...94... Sat Apr 22 20:01:53 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Sat, 22 Apr 2006 14:01:53 -0400 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <1145701616.14741.5.camel@...1368...> References: <1145670552.3978.1.camel@...1368...> <200604221122.55558.ronstk@...239...> <1145701616.14741.5.camel@...1368...> Message-ID: <200604221401.54191.sourceforge-raindog2@...94...> On Sat April 22 2006 06:26, GuruLounge - MailLists wrote: > My "Oops" email with attachment -- that DID go thru didn't > it?? Nope.... maybe sourceforge.net is having trouble with attachments on the mailing lists again. Rob From christian.faurebouvard at ...357... Sat Apr 22 23:50:15 2006 From: christian.faurebouvard at ...357... (Christian Faure) Date: Sat, 22 Apr 2006 17:50:15 -0400 Subject: [Gambas-user] Drawing In-Reply-To: References: Message-ID: <200604221750.16478.christian.faurebouvard@...357...> El Viernes 21 Abril 2006 09:48, javier romero escribi?: > PUBLIC p1 AS Drawing > PUBLIC pag AS DrawingArea > > PUBLIC SUB _new() > ? ? p1 = NEW Drawing > ? ? draw.Begin(p1) > ? ? ? draw.Text("Hello", 0, 0) > ? ? draw.End > > END > > PUBLIC SUB Form_Open() > > pag = NEW DrawingArea(sv1) > ? ? > ? pag.Cached = TRUE > ? pag.Clear > ? pag.BackColor = color.White > ? pag.Width = printer.Width > ? pag.Height = printer.Height > ? pag.Border = 1 > ? draw.Begin(pag) > ? ? draw.Drawing(p1, 0, 0) > ? draw.End > ' This works OK > ? pag.Visible = TRUE > ? > END > > PUBLIC SUB Button1_Click() > ? ? > ? draw.Begin(printer) > ? ? draw.drawing(p1,0,0, pag.Width, pag.Height) > ? draw.End > ' This doesn't works > END Hi Javier, Some printers can't print in (0,0) Try draw.drawing(p1, 350, 350) it work, but very small, need to be scaled. Regards, Christian From arcalis.prod at ...11... Sun Apr 23 00:07:43 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sun, 23 Apr 2006 00:07:43 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604221233.15698.gambas@...1...> References: <1145670552.3978.1.camel@...1368...> <1145701616.14741.5.camel@...1368...> <200604221233.15698.gambas@...1...> Message-ID: <200604230007.44113.arcalis.prod@...11...> Le Samedi 22 Avril 2006 12:33, Benoit Minisini a ?crit?: > On Saturday 22 April 2006 12:26, GuruLounge - MailLists wrote: > > On Sat, 2006-04-22 at 11:22 +0200, ron wrote: > > > Are QD and SI in your program os from FC > > > > What's "OD" and "SI"? > > > > > >Fabien Bodard > > > >Just add a WAIT keyword in your loop > > > > What loop?? Am I looping? where? SysInfo loops. I thought about > > that. I thought it might be the constant creation and destruction of > > progress bars for device usage. But CPU still shows quiet (see below). > > > > > What does Fabian have to know there is a Loop in it ? > > > > My "Oops" email with attachment -- that DID go thru didn't it?? > > > > > Ron > > > > FYI: All's quiet on my server. I've QuickDesk running on it with no > > CPU usage. Don't understand. Could be a false alarm. > > > > Thanx anyway, > > Jeff > > Did you send your project somewhere, or I missed something ? hem... :-/, what i was said was based only on an assumption regards, fabien From ronstk at ...239... Sun Apr 23 00:32:52 2006 From: ronstk at ...239... (ron) Date: Sun, 23 Apr 2006 00:32:52 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604230007.44113.arcalis.prod@...11...> References: <1145670552.3978.1.camel@...1368...> <200604221233.15698.gambas@...1...> <200604230007.44113.arcalis.prod@...11...> Message-ID: <200604230032.52440.ronstk@...239...> > > Did you send your project somewhere, or I missed something ? > > hem... :-/, > > what i was said was based only on an assumption > > regards, > fabien > LOL Does attachments not pass from *GuruLounge - MailLists* to *sourceforge* ? Ron From maillists at ...1367... Sun Apr 23 02:17:52 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 22 Apr 2006 17:17:52 -0700 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604230032.52440.ronstk@...239...> References: <1145670552.3978.1.camel@...1368...> <200604221233.15698.gambas@...1...> <200604230007.44113.arcalis.prod@...11...> <200604230032.52440.ronstk@...239...> Message-ID: <1145751473.3322.2.camel@...1368...> Hmmm. I'm sending this without attachment just to see if gurulounge is getting thru to sourceforge. Jeff On Sun, 2006-04-23 at 00:32 +0200, ron wrote: > > > > Did you send your project somewhere, or I missed something ? > > > > hem... :-/, > > > > what i was said was based only on an assumption > > > > regards, > > fabien > > > > LOL > > Does attachments not pass from *GuruLounge - MailLists* to *sourceforge* ? > > Ron > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From maillists at ...1367... Sun Apr 23 02:36:02 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 22 Apr 2006 17:36:02 -0700 Subject: [Gambas-user] Attachments not arriving. Message-ID: <1145752562.3756.5.camel@...1368...> Okay. So my email without attachment works fine... the attachment emails won't arrive though. I guess something is wrong on the sourceforge end. Jeff -- .^. /V\ /( )\ ^^-^^ Linux Advocate From gbv at ...1076... Sun Apr 23 10:59:23 2006 From: gbv at ...1076... (Guillermo Ballester Valor) Date: Sun, 23 Apr 2006 10:59:23 +0200 Subject: [Gambas-user] Stupid bug in 1.9.29 In-Reply-To: <200604212116.10454.gambas@...1...> References: <200604212116.10454.gambas@...1...> Message-ID: <200604231059.23946.gbv@...1076...> Hello, This is actually a file to replace in directory 'main/gbx' . Attached is the equivalent patch ;) Best regards Guillermo El Viernes, 21 de Abril de 2006 21:16, Benoit Minisini escribi?: > Hi, > > There is a stupid bug in the Val() function in 1.9.29: Val("True") or > Val("False") always returns NULL instead of returning their corresponding > boolean values. > > Here is a patch, and sorry for the inconvenience! > > Regards, -- Guillermo Ballester Valor gbv at ...1076... Ogijares, Granada SPAIN Public GPG KEY http://www.oxixares.com/~gbv/pubgpg.html #################################################### See World Weather Navigator at http://www.ogimet.com #################################################### -------------- next part -------------- A non-text attachment was scrubbed... Name: gbx_value.patch Type: text/x-diff Size: 474 bytes Desc: not available URL: From gambas at ...1... Sun Apr 23 18:08:28 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 23 Apr 2006 18:08:28 +0200 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604221401.54191.sourceforge-raindog2@...94...> References: <1145670552.3978.1.camel@...1368...> <1145701616.14741.5.camel@...1368...> <200604221401.54191.sourceforge-raindog2@...94...> Message-ID: <200604231808.28981.gambas@...1...> On Saturday 22 April 2006 20:01, Rob Kudla wrote: > On Sat April 22 2006 06:26, GuruLounge - MailLists wrote: > > My "Oops" email with attachment -- that DID go thru didn't > > it?? > > Nope.... maybe sourceforge.net is having trouble with attachments > on the mailing lists again. > > Rob > Attachments are limited to 256 Kb! -- Benoit Minisini From maillists at ...1367... Sun Apr 23 20:01:25 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sun, 23 Apr 2006 11:01:25 -0700 Subject: [Gambas-user] GBX uses considerable CPU In-Reply-To: <200604231808.28981.gambas@...1...> References: <1145670552.3978.1.camel@...1368...> <1145701616.14741.5.camel@...1368...> <200604221401.54191.sourceforge-raindog2@...94...> <200604231808.28981.gambas@...1...> Message-ID: <1145815285.7866.1.camel@...1368...> Ah. That explains it. Well, no matter. the problem seems to have gone away. I don't think it was necessarily GBX related, it just seemed such because GBX was using the most CPU at the tme. Jeff On Sun, 2006-04-23 at 18:08 +0200, Benoit Minisini wrote: > On Saturday 22 April 2006 20:01, Rob Kudla wrote: > > On Sat April 22 2006 06:26, GuruLounge - MailLists wrote: > > > My "Oops" email with attachment -- that DID go thru didn't > > > it?? > > > > Nope.... maybe sourceforge.net is having trouble with attachments > > on the mailing lists again. > > > > Rob > > > > Attachments are limited to 256 Kb! > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From ronstk at ...239... Sun Apr 23 23:29:16 2006 From: ronstk at ...239... (ron) Date: Sun, 23 Apr 2006 23:29:16 +0200 Subject: [Gambas-user] prb:Left() does not work correct. Message-ID: <200604232329.16829.ronstk@...239...> gb2-1.9.28 In the tag of some controls on my form is a string as "bind:fld=mykey" PUBLIC FUNCTION Init(parent AS Form) AS Boolean DIM idx AS Integer DIM frm AS Form DIM ctrl AS Control frm = parent FOR EACH ctrl IN frm.Children PRINT ctrl.Tag 'shows correct tag message PRINT Left(ctrl.tag, 4) 'gets the required text IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips checktag(ctrl) ' <---never called END IF NEXT END PUBLIC FUNCTION Init(parent AS Form) AS Boolean DIM idx AS Integer DIM frm AS Form DIM ctrl AS Control DIM t AS String frm = parent FOR EACH ctrl IN frm.Children PRINT ctrl.Tag t = Left(ctrl.tag, 4) PRINT t IF t = "bind" THEN ' works checktag(ctrl) ' <-- is now done END IF NEXT END As far I know should Left(ctrl.tag, 4) return a string type. Change to Left$(ctrl.tag, 4) also did not work After a try with second code block that did work I try with Cstr(Left$(ctrl.tag, 4)) and it works. I asume mid() left() and right() shouls give me a string? Using the left$() even did not. Something wrong here? From brian at ...1334... Mon Apr 24 00:05:26 2006 From: brian at ...1334... (Christopher Brian Jack) Date: Sun, 23 Apr 2006 15:05:26 -0700 (PDT) Subject: [Gambas-user] prb:Left() does not work correct. In-Reply-To: <200604232329.16829.ronstk@...239...> References: <200604232329.16829.ronstk@...239...> Message-ID: <20060423145050.K46436@...1337...> On Sun, 23 Apr 2006, ron wrote: > gb2-1.9.28 > > In the tag of some controls on my form is a string as > "bind:fld=mykey" > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > DIM idx AS Integer > DIM frm AS Form > DIM ctrl AS Control > > frm = parent > FOR EACH ctrl IN frm.Children > PRINT ctrl.Tag 'shows correct tag message > PRINT Left(ctrl.tag, 4) 'gets the required text > IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips > checktag(ctrl) ' <---never called > END IF > NEXT > END > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > DIM idx AS Integer > DIM frm AS Form > DIM ctrl AS Control > DIM t AS String > > frm = parent > FOR EACH ctrl IN frm.Children > PRINT ctrl.Tag > t = Left(ctrl.tag, 4) > PRINT t > IF t = "bind" THEN ' works > checktag(ctrl) ' <-- is now done > END IF > NEXT > END > As far I know should Left(ctrl.tag, 4) return a string type. > Change to Left$(ctrl.tag, 4) also did not work > After a try with second code block that did work I try > with Cstr(Left$(ctrl.tag, 4)) and it works. I recall something in the documentation about the need to use CStr when pulling text content off forms controls because they are stored using UTF-8 and the type acts every other way like a string but doesn't work correctly with functions like Mid Left or Right when used directly from the control (eg: If someControl.text = "foo" Then ...does not hit...) then If allows for Variant types and doesn't automatically convert as you were hoping (it is a similar problem to the gotcha with division and having to use CFloat in integer divisors if you want a Float result). Using CStr forms regular strings from UTF-8 encodings found on form control text properties (including tags). In the latter case you declare t as a regular String type and in the line [t=someControl.tag] you implicitly force a CStr conversion because the String class type of the form's tag property is being forced into something that can only take the basic String type and not UTF-8 String classes. The basic String type doesn't like UTF-8 string types and trying to mix the two, as you've noticed, can cause problems. .=================================================. | Christopher BRIAN Jack aka "Gau of the Veldt" | +=================================================' | brian _AT_ brians-anime _DOT_ com `=================================================- Hi Spambots, my email address is sputnik at ...1334... From gambas at ...1... Mon Apr 24 00:14:11 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 24 Apr 2006 00:14:11 +0200 Subject: [Gambas-user] prb:Left() does not work correct. In-Reply-To: <20060423145050.K46436@...1337...> References: <200604232329.16829.ronstk@...239...> <20060423145050.K46436@...1337...> Message-ID: <200604240014.11662.gambas@...1...> On Monday 24 April 2006 00:05, Christopher Brian Jack wrote: > On Sun, 23 Apr 2006, ron wrote: > > gb2-1.9.28 > > > > In the tag of some controls on my form is a string as > > "bind:fld=mykey" > > > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > > DIM idx AS Integer > > DIM frm AS Form > > DIM ctrl AS Control > > > > frm = parent > > FOR EACH ctrl IN frm.Children > > PRINT ctrl.Tag 'shows correct tag message > > PRINT Left(ctrl.tag, 4) 'gets the required text > > IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips > > checktag(ctrl) ' <---never called > > END IF > > NEXT > > END > > > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > > DIM idx AS Integer > > DIM frm AS Form > > DIM ctrl AS Control > > DIM t AS String > > > > frm = parent > > FOR EACH ctrl IN frm.Children > > PRINT ctrl.Tag > > t = Left(ctrl.tag, 4) > > PRINT t > > IF t = "bind" THEN ' works > > checktag(ctrl) ' <-- is now done > > END IF > > NEXT > > END > > > > As far I know should Left(ctrl.tag, 4) return a string type. > > Change to Left$(ctrl.tag, 4) also did not work > > After a try with second code block that did work I try > > with Cstr(Left$(ctrl.tag, 4)) and it works. > > I recall something in the documentation about the need to use CStr when > pulling text content off forms controls because they are stored using > UTF-8 and the type acts every other way like a string but doesn't work > correctly with functions like Mid Left or Right when used directly from > the control (eg: If someControl.text = "foo" Then ...does not hit...) then > If allows for Variant types and doesn't automatically convert as you were > hoping (it is a similar problem to the gotcha with division and having to > use CFloat in integer divisors if you want a Float result). Using CStr > forms regular strings from UTF-8 encodings found on form control text > properties (including tags). > > In the latter case you declare t as a regular String type and in the line > [t=someControl.tag] you implicitly force a CStr conversion because the > String class type of the form's tag property is being forced into > something that can only take the basic String type and not UTF-8 String > classes. > > The basic String type doesn't like UTF-8 string types and trying to mix > the two, as you've noticed, can cause problems. > > .=================================================. > > | Christopher BRIAN Jack aka "Gau of the Veldt" | > > +=================================================' > > | brian _AT_ brians-anime _DOT_ com > > `=================================================- > Hi Spambots, my email address is sputnik at ...1334... > No, Ron's code should work in both cases. There is nothing related to UTF-8 in this problem. UTF-8 is an encoding method, it is not a datatype! The interpreter does not care what encoding is used inside a string. It is just a string for it. Maybe there is a bug in variant/string conversion. I made some tests there, and everything worked correctly. I will try a test more similar to your code then... Regards, -- Benoit Minisini From gambas at ...1... Mon Apr 24 00:39:15 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 24 Apr 2006 00:39:15 +0200 Subject: [Gambas-user] prb:Left() does not work correct. In-Reply-To: <200604232329.16829.ronstk@...239...> References: <200604232329.16829.ronstk@...239...> Message-ID: <200604240039.15936.gambas@...1...> On Sunday 23 April 2006 23:29, ron wrote: > gb2-1.9.28 > > In the tag of some controls on my form is a string as > "bind:fld=mykey" > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > DIM idx AS Integer > DIM frm AS Form > DIM ctrl AS Control > > frm = parent > FOR EACH ctrl IN frm.Children > PRINT ctrl.Tag 'shows correct tag message > PRINT Left(ctrl.tag, 4) 'gets the required text > IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips > checktag(ctrl) ' <---never called > END IF > NEXT > END > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > DIM idx AS Integer > DIM frm AS Form > DIM ctrl AS Control > DIM t AS String > > frm = parent > FOR EACH ctrl IN frm.Children > PRINT ctrl.Tag > t = Left(ctrl.tag, 4) > PRINT t > IF t = "bind" THEN ' works > checktag(ctrl) ' <-- is now done > END IF > NEXT > END > > As far I know should Left(ctrl.tag, 4) return a string type. > Change to Left$(ctrl.tag, 4) also did not work > After a try with second code block that did work I try > with Cstr(Left$(ctrl.tag, 4)) and it works. > > I asume mid() left() and right() shouls give me a string? > Using the left$() even did not. Something wrong here? > > I cannot reproduce your bug. Can you try with 1.9.29 ? Regards, -- Benoit Minisini From ronstk at ...239... Mon Apr 24 06:04:33 2006 From: ronstk at ...239... (ron) Date: Mon, 24 Apr 2006 06:04:33 +0200 Subject: [Gambas-user] prb:Left() does not work correct. In-Reply-To: <200604240039.15936.gambas@...1...> References: <200604232329.16829.ronstk@...239...> <200604240039.15936.gambas@...1...> Message-ID: <200604240604.34625.ronstk@...239...> On Monday 24 April 2006 00:39, Benoit Minisini wrote: > On Sunday 23 April 2006 23:29, ron wrote: > > gb2-1.9.28 > > > > In the tag of some controls on my form is a string as > > "bind:fld=mykey" > > > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > > DIM idx AS Integer > > DIM frm AS Form > > DIM ctrl AS Control > > > > frm = parent > > FOR EACH ctrl IN frm.Children > > PRINT ctrl.Tag 'shows correct tag message > > PRINT Left(ctrl.tag, 4) 'gets the required text > > IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips > > checktag(ctrl) ' <---never called > > END IF > > NEXT > > END > > > > PUBLIC FUNCTION Init(parent AS Form) AS Boolean > > DIM idx AS Integer > > DIM frm AS Form > > DIM ctrl AS Control > > DIM t AS String > > > > frm = parent > > FOR EACH ctrl IN frm.Children > > PRINT ctrl.Tag > > t = Left(ctrl.tag, 4) > > PRINT t > > IF t = "bind" THEN ' works > > checktag(ctrl) ' <-- is now done > > END IF > > NEXT > > END > > > > As far I know should Left(ctrl.tag, 4) return a string type. > > Change to Left$(ctrl.tag, 4) also did not work > > After a try with second code block that did work I try > > with Cstr(Left$(ctrl.tag, 4)) and it works. > > > > I asume mid() left() and right() shouls give me a string? > > Using the left$() even did not. Something wrong here? > > > > > > I cannot reproduce your bug. Can you try with 1.9.29 ? > > Regards, > Just the same problem ATM. The function Init is in a class file and called from the main form sub _new() Found something. when I place only 3 textbox controls on the form it works adding some other as button, labels and listbox, is still works selecting the 3 working textbox, do cut and past so they are not the *first* controls checked for tag it does not work any more select all other, do cut and past and it works again. Look to me as the first tag is null/empty or not used it does not work. Test done by remove the first tag, not working, add the tag and it works. This must be a bug somewhere, I do not see the logic of it. Ron From ronstk at ...239... Mon Apr 24 08:27:06 2006 From: ronstk at ...239... (ron) Date: Mon, 24 Apr 2006 08:27:06 +0200 Subject: [Gambas-user] No text visible in textbox In-Reply-To: <200604190708.08186.ronstk@...239...> References: <200604190708.08186.ronstk@...239...> Message-ID: <200604240827.06250.ronstk@...239...> On Wednesday 19 April 2006 07:08, ron wrote: > > db records > 1 "medium text" > 2 "very long text to show nothing when short follows" > 3 "short" > 4 "medium text again" > > The 4 buttons 'first' 'prev' 'next' and 'last' > Textbox1 with size of record 4 characters > txtPosit with the hResult.Index as position indicator > > When 'first' followed by a serie of 'next' then if > the record 3 should be shown the textbox1 looks empty. > > After click in textbox1 when it looks empty the text occurs. > If the focus (blinking cursor) stays in textbox1 and I click > on the navigation buttons the text stays visible in that box. > I verify with second Textbox2 and the same content as textbox1 > > IF hRecordData.Available THEN > sKey = sFLDinProc > textbox1.Text = hRecordData[sKey] > textbox1.SetFocus > textbox2.Text = hRecordData[sKey] > textbox2.SetFocus > txtPosit.Text = hRecordData.Index + 1 > ENDIF > > Blinking cursor is during navigation in textbox2 and textbox1 > look still blank so .SetFocus did not help. > > It occurs if a (very) long text is replaced by a short text by code. > What is wrong? > > Ron > Kick :) textbox1.Text = CStr(hRecordData[sFLDinProc1]) textbox1.Refresh 'solves problem short text after long text is hidden textbox2.Text = CStr(hRecordData[sFLDinProc2]) textbox2.Refresh 'solves problem short text after long text is hidden Bit stupid to use .Refresh on every control written to, to get correct view if there is no focus on it. From cjro99 at ...67... Mon Apr 24 15:36:41 2006 From: cjro99 at ...67... (javier romero) Date: Mon, 24 Apr 2006 13:36:41 +0000 Subject: [Gambas-user] Drawing Message-ID: Ok, thanks, its works but the print is very small, i try scaling with this: draw.Begin(printer) draw.drawing(p1,350,350, Printer.Width, Printer.Height) draw.End but dosent works the print is the same, little, i try then with draw.Begin(printer) draw.drawing(p1,350,350, p1.Width, p1.Height) draw.End and the same, very little, in both dont change How i scale? sorry about my very bad english Regards Javier ---------------------------------------- > From: christian.faurebouvard at ...357... > To: gambas-user at lists.sourceforge.net > Subject: Re: [Gambas-user] Drawing > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > PUBLIC p1 AS Drawing > > PUBLIC pag AS DrawingArea > > > > PUBLIC SUB _new() > > p1 = NEW Drawing > > draw.Begin(p1) > > draw.Text("Hello", 0, 0) > > draw.End > > > > END > > > > PUBLIC SUB Form_Open() > > > > pag = NEW DrawingArea(sv1) > > > > pag.Cached = TRUE > > pag.Clear > > pag.BackColor = color.White > > pag.Width = printer.Width > > pag.Height = printer.Height > > pag.Border = 1 > > draw.Begin(pag) > > draw.Drawing(p1, 0, 0) > > draw.End > > ' This works OK > > pag.Visible = TRUE > > > > END > > > > PUBLIC SUB Button1_Click() > > > > draw.Begin(printer) > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > draw.End > > ' This doesn't works > > END > > Hi Javier, > > Some printers can't print in (0,0) > Try > draw.drawing(p1, 350, 350) > > it work, but very small, need to be scaled. > > Regards, > Christian > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH From ronstk at ...239... Mon Apr 24 17:19:17 2006 From: ronstk at ...239... (ron) Date: Mon, 24 Apr 2006 17:19:17 +0200 Subject: [Gambas-user] Drawing In-Reply-To: References: Message-ID: <200604241719.17634.ronstk@...239...> On Monday 24 April 2006 15:36, javier romero wrote: > Ok, thanks, its works but the print is very small, i try scaling with this: > > draw.Begin(printer) > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > draw.End > but dosent works the print is the same, little, i try then with > > draw.Begin(printer) > draw.drawing(p1,350,350, p1.Width, p1.Height) read below > draw.End > and the same, very little, in both dont change > > How i scale? > > sorry about my very bad english > > Regards > Javier > ---------------------------------------- > > From: christian.faurebouvard at ...357... > > To: gambas-user at lists.sourceforge.net > > Subject: Re: [Gambas-user] Drawing > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > PUBLIC p1 AS Drawing > > > PUBLIC pag AS DrawingArea > > > > > > PUBLIC SUB _new() > > > p1 = NEW Drawing > > > draw.Begin(p1) > > > draw.Text("Hello", 0, 0) > > > draw.End > > > > > > END > > > Remeber here the fontsize for the text. It can be little. 8x14 *pixels* Try to use draw.TextHeight and .TextWidth here to scale it up draw.Text("Hello", 0, 0,430,720) can may be also used. > > > PUBLIC SUB Form_Open() > > > > > > pag = NEW DrawingArea(sv1) > > > > > > pag.Cached = TRUE > > > pag.Clear > > > pag.BackColor = color.White > > > pag.Width = printer.Width > > > pag.Height = printer.Height printer.Width and printer.Height print and check those values. Unknown if it is *inches*, *dots* or *pixels* Normal paper sizes are given in inch or centimeter. For the print head on old printers there are 72 dots/inch 8" paper has then 576 dots as width Be carefull DPI is NOT pixels. My screen is 1280 pixels in cm it is 36 cm or 14 inch = 91pixels/inch The given width here can be outside width or printable width The left & right margin is unprintable and mostly given in cm or inchr or in KDE as pixels where pixel is 1/72 inch Printer.Size gives the papar size as code 'Letter' or 'A4' Printer.Resolution the DPI the printer is currently set Printer.Width and .Height together with real size from .Size will help yuo > > > pag.Border = 1 > > > draw.Begin(pag) > > > draw.Drawing(p1, 0, 0) > > > draw.End > > > ' This works OK > > > pag.Visible = TRUE > > > > > > END > > > > > > PUBLIC SUB Button1_Click() > > > > > > draw.Begin(printer) > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > draw.End > > > ' This doesn't works > > > END using the "draw.drawing(p1,0,0, pag.Width, pag.Height)" the value of 350 is around 4 inch (72 DPI/in) Better use 24 or 35 as value (1/2 inch) If the pag.width is the big number as i.e. 576 then substract 2x24 or 2x35 from it. See your printer documentation for the DPI value to verify. Using KDE the KDEPrintmanager can help. > > > > Hi Javier, > > > > Some printers can't print in (0,0) > > Try > > draw.drawing(p1, 350, 350) > > > > it work, but very small, need to be scaled. > > > > Regards, > > Christian > > Success Ron From brian at ...1334... Mon Apr 24 18:20:30 2006 From: brian at ...1334... (Christopher Brian Jack) Date: Mon, 24 Apr 2006 09:20:30 -0700 (PDT) Subject: [Gambas-user] Drawing In-Reply-To: <200604241719.17634.ronstk@...239...> References: <200604241719.17634.ronstk@...239...> Message-ID: <20060424091555.R51078@...1337...> On Mon, 24 Apr 2006, ron wrote: > Unknown if it is *inches*, *dots* or *pixels* > Normal paper sizes are given in inch or centimeter. > For the print head on old printers there are 72 dots/inch > 8" paper has then 576 dots as width > Be carefull DPI is NOT pixels. > My screen is 1280 pixels Many graphics programs allow calibration of the screen-to-printer DPI settings so that 100 pixels on screen shows in the image shows as the same dimensional (" or cm) size on the screen that it would be on the paper. This functionality is then accessed by a enabling a "[x] Show Print Size" menu option usually found in the graphics software's View menu. .=================================================. | Christopher BRIAN Jack aka "Gau of the Veldt" | +=================================================' | brian _AT_ brians-anime _DOT_ com `=================================================- Hi Spambots, my email address is sputnik at ...1334... From brian at ...1334... Mon Apr 24 18:45:22 2006 From: brian at ...1334... (Christopher Brian Jack) Date: Mon, 24 Apr 2006 09:45:22 -0700 (PDT) Subject: [Gambas-user] Drawing In-Reply-To: <20060424091555.R51078@...1337...> References: <200604241719.17634.ronstk@...239...> <20060424091555.R51078@...1337...> Message-ID: <20060424092253.D51078@...1337...> On Mon, 24 Apr 2006, Christopher Brian Jack wrote: > > Unknown if it is *inches*, *dots* or *pixels* > > Normal paper sizes are given in inch or centimeter. > > For the print head on old printers there are 72 dots/inch > > 8" paper has then 576 dots as width > > Be carefull DPI is NOT pixels. > > My screen is 1280 pixels > > Many graphics programs allow calibration of the screen-to-printer DPI > settings so that 100 pixels on screen shows in the image shows as the same > dimensional (" or cm) size on the screen that it would be on the paper. > This functionality is then accessed by a enabling a "[x] Show Print Size" > menu option usually found in the graphics software's View menu. You could also define things relatively (ie: as percents or some reasonably larger fraction perhaps n/1000). In this case something size 50%x50% would take half the screen and half the printed page. Be sure to account for aspect ratios of the screen and printed page however: printer x=rel-x * Printer.width / rel-base printer y=rel-y * Printer.height / rel-base screen y=rel-x * Screen.width / rel-base screen x=rel-x * Screen.height / rel-base rel-base is the virtual dot size you wish to use in your rendering. As percentages base is 100 but you could choose a larger base (like 1000ths) since 1/100 is pretty low resolution Adjustment for aspect must added is a square in relative units is square on the screen or printer. The above calculations need to modified if a square on the screen in rels is also a square on the printer. The aspect of the printer page and that of the screen need to BOTH be taken into account. The above calculations don't do that. .=================================================. | Christopher BRIAN Jack aka "Gau of the Veldt" | +=================================================' | brian _AT_ brians-anime _DOT_ com `=================================================- Hi Spambots, my email address is sputnik at ...1334... From timothy.marshal-nichols at ...247... Mon Apr 24 18:57:08 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Mon, 24 Apr 2006 17:57:08 +0100 Subject: [Gambas-user] Drawing In-Reply-To: Message-ID: This example shows how to print an image centred on the page. In includes code to scale an image for the printer resolution. If the image is the to large for the printer height or width resizes it to fit on the page - keeping the aspect ratio. You will need something like this only with a drawing. PRIVATE SUB PrintImage(img AS Image) DIM imageToPrint AS Image DIM imageWidth AS Integer DIM imageHeight AS Integer DIM scaleIsotropic AS Float ' Dispaly printer dialog IF Printer.Setup() THEN RETURN INC Application.Busy ' Get image size for the printer resolution imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution ' Adjust image size if it does not fit on the printer page IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN ' Scale Isotropic, keep aspect ratio of the image scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / imageHeight) imageWidth *= scaleIsotropic imageHeight *= scaleIsotropic END IF 'PRINT "Width: " & imageToPrint, Printer.Width 'PRINT "Height: " & imageToPrint, Printer.Height ' Scale image imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) ' Draw image centered on printer page Draw.Begin(Printer) Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, (Printer.Height - imageHeight) / 2) Draw.End DEC Application.Busy END Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier romero Sent: Monday, 24 April 2006 14:37 To: gambas-user at lists.sourceforge.net Subject: RE: Re: [Gambas-user] Drawing Ok, thanks, its works but the print is very small, i try scaling with this: draw.Begin(printer) draw.drawing(p1,350,350, Printer.Width, Printer.Height) draw.End but dosent works the print is the same, little, i try then with draw.Begin(printer) draw.drawing(p1,350,350, p1.Width, p1.Height) draw.End and the same, very little, in both dont change How i scale? sorry about my very bad english Regards Javier ---------------------------------------- > From: christian.faurebouvard at ...357... > To: gambas-user at lists.sourceforge.net > Subject: Re: [Gambas-user] Drawing > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > PUBLIC p1 AS Drawing > > PUBLIC pag AS DrawingArea > > > > PUBLIC SUB _new() > > p1 = NEW Drawing > > draw.Begin(p1) > > draw.Text("Hello", 0, 0) > > draw.End > > > > END > > > > PUBLIC SUB Form_Open() > > > > pag = NEW DrawingArea(sv1) > > > > pag.Cached = TRUE > > pag.Clear > > pag.BackColor = color.White > > pag.Width = printer.Width > > pag.Height = printer.Height > > pag.Border = 1 > > draw.Begin(pag) > > draw.Drawing(p1, 0, 0) > > draw.End > > ' This works OK > > pag.Visible = TRUE > > > > END > > > > PUBLIC SUB Button1_Click() > > > > draw.Begin(printer) > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > draw.End > > ' This doesn't works > > END > > Hi Javier, > > Some printers can't print in (0,0) > Try > draw.drawing(p1, 350, 350) > > it work, but very small, need to be scaled. > > Regards, > Christian > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From Vince.Scott at ...1171... Mon Apr 24 22:11:07 2006 From: Vince.Scott at ...1171... (Scott, Vince) Date: Mon, 24 Apr 2006 15:11:07 -0500 Subject: [Gambas-user] Development Version Message-ID: I am using the Extern ability of the development version to access C libraries. I am having an issue figuring out how to pass a char* or to get a string from a C function. Has anyone used this feature and do you know the syntax to make it work? // C Side of things int foo(char* p_str) { sprintf(p_str, "%s\n", "test"); return sizeof(p_str); } char* foo2() { char str[6]; sprintf(p_str, "%s\n", "test"); return p_str; } How do I call these from Gambas to get the string returned? Everything I have tried crash the app. Thanks, Vince This communication is confidential and may be legally privileged. If you are not the intended recipient, (i) please do not read or disclose to others, (ii) please notify the sender by reply mail, and (iii) please delete this communication from your system. Failure to follow this process may be unlawful. Thank you for your cooperation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gambas at ...1... Mon Apr 24 22:16:51 2006 From: gambas at ...1... (Benoit Minisini) Date: Mon, 24 Apr 2006 22:16:51 +0200 Subject: [Gambas-user] Development Version In-Reply-To: References: Message-ID: <200604242216.51333.gambas@...1...> On Monday 24 April 2006 22:11, Scott, Vince wrote: > I am using the Extern ability of the development version to access C > libraries. I am having an issue figuring out how to pass a char* or to > get a string from a C function. Has anyone used this feature and do you > know the syntax to make it work? > > // C Side of things > > > int foo(char* p_str) > { > sprintf(p_str, "%s\n", "test"); > > return sizeof(p_str); > } > > char* foo2() > { > char str[6]; > > sprintf(p_str, "%s\n", "test"); > > return p_str; > } > > > How do I call these from Gambas to get the string returned? Everything I > have tried crash the app. > > > Thanks, > Vince > Didn't you see what I answered you about sending strings to C functions on the development mailing-list ? Maybe it wasn't clear ? -- Benoit Minisini From emil97 at ...1424... Tue Apr 25 03:32:38 2006 From: emil97 at ...1424... (emil97 at ...1424...) Date: Tue, 25 Apr 2006 08:32:38 +0700 (WIT) Subject: [Gambas-user] How to scroll tableview from app Message-ID: <1441.202.154.41.227.1145928758.squirrel@...1425...> Hi, I'm new to Gambas (alas, to vb too). I made a tableview which can show 16 rows. When I add another rows (the 17th, 18th, ... ), they donot show-up: the tableview always display row number 1 to 16. My question is, when the tableview is full with row, how can I made the tableview scroll one row up when I add another row, so I can always see the last row in the tableview,. (Of course, I can use the scroll bar, but I want to do it from application). I use gambas 1.9.17 which is included in open suse 10. Thanks, Rudy From sourceforge-raindog2 at ...94... Tue Apr 25 03:41:37 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Mon, 24 Apr 2006 21:41:37 -0400 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <1441.202.154.41.227.1145928758.squirrel@...1425...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> Message-ID: <200604242141.37984.sourceforge-raindog2@...94...> On Mon April 24 2006 21:32, emil97 at ...1424... wrote: > with row, how can I made the tableview scroll one row up when > I add another row, so I can always see the last row in the > tableview,. (Of course, I can use the scroll bar, but I want > to do it from application). I think you want the TableView's ScrollY property. It takes an integer but I don't remember whether the number represents pixels from the top or rows from the top.... best to just experiment and find out. I'm not sure, but I think all other controls with scrollbars also have ScrollX and ScrollY properties to scroll them programmatically. Rob From gandor at ...1422... Tue Apr 25 07:41:05 2006 From: gandor at ...1422... (Shannon Kuchler) Date: Tue, 25 Apr 2006 00:41:05 -0500 Subject: [Gambas-user] Help with combobox loop please In-Reply-To: <200604242141.37984.sourceforge-raindog2@...94...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604242141.37984.sourceforge-raindog2@...94...> Message-ID: <200604250041.05360.gandor@...1422...> what i need to do is loop through a combobox's drop down list and im not sure of the syntax ie... if combobox1.text = anything in the combobox1.list then print "item already in list" else do this end if can anyone help please? From jscops at ...11... Tue Apr 25 08:25:26 2006 From: jscops at ...11... (Jacky) Date: Tue, 25 Apr 2006 08:25:26 +0200 Subject: [Gambas-user] Help with combobox loop please In-Reply-To: <200604250041.05360.gandor@...1422...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604242141.37984.sourceforge-raindog2@...94...> <200604250041.05360.gandor@...1422...> Message-ID: <200604250825.26762.jscops@...11...> Le Mardi 25 Avril 2006 07:41, Shannon Kuchler a ?crit?: > what i need to do is loop through a combobox's drop down list and im not > sure of the syntax > ie... > > if combobox1.text = anything in the combobox1.list then > print "item already in list" > else > do this > end if > > can anyone help please? Bonjour Shannon, Combobox1.add(Combobox1.text, Combobox1.text) Combobox1.item[0] = Combobox1.text Catch Combobox1.MoveFirst repeat Combobox1.Item.selected = true If Combobox1.Item[0] = Combobox1.Text then Print "Already in List" else Do something endif until Combobox1.Movenext() Jack. From maillists at ...1367... Tue Apr 25 08:36:32 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Mon, 24 Apr 2006 23:36:32 -0700 Subject: [Gambas-user] Help with combobox loop please In-Reply-To: <200604250041.05360.gandor@...1422...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604242141.37984.sourceforge-raindog2@...94...> <200604250041.05360.gandor@...1422...> Message-ID: <1145946992.2838.3.camel@...1368...> You should really check online help for these things, maybe use the search tab for "combobox" and see what you can use (I'm assuming HELP for most Gambas versions is similar to Gambas 1.0.15 -- what I use). Here's some info that might help you: To loop thru a combo box do this... DIM I AS Integer FOR I = 0 TO combobox.Count - 1 PRINT I & "--" & combobox[I].Text NEXT But if you just want to check for an existing item do this... PRINT cmblocation.Find("myitem") This will return the index number of the item if it exists (0 thru whatever), otherwise it returns -1. HTH, Jeff On Tue, 2006-04-25 at 00:41 -0500, Shannon Kuchler wrote: > what i need to do is loop through a combobox's drop down list and im not sure > of the syntax > ie... > > if combobox1.text = anything in the combobox1.list then > print "item already in list" > else > do this > end if > > can anyone help please? -- .^. /V\ /( )\ ^^-^^ Linux Advocate From stibs at ...6... Tue Apr 25 12:18:01 2006 From: stibs at ...6... (stibs at ...6...) Date: Tue, 25 Apr 2006 12:18:01 +0200 (CEST) Subject: [Gambas-user] German language author wanted Message-ID: <1145960281.13506@...6...> Hi! We are producing a german Linux magazine. We look for native german authors who would write for us about Gambas. Plz contact me off-list for detailed information (e.g. how much you can earn ;). Best! STIBS at stibs dot cc http://stibs.cc http://stibs.cc/stx # +49 (0) 35053 31574 ... or give me a call :) From leonardo at ...1237... Tue Apr 25 17:28:38 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Tue, 25 Apr 2006 17:28:38 +0200 Subject: [Gambas-user] Translating application Message-ID: <444E4026.9090202@...1237...> Hello everybody. I would like to write an application having 2 interface languages. I think that I could get this result creating a new application and specifyng that the application is translatable (sorry if these are not the correct words but I use the italian localization of Gambas 1.9.28). Then, I should use the Tools/Translate voice in Gambas menu... Is this correct? But I would also know how this works.. Let me explain... If this is the correct way, I think that Gambas runtime does the translation when it starts to run the compiled file following the system language, isn't it? I would like to follow a more professional way, getting the user the ability to choose the interface language using the program menu (i.e., Tools/Language and then English/Italian) and having the interface language translated "on the run". How can I get this? -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From leonardo at ...1237... Tue Apr 25 17:45:11 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Tue, 25 Apr 2006 17:45:11 +0200 Subject: [Gambas-user] Errors compiling 1.9.29 Message-ID: <444E4407.4010100@...1237...> I downloaded and tried to compile Gambas 1.9.29 but I got some errors when I run the make command. These are the last output lines of make before it stops compiling (I would like to say that previous versions of Gambas compiled fine on same system [Suse 9.3]): ------------------ gbx_string.o(.text+0x5ed): In function `STRING_conv': /home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:565: undefined reference to `libiconv_open' gbx_string.o(.text+0x62c):/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:584: undefined reference to `libiconv' gbx_string.o(.text+0x66e):/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:600: undefined reference to `libiconv_close' collect2: ld returned 1 exit status make[4]: *** [gbx2] Error 1 make[4]: Leaving directory `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29' make: *** [all] Error 2 ------------------- It seems an error og libiconv libraries that are missing but I have them installed on my system, compiled from sources (version 1.5-ximian.3). -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From sourceforge-raindog2 at ...94... Tue Apr 25 18:11:52 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Tue, 25 Apr 2006 12:11:52 -0400 Subject: [Gambas-user] Translating application In-Reply-To: <444E4026.9090202@...1237...> References: <444E4026.9090202@...1237...> Message-ID: <200604251211.53129.sourceforge-raindog2@...94...> On Tue April 25 2006 11:28, Leonardo Miliani wrote: > I would like to follow a more professional way, getting the > user the ability to choose the interface language using the > program menu (i.e., Tools/Language and then English/Italian) > and having the interface language translated "on the run". > How can I get this? This is actually a less professional way (reminds me of video games and early Windows 3.x software, before setting the language in the operating system was common.) Nonetheless, the way to do what you want is the same way we did it back in the early 90's.... put placeholder text in all your controls (for example, the name of the control or a shortened version of the text to be displayed) and loop through them replacing the placeholder with the language-appropriate string when you display each form or change the setting. You can store the strings in an ini file or database or whatever you like. You'll probably want to mark the project as "not translatable" to avoid any fights between your app and Gambas' own translation support.... and since, after all, it won't be translatable in any standard way. Rob From leonardo at ...1237... Tue Apr 25 19:14:58 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Tue, 25 Apr 2006 19:14:58 +0200 Subject: [Gambas-user] Translating application In-Reply-To: <200604251211.53129.sourceforge-raindog2@...94...> References: <444E4026.9090202@...1237...> <200604251211.53129.sourceforge-raindog2@...94...> Message-ID: <444E5912.3040603@...1237...> Rob Kudla ha scritto: > On Tue April 25 2006 11:28, Leonardo Miliani wrote: >> I would like to follow a more professional way, getting the >> user the ability to choose the interface language using the >> program menu (i.e., Tools/Language and then English/Italian) >> and having the interface language translated "on the run". >> How can I get this? > > This is actually a less professional way (reminds me of video > games and early Windows 3.x software, before setting the > language in the operating system was common.) > > Nonetheless, the way to do what you want is the same way we did > it back in the early 90's.... put placeholder text in all your > controls (for example, the name of the control or a shortened > version of the text to be displayed) and loop through them > replacing the placeholder with the language-appropriate string > when you display each form or change the setting. You can store > the strings in an ini file or database or whatever you like. > > You'll probably want to mark the project as "not translatable" to > avoid any fights between your app and Gambas' own translation > support.... and since, after all, it won't be translatable in > any standard way. > > Rob > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > Thanks for your answer. Let me understand how the translation works in Gambas... If I create an application that is tranlatable, then Gambas get the work to translate it when it runs it? I have just to create the translation strings for some languages? -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From cjro99 at ...67... Tue Apr 25 20:23:49 2006 From: cjro99 at ...67... (javier romero) Date: Tue, 25 Apr 2006 18:23:49 +0000 Subject: [Gambas-user] Drawing Message-ID: I try to do that, but in imageWidth *= scaleIsotropic imageHeight *= scaleIsotropic the interpreter sends an error. there is any error in there?. Also i need convert a drawing area into a image, how i can do that? Thanks Javier ---------------------------------------- > From: timothy.marshal-nichols at ...247... > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > Date: Mon, 24 Apr 2006 17:57:08 +0100 > > > This example shows how to print an image centred on the page. In includes > code to scale an image for the printer resolution. If the image is the to > large for the printer height or width resizes it to fit on the page - > keeping the aspect ratio. > > You will need something like this only with a drawing. > > PRIVATE SUB PrintImage(img AS Image) > DIM imageToPrint AS Image > DIM imageWidth AS Integer > DIM imageHeight AS Integer > DIM scaleIsotropic AS Float > ' Dispaly printer dialog > IF Printer.Setup() THEN RETURN > INC Application.Busy > ' Get image size for the printer resolution > imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution > imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution > ' Adjust image size if it does not fit on the printer page > IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN > ' Scale Isotropic, keep aspect ratio of the image > scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / > imageHeight) > imageWidth *= scaleIsotropic > imageHeight *= scaleIsotropic > END IF > 'PRINT "Width: " & imageToPrint, Printer.Width > 'PRINT "Height: " & imageToPrint, Printer.Height > ' Scale image > imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) > ' Draw image centered on printer page > Draw.Begin(Printer) > Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, > (Printer.Height - imageHeight) / 2) > Draw.End > DEC Application.Busy > END > > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > romero > Sent: Monday, 24 April 2006 14:37 > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > > > Ok, thanks, its works but the print is very small, i try scaling with this: > > draw.Begin(printer) > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > draw.End > but dosent works the print is the same, little, i try then with > > draw.Begin(printer) > draw.drawing(p1,350,350, p1.Width, p1.Height) > draw.End > and the same, very little, in both dont change > > How i scale? > > sorry about my very bad english > > Regards > Javier > ---------------------------------------- > > From: christian.faurebouvard at ...357... > > To: gambas-user at lists.sourceforge.net > > Subject: Re: [Gambas-user] Drawing > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > PUBLIC p1 AS Drawing > > > PUBLIC pag AS DrawingArea > > > > > > PUBLIC SUB _new() > > > p1 = NEW Drawing > > > draw.Begin(p1) > > > draw.Text("Hello", 0, 0) > > > draw.End > > > > > > END > > > > > > PUBLIC SUB Form_Open() > > > > > > pag = NEW DrawingArea(sv1) > > > > > > pag.Cached = TRUE > > > pag.Clear > > > pag.BackColor = color.White > > > pag.Width = printer.Width > > > pag.Height = printer.Height > > > pag.Border = 1 > > > draw.Begin(pag) > > > draw.Drawing(p1, 0, 0) > > > draw.End > > > ' This works OK > > > pag.Visible = TRUE > > > > > > END > > > > > > PUBLIC SUB Button1_Click() > > > > > > draw.Begin(printer) > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > draw.End > > > ' This doesn't works > > > END > > > > Hi Javier, > > > > Some printers can't print in (0,0) > > Try > > draw.drawing(p1, 350, 350) > > > > it work, but very small, need to be scaled. > > > > Regards, > > Christian > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > _________________________________________________________________ > Descarga gratis la Barra de Herramientas de MSN > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH From ronstk at ...239... Tue Apr 25 21:23:13 2006 From: ronstk at ...239... (ron) Date: Tue, 25 Apr 2006 21:23:13 +0200 Subject: [Gambas-user] Errors compiling 1.9.29 In-Reply-To: <444E4407.4010100@...1237...> References: <444E4407.4010100@...1237...> Message-ID: <200604252123.13971.ronstk@...239...> On Tuesday 25 April 2006 17:45, Leonardo Miliani wrote: > I downloaded and tried to compile Gambas 1.9.29 but I got some errors > when I run the make command. These are the last output lines of make > before it stops compiling (I would like to say that previous versions of > Gambas compiled fine on same system [Suse 9.3]): > > ------------------ > gbx_string.o(.text+0x5ed): In function `STRING_conv': > /home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:565: > undefined reference to `libiconv_open' > gbx_string.o(.text+0x62c):/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:584: > undefined reference to `libiconv' > gbx_string.o(.text+0x66e):/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx/gbx_string.c:600: > undefined reference to `libiconv_close' > collect2: ld returned 1 exit status > make[4]: *** [gbx2] Error 1 > make[4]: Leaving directory > `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main/gbx' > make[3]: *** [all-recursive] Error 1 > make[3]: Leaving directory > `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main' > make[2]: *** [all] Error 2 > make[2]: Leaving directory > `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29/main' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory > `/home/leo/Documenti/Software/Programmazione/Gambas2b/1.9.29/gambas2-1.9.29' > make: *** [all] Error 2 > ------------------- > > It seems an error og libiconv libraries that are missing but I have them > installed on my system, compiled from sources (version 1.5-ximian.3). > > Check in /etc/ld.so.conf for existence of the directory where libconv now is. Normal it is (for suse) in /usr/lib but you compiled yourself and it is now posible in /usr/local/lib. This path must be in ld.so.conf Normal the compile for system libraries is in /usr/local/src but it seams you like your home directory to compile. May be libiconv.so is also somewhere in your home path now. Just guessing, Ron From emil97 at ...1424... Wed Apr 26 04:42:21 2006 From: emil97 at ...1424... (rudy) Date: Wed, 26 Apr 2006 09:42:21 +0700 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <200604242141.37984.sourceforge-raindog2@...94...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604242141.37984.sourceforge-raindog2@...94...> Message-ID: <200604260942.22006.emil97@...1424...> On Tuesday 25 April 2006 08:41, Rob Kudla wrote: > On Mon April 24 2006 21:32, emil97 at ...1424... wrote: > > with row, how can I made the tableview scroll one row up when > > I add another row, so I can always see the last row in the > > tableview,. (Of course, I can use the scroll bar, but I want > > to do it from application). > > I think you want the TableView's ScrollY property. It takes an > integer but I don't remember whether the number represents > pixels from the top or rows from the top.... best to just > experiment and find out. > > I'm not sure, but I think all other controls with scrollbars also > have ScrollX and ScrollY properties to scroll them > programmatically. > Thanks, it works ! Actually I did experiment with ScrollY property but I didnot get the idea what will be the right number for tableview.ScrollY. (I thought of number of row and 1 for "one row up"). They didnot work. (I almost think maybe ScrollY isnot the property I want). But when you suggest pixels, I tried larger numbers: I multiply the number of row by ten. Well, it just works ! (Not sure, though, if it is really pixels count). From ronstk at ...239... Wed Apr 26 05:00:40 2006 From: ronstk at ...239... (ron) Date: Wed, 26 Apr 2006 05:00:40 +0200 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <200604260942.22006.emil97@...1424...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604242141.37984.sourceforge-raindog2@...94...> <200604260942.22006.emil97@...1424...> Message-ID: <200604260500.41259.ronstk@...239...> On Wednesday 26 April 2006 04:42, rudy wrote: > ?I multiply the number of row by ten. if all rows have the same height then use hi = tableview1.rows[0].height * tableview1.rows.count if tableview1.header then hi = hi + tableview1.columns.height Ron From gambas at ...1... Wed Apr 26 10:36:21 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 26 Apr 2006 10:36:21 +0200 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <200604260500.41259.ronstk@...239...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604260942.22006.emil97@...1424...> <200604260500.41259.ronstk@...239...> Message-ID: <200604261036.21622.gambas@...1...> On Wednesday 26 April 2006 05:00, ron wrote: > On Wednesday 26 April 2006 04:42, rudy wrote: > > ?I multiply the number of row by ten. > > if all rows have the same height then use > > hi = tableview1.rows[0].height * tableview1.rows.count > if tableview1.header then hi = hi + tableview1.columns.height > > > Ron > Cells have an X and Y property you can use from scrolling I think: TableView1.ScrollY = TableView1[0, n].Y Regards, -- Benoit Minisini From timothy.marshal-nichols at ...247... Wed Apr 26 10:39:23 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Wed, 26 Apr 2006 09:39:23 +0100 Subject: [Gambas-user] Drawing In-Reply-To: Message-ID: You must be using an older version of Gambas. The *= is just multiplication. Try: imageWidth = imageWidth * scaleIsotropic imageHeight = imageHeight * scaleIsotropic this the same code in long hand. The PrintImage code was to show you how to use the Resolution of the Printer and Desktop to find the required image/drawing size. Its just I had code to hand using a image that I knew worked. You can still Draw a Drawing. This is what you might get: PRIVATE SUB PrintDrawing(drw AS Drawing) DIM drawingWidth AS Integer DIM drawingHeight AS Integer DIM scaleIsotropic AS Float ' Display printer dialog IF Printer.Setup() THEN RETURN INC Application.Busy ' Get drawing size for the printer resolution drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution ' Adjust drawing size if it does not fit on the printer page IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN ' Scale Isotropic, keep aspect ratio of the image scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / drawingHeight) drawingWidth *= scaleIsotropic drawingHeight *= scaleIsotropic END IF 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height ' Draw drawing centred on printer page Draw.Begin(Printer) 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - drawingHeight) / 2, drawingWidth, drawingHeight) Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, (Printer.Height - drawingHeight) / 2, drawingWidth, drawingHeight) Draw.End DEC Application.Busy END Two points: 1. Convert the *= again! 2. On my system this still only prints the Drawing at the old resolution. You can see if you uncomment the Draw.Rect line that the calculation for the drawing size is correct. By setting the width and height the help says the drawing should be scaled. I think this has been fixed with later versions of Gambas as I know there has been some work the SVG code. (I was going to upgrade after installing SUES 10.1.) Also the scaling of a Drawing when drawing on a DrawingArea does not work - so it must be a problem with the Draw.Drawing method. If this method has not been fixed then you will never be able to print good image at the right size. Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier romero Sent: Tuesday, 25 April 2006 19:24 To: gambas-user at lists.sourceforge.net Subject: RE: Re: [Gambas-user] Drawing I try to do that, but in imageWidth *= scaleIsotropic imageHeight *= scaleIsotropic the interpreter sends an error. there is any error in there?. Also i need convert a drawing area into a image, how i can do that? Thanks Javier ---------------------------------------- > From: timothy.marshal-nichols at ...247... > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > Date: Mon, 24 Apr 2006 17:57:08 +0100 > > > This example shows how to print an image centred on the page. In includes > code to scale an image for the printer resolution. If the image is the to > large for the printer height or width resizes it to fit on the page - > keeping the aspect ratio. > > You will need something like this only with a drawing. > > PRIVATE SUB PrintImage(img AS Image) > DIM imageToPrint AS Image > DIM imageWidth AS Integer > DIM imageHeight AS Integer > DIM scaleIsotropic AS Float > ' Dispaly printer dialog > IF Printer.Setup() THEN RETURN > INC Application.Busy > ' Get image size for the printer resolution > imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution > imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution > ' Adjust image size if it does not fit on the printer page > IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN > ' Scale Isotropic, keep aspect ratio of the image > scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / > imageHeight) > imageWidth *= scaleIsotropic > imageHeight *= scaleIsotropic > END IF > 'PRINT "Width: " & imageToPrint, Printer.Width > 'PRINT "Height: " & imageToPrint, Printer.Height > ' Scale image > imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) > ' Draw image centered on printer page > Draw.Begin(Printer) > Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, > (Printer.Height - imageHeight) / 2) > Draw.End > DEC Application.Busy > END > > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > romero > Sent: Monday, 24 April 2006 14:37 > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > > > Ok, thanks, its works but the print is very small, i try scaling with this: > > draw.Begin(printer) > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > draw.End > but dosent works the print is the same, little, i try then with > > draw.Begin(printer) > draw.drawing(p1,350,350, p1.Width, p1.Height) > draw.End > and the same, very little, in both dont change > > How i scale? > > sorry about my very bad english > > Regards > Javier > ---------------------------------------- > > From: christian.faurebouvard at ...357... > > To: gambas-user at lists.sourceforge.net > > Subject: Re: [Gambas-user] Drawing > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > PUBLIC p1 AS Drawing > > > PUBLIC pag AS DrawingArea > > > > > > PUBLIC SUB _new() > > > p1 = NEW Drawing > > > draw.Begin(p1) > > > draw.Text("Hello", 0, 0) > > > draw.End > > > > > > END > > > > > > PUBLIC SUB Form_Open() > > > > > > pag = NEW DrawingArea(sv1) > > > > > > pag.Cached = TRUE > > > pag.Clear > > > pag.BackColor = color.White > > > pag.Width = printer.Width > > > pag.Height = printer.Height > > > pag.Border = 1 > > > draw.Begin(pag) > > > draw.Drawing(p1, 0, 0) > > > draw.End > > > ' This works OK > > > pag.Visible = TRUE > > > > > > END > > > > > > PUBLIC SUB Button1_Click() > > > > > > draw.Begin(printer) > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > draw.End > > > ' This doesn't works > > > END > > > > Hi Javier, > > > > Some printers can't print in (0,0) > > Try > > draw.drawing(p1, 350, 350) > > > > it work, but very small, need to be scaled. > > > > Regards, > > Christian > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > _________________________________________________________________ > Descarga gratis la Barra de Herramientas de MSN > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From gambas at ...1... Wed Apr 26 10:46:43 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 26 Apr 2006 10:46:43 +0200 Subject: [Gambas-user] Drawing In-Reply-To: References: Message-ID: <200604261046.43525.gambas@...1...> On Wednesday 26 April 2006 10:39, Timothy Marshal-Nichols wrote: > You must be using an older version of Gambas. The *= is just > multiplication. Try: > > imageWidth = imageWidth * scaleIsotropic > imageHeight = imageHeight * scaleIsotropic > > this the same code in long hand. > > The PrintImage code was to show you how to use the Resolution of the > Printer and Desktop to find the required image/drawing size. Its just I had > code to hand using a image that I knew worked. You can still Draw a > Drawing. > > This is what you might get: > > PRIVATE SUB PrintDrawing(drw AS Drawing) > DIM drawingWidth AS Integer > DIM drawingHeight AS Integer > DIM scaleIsotropic AS Float > ' Display printer dialog > IF Printer.Setup() THEN RETURN > INC Application.Busy > ' Get drawing size for the printer resolution > drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution > drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution > ' Adjust drawing size if it does not fit on the printer page > IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN > ' Scale Isotropic, keep aspect ratio of the image > scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / > drawingHeight) > drawingWidth *= scaleIsotropic > drawingHeight *= scaleIsotropic > END IF > 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width > 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height > ' Draw drawing centred on printer page > Draw.Begin(Printer) > 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.End > DEC Application.Busy > END > > Two points: > > 1. Convert the *= again! > > 2. On my system this still only prints the Drawing at the old resolution. > You can see if you uncomment the Draw.Rect line that the calculation for > the drawing size is correct. By setting the width and height the help says > the drawing should be scaled. I think this has been fixed with later > versions of Gambas as I know there has been some work the SVG code. (I was > going to upgrade after installing SUES 10.1.) > > Also the scaling of a Drawing when drawing on a DrawingArea does not work - > so it must be a problem with the Draw.Drawing method. If this method has > not been fixed then you will never be able to print good image at the right > size. > > Thanks > > 8-{)} Timothy Marshal-Nichols > > If a kind people could make a little example of printing, I will put it with the other Gambas examples :-) Regards, -- Benoit Minisini From cjro99 at ...67... Wed Apr 26 15:50:43 2006 From: cjro99 at ...67... (javier romero) Date: Wed, 26 Apr 2006 13:50:43 +0000 Subject: [Gambas-user] Drawing Message-ID: Thanks very much for the help. I have an aditional question, is possible to convert a Drawing or a DrawingArea into a Image or Picture? Regards Javier ---------------------------------------- > From: timothy.marshal-nichols at ...247... > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > Date: Wed, 26 Apr 2006 09:39:23 +0100 > > > > You must be using an older version of Gambas. The *= is just multiplication. > Try: > > imageWidth = imageWidth * scaleIsotropic > imageHeight = imageHeight * scaleIsotropic > > this the same code in long hand. > > The PrintImage code was to show you how to use the Resolution of the Printer > and Desktop to find the required image/drawing size. Its just I had code to > hand using a image that I knew worked. You can still Draw a Drawing. > > This is what you might get: > > PRIVATE SUB PrintDrawing(drw AS Drawing) > DIM drawingWidth AS Integer > DIM drawingHeight AS Integer > DIM scaleIsotropic AS Float > ' Display printer dialog > IF Printer.Setup() THEN RETURN > INC Application.Busy > ' Get drawing size for the printer resolution > drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution > drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution > ' Adjust drawing size if it does not fit on the printer page > IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN > ' Scale Isotropic, keep aspect ratio of the image > scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / > drawingHeight) > drawingWidth *= scaleIsotropic > drawingHeight *= scaleIsotropic > END IF > 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width > 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height > ' Draw drawing centred on printer page > Draw.Begin(Printer) > 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.End > DEC Application.Busy > END > > Two points: > > 1. Convert the *= again! > > 2. On my system this still only prints the Drawing at the old resolution. > You can see if you uncomment the Draw.Rect line that the calculation for the > drawing size is correct. By setting the width and height the help says the > drawing should be scaled. I think this has been fixed with later versions of > Gambas as I know there has been some work the SVG code. (I was going to > upgrade after installing SUES 10.1.) > > Also the scaling of a Drawing when drawing on a DrawingArea does not work - > so it must be a problem with the Draw.Drawing method. If this method has not > been fixed then you will never be able to print good image at the right > size. > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > romero > Sent: Tuesday, 25 April 2006 19:24 > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > > > I try to do that, but in > > imageWidth *= scaleIsotropic > imageHeight *= scaleIsotropic > > the interpreter sends an error. > there is any error in there?. > > Also i need convert a drawing area into a image, how i can do that? > > Thanks > Javier > ---------------------------------------- > > From: timothy.marshal-nichols at ...247... > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > Date: Mon, 24 Apr 2006 17:57:08 +0100 > > > > > > This example shows how to print an image centred on the page. In includes > > code to scale an image for the printer resolution. If the image is the to > > large for the printer height or width resizes it to fit on the page - > > keeping the aspect ratio. > > > > You will need something like this only with a drawing. > > > > PRIVATE SUB PrintImage(img AS Image) > > DIM imageToPrint AS Image > > DIM imageWidth AS Integer > > DIM imageHeight AS Integer > > DIM scaleIsotropic AS Float > > ' Dispaly printer dialog > > IF Printer.Setup() THEN RETURN > > INC Application.Busy > > ' Get image size for the printer resolution > > imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution > > imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution > > ' Adjust image size if it does not fit on the printer page > > IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN > > ' Scale Isotropic, keep aspect ratio of the image > > scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / > > imageHeight) > > imageWidth *= scaleIsotropic > > imageHeight *= scaleIsotropic > > END IF > > 'PRINT "Width: " & imageToPrint, Printer.Width > > 'PRINT "Height: " & imageToPrint, Printer.Height > > ' Scale image > > imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) > > ' Draw image centered on printer page > > Draw.Begin(Printer) > > Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, > > (Printer.Height - imageHeight) / 2) > > Draw.End > > DEC Application.Busy > > END > > > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > > > -----Original Message----- > > From: gambas-user-admin at lists.sourceforge.net > > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > > romero > > Sent: Monday, 24 April 2006 14:37 > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > > > > > Ok, thanks, its works but the print is very small, i try scaling with > this: > > > > draw.Begin(printer) > > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > > draw.End > > but dosent works the print is the same, little, i try then with > > > > draw.Begin(printer) > > draw.drawing(p1,350,350, p1.Width, p1.Height) > > draw.End > > and the same, very little, in both dont change > > > > How i scale? > > > > sorry about my very bad english > > > > Regards > > Javier > > ---------------------------------------- > > > From: christian.faurebouvard at ...357... > > > To: gambas-user at lists.sourceforge.net > > > Subject: Re: [Gambas-user] Drawing > > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > > PUBLIC p1 AS Drawing > > > > PUBLIC pag AS DrawingArea > > > > > > > > PUBLIC SUB _new() > > > > p1 = NEW Drawing > > > > draw.Begin(p1) > > > > draw.Text("Hello", 0, 0) > > > > draw.End > > > > > > > > END > > > > > > > > PUBLIC SUB Form_Open() > > > > > > > > pag = NEW DrawingArea(sv1) > > > > > > > > pag.Cached = TRUE > > > > pag.Clear > > > > pag.BackColor = color.White > > > > pag.Width = printer.Width > > > > pag.Height = printer.Height > > > > pag.Border = 1 > > > > draw.Begin(pag) > > > > draw.Drawing(p1, 0, 0) > > > > draw.End > > > > ' This works OK > > > > pag.Visible = TRUE > > > > > > > > END > > > > > > > > PUBLIC SUB Button1_Click() > > > > > > > > draw.Begin(printer) > > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > > draw.End > > > > ' This doesn't works > > > > END > > > > > > Hi Javier, > > > > > > Some printers can't print in (0,0) > > > Try > > > draw.drawing(p1, 350, 350) > > > > > > it work, but very small, need to be scaled. > > > > > > Regards, > > > Christian > > > > > > > > > ------------------------------------------------------- > > > Using Tomcat but need to do more? Need to support web services, > security? > > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > > _______________________________________________ > > > Gambas-user mailing list > > > Gambas-user at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > _________________________________________________________________ > > Descarga gratis la Barra de Herramientas de MSN > > > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > _________________________________________________________________ > Descarga gratis la Barra de Herramientas de MSN > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH From maillists at ...1367... Wed Apr 26 18:32:18 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Wed, 26 Apr 2006 09:32:18 -0700 Subject: [Gambas-user] Drawing In-Reply-To: References: Message-ID: <1146069138.25513.1.camel@...1368...> I've a sub that takes an icon and overlays another icon on it using draw: ------------------------------------------------------ PUBLIC FUNCTION MaskImages(myIcon AS Picture, myOverLayPath AS String) AS Picture DIM drawIcon AS picture DIM wX AS Integer DIM wY AS Integer wX = myIcon.Width wY = myIcon.Height drawIcon = NEW picture(wX,wY,TRUE) Draw.Begin(drawIcon) Draw.picture(myIcon,0,0) Draw.Picture(StretchImage(picture[myOverLayPath],wX,wY),0,0) Draw.End myIcon = NULL RETURN drawIcon END ------------------------------------------------------ HTH Jeff, On Wed, 2006-04-26 at 13:50 +0000, javier romero wrote: > Thanks very much for the help. > > I have an aditional question, is possible to convert a Drawing or a DrawingArea into a Image or Picture? > > Regards > Javier > > ---------------------------------------- > > From: timothy.marshal-nichols at ...247... > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > Date: Wed, 26 Apr 2006 09:39:23 +0100 > > > > > > > > You must be using an older version of Gambas. The *= is just multiplication. > > Try: > > > > imageWidth = imageWidth * scaleIsotropic > > imageHeight = imageHeight * scaleIsotropic > > > > this the same code in long hand. > > > > The PrintImage code was to show you how to use the Resolution of the Printer > > and Desktop to find the required image/drawing size. Its just I had code to > > hand using a image that I knew worked. You can still Draw a Drawing. > > > > This is what you might get: > > > > PRIVATE SUB PrintDrawing(drw AS Drawing) > > DIM drawingWidth AS Integer > > DIM drawingHeight AS Integer > > DIM scaleIsotropic AS Float > > ' Display printer dialog > > IF Printer.Setup() THEN RETURN > > INC Application.Busy > > ' Get drawing size for the printer resolution > > drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution > > drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution > > ' Adjust drawing size if it does not fit on the printer page > > IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN > > ' Scale Isotropic, keep aspect ratio of the image > > scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / > > drawingHeight) > > drawingWidth *= scaleIsotropic > > drawingHeight *= scaleIsotropic > > END IF > > 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width > > 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height > > ' Draw drawing centred on printer page > > Draw.Begin(Printer) > > 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - > > drawingHeight) / 2, drawingWidth, drawingHeight) > > Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, (Printer.Height - > > drawingHeight) / 2, drawingWidth, drawingHeight) > > Draw.End > > DEC Application.Busy > > END > > > > Two points: > > > > 1. Convert the *= again! > > > > 2. On my system this still only prints the Drawing at the old resolution. > > You can see if you uncomment the Draw.Rect line that the calculation for the > > drawing size is correct. By setting the width and height the help says the > > drawing should be scaled. I think this has been fixed with later versions of > > Gambas as I know there has been some work the SVG code. (I was going to > > upgrade after installing SUES 10.1.) > > > > Also the scaling of a Drawing when drawing on a DrawingArea does not work - > > so it must be a problem with the Draw.Drawing method. If this method has not > > been fixed then you will never be able to print good image at the right > > size. > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > > > -----Original Message----- > > From: gambas-user-admin at lists.sourceforge.net > > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > > romero > > Sent: Tuesday, 25 April 2006 19:24 > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > > > > > I try to do that, but in > > > > imageWidth *= scaleIsotropic > > imageHeight *= scaleIsotropic > > > > the interpreter sends an error. > > there is any error in there?. > > > > Also i need convert a drawing area into a image, how i can do that? > > > > Thanks > > Javier > > ---------------------------------------- > > > From: timothy.marshal-nichols at ...247... > > > To: gambas-user at lists.sourceforge.net > > > Subject: RE: Re: [Gambas-user] Drawing > > > Date: Mon, 24 Apr 2006 17:57:08 +0100 > > > > > > > > > This example shows how to print an image centred on the page. In includes > > > code to scale an image for the printer resolution. If the image is the to > > > large for the printer height or width resizes it to fit on the page - > > > keeping the aspect ratio. > > > > > > You will need something like this only with a drawing. > > > > > > PRIVATE SUB PrintImage(img AS Image) > > > DIM imageToPrint AS Image > > > DIM imageWidth AS Integer > > > DIM imageHeight AS Integer > > > DIM scaleIsotropic AS Float > > > ' Dispaly printer dialog > > > IF Printer.Setup() THEN RETURN > > > INC Application.Busy > > > ' Get image size for the printer resolution > > > imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution > > > imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution > > > ' Adjust image size if it does not fit on the printer page > > > IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN > > > ' Scale Isotropic, keep aspect ratio of the image > > > scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / > > > imageHeight) > > > imageWidth *= scaleIsotropic > > > imageHeight *= scaleIsotropic > > > END IF > > > 'PRINT "Width: " & imageToPrint, Printer.Width > > > 'PRINT "Height: " & imageToPrint, Printer.Height > > > ' Scale image > > > imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) > > > ' Draw image centered on printer page > > > Draw.Begin(Printer) > > > Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, > > > (Printer.Height - imageHeight) / 2) > > > Draw.End > > > DEC Application.Busy > > > END > > > > > > > > > Thanks > > > > > > 8-{)} Timothy Marshal-Nichols > > > > > > > > > > > > -----Original Message----- > > > From: gambas-user-admin at lists.sourceforge.net > > > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > > > romero > > > Sent: Monday, 24 April 2006 14:37 > > > To: gambas-user at lists.sourceforge.net > > > Subject: RE: Re: [Gambas-user] Drawing > > > > > > > > > Ok, thanks, its works but the print is very small, i try scaling with > > this: > > > > > > draw.Begin(printer) > > > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > > > draw.End > > > but dosent works the print is the same, little, i try then with > > > > > > draw.Begin(printer) > > > draw.drawing(p1,350,350, p1.Width, p1.Height) > > > draw.End > > > and the same, very little, in both dont change > > > > > > How i scale? > > > > > > sorry about my very bad english > > > > > > Regards > > > Javier > > > ---------------------------------------- > > > > From: christian.faurebouvard at ...357... > > > > To: gambas-user at lists.sourceforge.net > > > > Subject: Re: [Gambas-user] Drawing > > > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > > > PUBLIC p1 AS Drawing > > > > > PUBLIC pag AS DrawingArea > > > > > > > > > > PUBLIC SUB _new() > > > > > p1 = NEW Drawing > > > > > draw.Begin(p1) > > > > > draw.Text("Hello", 0, 0) > > > > > draw.End > > > > > > > > > > END > > > > > > > > > > PUBLIC SUB Form_Open() > > > > > > > > > > pag = NEW DrawingArea(sv1) > > > > > > > > > > pag.Cached = TRUE > > > > > pag.Clear > > > > > pag.BackColor = color.White > > > > > pag.Width = printer.Width > > > > > pag.Height = printer.Height > > > > > pag.Border = 1 > > > > > draw.Begin(pag) > > > > > draw.Drawing(p1, 0, 0) > > > > > draw.End > > > > > ' This works OK > > > > > pag.Visible = TRUE > > > > > > > > > > END > > > > > > > > > > PUBLIC SUB Button1_Click() > > > > > > > > > > draw.Begin(printer) > > > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > > > draw.End > > > > > ' This doesn't works > > > > > END > > > > > > > > Hi Javier, > > > > > > > > Some printers can't print in (0,0) > > > > Try > > > > draw.drawing(p1, 350, 350) > > > > > > > > it work, but very small, need to be scaled. > > > > > > > > Regards, > > > > Christian > > > > > > > > > > > > ------------------------------------------------------- > > > > Using Tomcat but need to do more? Need to support web services, > > security? > > > > Get stuff done quickly with pre-integrated technology to make your job > > > easier > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > > > _______________________________________________ > > > > Gambas-user mailing list > > > > Gambas-user at lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > > _________________________________________________________________ > > > Descarga gratis la Barra de Herramientas de MSN > > > > > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > > > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > > > > > ------------------------------------------------------- > > > Using Tomcat but need to do more? Need to support web services, security? > > > Get stuff done quickly with pre-integrated technology to make your job > > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > > _______________________________________________ > > > Gambas-user mailing list > > > Gambas-user at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > > > > > > > > > > > ------------------------------------------------------- > > > Using Tomcat but need to do more? Need to support web services, security? > > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > _______________________________________________ > > > Gambas-user mailing list > > > Gambas-user at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > _________________________________________________________________ > > Descarga gratis la Barra de Herramientas de MSN > > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > _________________________________________________________________ > Descarga gratis la Barra de Herramientas de MSN > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd_______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- .^. /V\ /( )\ ^^-^^ Linux Advocate From leonardo at ...1237... Wed Apr 26 18:46:08 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Wed, 26 Apr 2006 18:46:08 +0200 Subject: [Gambas-user] Errors compiling 1.9.29 In-Reply-To: <200604252123.13971.ronstk@...239...> References: <444E4407.4010100@...1237...> <200604252123.13971.ronstk@...239...> Message-ID: <444FA3D0.6060907@...1237...> Thank you for your interest :-) ron ha scritto: > Check in /etc/ld.so.conf for existence of the directory where libconv now is. > > Normal it is (for suse) in /usr/lib but you compiled yourself and > it is now posible in /usr/local/lib. Yes, it is here. > This path must be in ld.so.conf Yes, it is. > Normal the compile for system libraries is in /usr/local/src > but it seams you like your home directory to compile. Because of hard disk space ;-) The core system is on an HD that is not much capable, so I got another HD (bigger than the other one) where I store and compile softwares. > May be libiconv.so is also somewhere in your home path now. > > Just guessing, > > Ron I tried to upgrade libiconv to 1.9.x but I get same errors. Searching in my system for libiconv files I found that I have a libiconv_plug file. Gambas compiler says that it doesn't find "libiconv_open" and "libiconv_close" files. Maybe this is the problem? How can I get these 2 files? Which version of libiconv has been used to compile Gambas 1.9.29? Where can I find it? -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From joscub68 at ...67... Wed Apr 26 19:34:37 2006 From: joscub68 at ...67... (Jose Cubillo) Date: Wed, 26 Apr 2006 11:34:37 -0600 Subject: [Gambas-user] Impresora para punto de venta In-Reply-To: <200604032328.58384.gambas@...1...> Message-ID: Estimado Colega, todos los modelos tm300 tm200 de la Epson trabajan muy bien en linux, las impresoras que son paralelas con solo configurar cups y selecionar una impresora de nueve pines, te va a funcionar, pero recuerda a tu usuario darle los permisos necesarios para que pueda imprimir. Con las impresoras seriales hay que hacer un truco ya que como todos sabemos la memoria de estos dispositivos funciona diferente al puerto paralelo, por lo que tuve que ingeniarmelas para hacer lo siguiente: en ambos casos cuando imprimo primero genero un archivo con toda la informacion si no se hace asi, no creo que te funcione, fue la unica forma de hacerlo funcionar despues de muchas horas de prueba. para las impresoras paralela : Se crea un archivo y luego se ejecuta un shell desplegando el archivo hacia el puerto de la impresora para la impresora serial : se ejecuta un shell que envia cada linea al puerto serial, se hace una pausa de 0.15 con wait y continua con la siguiente linea, esto se hace para no saturar la memoria del puerto, si eso pasara la informacion enviada se pierde y no imprime el documento completo, cualquier duda, me envia un correo y te mando un ejemplo, ya que estoy fuera y no tengo a mano mis trabajos. espero que te ayude. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From joscub68 at ...67... Wed Apr 26 19:53:53 2006 From: joscub68 at ...67... (Jose Cubillo) Date: Wed, 26 Apr 2006 11:53:53 -0600 Subject: [Gambas-user] imprimir tickets desde gambas In-Reply-To: Message-ID: Eso depende de que impresora este utilizando, yo he utilizado una de datmax y otra de zebra y es muy facil, con los datos de la impresora como son la teperatura, los espacios entre cada tiquete y otros valores y como minimo el codigo de barras a generar se crea un archivo txt y luego se lo envia al puerto en donde esta conectada y ya tienes funcionando la impresora de tiquetes, yo he impreso desde un tiquete hasta miles cumpliendo las reglas de impresion de los puertos seriales si fuera el caso. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From Tuxforall at ...17... Wed Apr 26 20:08:56 2006 From: Tuxforall at ...17... (Tuxforall at ...17...) Date: Wed, 26 Apr 2006 20:08:56 +0200 (MEST) Subject: [Gambas-user] VAL() Message-ID: <15948.1146074936@...1426...> Hello a little problem, val("&Ha000") is not -24576 :) Regards gambas 1.9.29 -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail From gambas at ...1... Wed Apr 26 23:03:46 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 26 Apr 2006 23:03:46 +0200 Subject: [Gambas-user] VAL() In-Reply-To: <15948.1146074936@...1426...> References: <15948.1146074936@...1426...> Message-ID: <200604262303.46691.gambas@...1...> On Wednesday 26 April 2006 20:08, Tuxforall at ...17... wrote: > Hello > > a little problem, val("&Ha000") is not -24576 :) > > Regards > > > gambas 1.9.29 And what should be the result? -- Benoit Minisini From joe1962 at ...626... Wed Apr 26 23:31:02 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Wed, 26 Apr 2006 17:31:02 -0400 Subject: [Gambas-user] GTK component in 1.9.29 Message-ID: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> Just downloaded 1.9.29 and it won't enable the GTK component. I am currently the Gambas packager for my distro (Vector Linux 5.1.2 SOHO) which has GTK+2 2.6.1. Is a higher version needed now, Daniel? I have previously packaged 1.0.14 and 1.0.15, but now we need the GTK component for a new GUI installer project I'm working on for the distro. Regards, Joe1962 From dcamposf at ...626... Thu Apr 27 00:01:52 2006 From: dcamposf at ...626... (Daniel Campos) Date: Thu, 27 Apr 2006 00:01:52 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> Message-ID: <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> Hi: Current version has been tested with GTK+ 2.8.x and it probably will not compile with previous versions. Daniel 2006/4/26, Jose J. Rodriguez : > > Just downloaded 1.9.29 and it won't enable the GTK component. I am > currently the Gambas packager for my distro (Vector Linux 5.1.2 SOHO) > which has GTK+2 2.6.1. Is a higher version needed now, Daniel? I have > previously packaged 1.0.14 and 1.0.15, but now we need the GTK > component for a new GUI installer project I'm working on for the > distro. > > Regards, > Joe1962 > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drmad at ...1302... Thu Apr 27 01:23:18 2006 From: drmad at ...1302... (Oliver Etchebarne Bejarano) Date: Wed, 26 Apr 2006 18:23:18 -0500 Subject: [Gambas-user] iif bug? Message-ID: <445000E6.4090904@...1302...> Hey folks, I'm trying this: ------ dim id as integer dim text as string text = "1" id = iif(IsNull(Val(text)), 0, Val(text)) ------ Obviously, I want to obtain the numeric value of "text", or 0 if it is not a valid number. But that code fails with ERROR: Type mismatch: wanted Integer, got Null instead. It looks like Gambas is evaluating both true and false parts before doing the iif check, and I think that shouldn't be the correct behavior. btw I'm trying this on gambas 1.9.29 HTH -- Oliver Etchebarne Bejarano drmad/paperclip www.paperclip.com.pe From drmad at ...1302... Thu Apr 27 01:30:13 2006 From: drmad at ...1302... (Oliver Etchebarne Bejarano) Date: Wed, 26 Apr 2006 18:30:13 -0500 Subject: [Gambas-user] iif bug? In-Reply-To: <445000E6.4090904@...1302...> References: <445000E6.4090904@...1302...> Message-ID: <44500285.5060006@...1302...> eH-- it fails with text="" or text="oliver" or anything non-numeric. Sorry :) Oliver Etchebarne Bejarano wrote: > Hey folks, > > I'm trying this: > > ------ > > dim id as integer > dim text as string > > text = "1" > id = iif(IsNull(Val(text)), 0, Val(text)) > > ------ > > Obviously, I want to obtain the numeric value of "text", or 0 if it is > not a valid number. But that code fails with > > ERROR: Type mismatch: wanted Integer, got Null instead. > > It looks like Gambas is evaluating both true and false parts before > doing the iif check, and I think that shouldn't be the correct behavior. > > btw I'm trying this on gambas 1.9.29 > > HTH > -- Oliver Etchebarne Bejarano drmad/paperclip www.paperclip.com.pe From ronstk at ...239... Thu Apr 27 07:32:47 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 07:32:47 +0200 Subject: [Gambas-user] Errors compiling 1.9.29 In-Reply-To: <444FA3D0.6060907@...1237...> References: <444E4407.4010100@...1237...> <200604252123.13971.ronstk@...239...> <444FA3D0.6060907@...1237...> Message-ID: <200604270732.47657.ronstk@...239...> On Wednesday 26 April 2006 18:46, Leonardo Miliani wrote: > Thank you for your interest :-) > --8<-- > > Ron > > I tried to upgrade libiconv to 1.9.x but I get same errors. > Searching in my system for libiconv files I found that I have a > libiconv_plug file. Gambas compiler says that it doesn't find > "libiconv_open" and "libiconv_close" files. Maybe this is the problem? > How can I get these 2 files? > Which version of libiconv has been used to compile Gambas 1.9.29? Where > can I find it? > hm, i just found I do not have libiconv at all installed. I have only program iconv in /usr/bin. iconvconfig -V returns *iconvconfig (GNU libc) 2.3.3* Maybe a try with --with-libiconv=no or something to find if there are more problems. Using here SuSE9.2 KDE 3.5.2 Ron From ronstk at ...239... Thu Apr 27 07:38:48 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 07:38:48 +0200 Subject: [Gambas-user] VAL() In-Reply-To: <200604262303.46691.gambas@...1...> References: <15948.1146074936@...1426...> <200604262303.46691.gambas@...1...> Message-ID: <200604270738.48876.ronstk@...239...> On Wednesday 26 April 2006 23:03, Benoit Minisini wrote: > On Wednesday 26 April 2006 20:08, Tuxforall at ...17... wrote: > > Hello > > > > a little problem, val("&Ha000") is not -24576 :) > > > > Regards > > > > > > gambas 1.9.29 > > And what should be the result? > 40960 may be? I think he see the argument as always positive value instead signed number If argument is in hex then add 65536 if result<0 40960-65536 = -24576 :) Ron From ronstk at ...239... Thu Apr 27 07:59:01 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 07:59:01 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> Message-ID: <200604270759.01984.ronstk@...239...> On Thursday 27 April 2006 00:01, Daniel Campos wrote: > Hi: > > Current version has been tested with GTK+ 2.8.x and it probably will not > compile with previous versions. > > Daniel > > Be carefull Daniel with using the latest state of the art. It is nice to use them for private projects but not for redistributable components. Not every distro has it out of the box. The starting linux user is already happy he get gambas compiled. Forcing the upgrade of all distro components, wich may be not available is not nice for them. Special the major components as GTK and QT wich can require to recompile all other applications also. I had it in the past with curl for the net component and suse8.2 Upgrading curl from source was corupting the yast installer. It was not easy to restore the old and correct curl without Yast. Or recompile Yast myself, but to get the sources I had to use yast. I disabled the gb.net component at upgrading gambas. :( Ron From ronstk at ...239... Thu Apr 27 08:08:57 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 08:08:57 +0200 Subject: [Gambas-user] iif bug? In-Reply-To: <445000E6.4090904@...1302...> References: <445000E6.4090904@...1302...> Message-ID: <200604270808.57979.ronstk@...239...> On Thursday 27 April 2006 01:23, Oliver Etchebarne Bejarano wrote: > It looks like Gambas is evaluating both true and false parts before > doing the iif check, and I think that shouldn't be the correct behavior. > That is correct found. I agree partial on not the correct behaviour. It is however statet in the help this happens with warning about it. So far I know javascript does it too and expect java and jscript too In MS VB and PHP I know for shure it works as gambas. Or better gambas follows some standard behaviour, even when it is not logic. The Iff(cond,true:false) is equivalent to (cond) ? true:false Ron From ronstk at ...239... Thu Apr 27 08:16:06 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 08:16:06 +0200 Subject: [Gambas-user] iif bug? In-Reply-To: <44500285.5060006@...1302...> References: <445000E6.4090904@...1302...> <44500285.5060006@...1302...> Message-ID: <200604270816.06646.ronstk@...239...> On Thursday 27 April 2006 01:30, Oliver Etchebarne Bejarano wrote: > eH-- it fails with text="" or text="oliver" or anything non-numeric. > Sorry :) > > Oliver Etchebarne Bejarano wrote: > > Hey folks, hm, here you may be right. I belive, but can't check it, some returns the number zero. But strict there is no number so NULL is not absolute wrong. But you could change it from id = iif(IsNull(Val(text)), 0, Val(text)) to id = iif(NOT IsNumber(text), 0, Val("0" & text)) Ron From ronstk at ...239... Thu Apr 27 08:23:16 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 08:23:16 +0200 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <200604261036.21622.gambas@...1...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604260500.41259.ronstk@...239...> <200604261036.21622.gambas@...1...> Message-ID: <200604270823.16332.ronstk@...239...> On Wednesday 26 April 2006 10:36, Benoit Minisini wrote: > Cells have an X and Y property you can use from scrolling I think: > TableView1.ScrollY = TableView1[0, n].Y should be then TableView1.ScrollY = TableView1[n, 0].Y because help say hTableViewCell = hTableView [ Row AS Integer, Column AS Integer ] and where n is the last row or TableView1.count-1 Ron From dcamposf at ...626... Thu Apr 27 08:38:05 2006 From: dcamposf at ...626... (Daniel Campos) Date: Thu, 27 Apr 2006 08:38:05 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604270759.01984.ronstk@...239...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> <200604270759.01984.ronstk@...239...> Message-ID: <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> Hi Ron: I understand you, but both GTK+ and Curl components are alpha/beta components and won't be stable until Gambas2 is released, specially GTK+ component which is a big work. If we had here a big team working on these projects, (and lots of money to pay them :-) it would be possible to make the code necessary to replace the lacks of the previous versions of GTK+ and test the component with various versions regullary , but it is not the case at this moment. So I work in order to make possible to work with the gb.gtk component in a gnuLinex 2004/2006 system (Debian Sarge compatible, if Debian users upgrade to the gnuLinex repositories). The curl thing was a bit different: I had to change several times the libcurl version because the "multi" interface, needed to make a coherent Gambas interface, was quite buggy and unstable in the previous versions, and I didn't think it was useful for anybody to provide support for a version that surely would crash the program. If other vendors like SUSE or RedHat, or any person trying to provide support for these distributions, want to provide support to that components using prior versions they're free to send patches to me or Benoit for these components, specially now that the gb.gtk component is placed in a CVS, but I can not do all that work personally. Daniel 2006/4/27, ron : > > On Thursday 27 April 2006 00:01, Daniel Campos wrote: > > Hi: > > > > Current version has been tested with GTK+ 2.8.x and it probably will not > > compile with previous versions. > > > > Daniel > > > > > > Be carefull Daniel with using the latest state of the art. > It is nice to use them for private projects but not for > redistributable components. Not every distro has it out of the box. > > The starting linux user is already happy he get gambas compiled. > Forcing the upgrade of all distro components, wich may be not > available is not nice for them. > Special the major components as GTK and QT wich can require to > recompile all other applications also. > > I had it in the past with curl for the net component and suse8.2 > Upgrading curl from source was corupting the yast installer. > It was not easy to restore the old and correct curl without Yast. > Or recompile Yast myself, but to get the sources I had to use yast. > I disabled the gb.net component at upgrading gambas. :( > > > Ron > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sourceforge-raindog2 at ...94... Thu Apr 27 09:04:22 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Thu, 27 Apr 2006 03:04:22 -0400 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604270759.01984.ronstk@...239...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> <200604270759.01984.ronstk@...239...> Message-ID: <200604270304.23273.sourceforge-raindog2@...94...> On Thu April 27 2006 01:59, ron wrote: > Be carefull Daniel with using the latest state of the art. > It is nice to use them for private projects but not for > redistributable components. Not every distro has it out of the > box. I think it's totally fair for the development version of a project to use cutting-edge libraries. The idea is that by the time the development version becomes the stable version, they won't be so cutting-edge anymore. They'll be "the safe choice" and so will Gambas2, at that time. Those who are looking for a stable, predictable, unchanging, easy to install experience should be downloading the stable version. I think that requiring current libraries provides a useful barrier of entry to those who probably shouldn't be using an unstable pre-alpha release for their production work. Basically, someone who can't get Gtk 2.8 installed on their system may be ill-equipped to deal with a crashing or quickly changing Gambas. It's not a judgment of their character, just the way things are. Truthfully, if it weren't for my own policy of never installing software except via package management systems, I probably wouldn't even build Mandriva packages of the development versions, and as it is, I only publicise them alongside stable releases or when something really major happens. Once Gambas2 goes beta, we can start worrying about ease of installation and popularity again. Right now, I think new features and working out the bugs that come with them are more important. Rob From joe1962 at ...626... Thu Apr 27 09:08:15 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Thu, 27 Apr 2006 03:08:15 -0400 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <200510142324.38640.Karl.Reinl@...9...> References: <200510142324.38640.Karl.Reinl@...9...> Message-ID: <6c208f950604270008q5319ec46s6e906b3691ffc174@...627...> Yes, I just moved from Gambas 1.0.15 to 1.9.29 and unfortunately I had not read your email beforehand. My project's form became huge and I had to redo all the part sizes by hand. The problem now however is that it seems to be impossible to change the project's grid size. The selector is greyed out. I can change the default in the preferences but that doesn't help. I even tried manually editing the project file, but no result. I then went as far as creating a new project and adding the forms and modules to it, but still no joy. Is this a know problem or is there a fix? Regards, Joe1962 On 10/14/05, Charlie Reinl wrote: > Salut, > > I do not know if the answer is given on the list. > But me also, I'V got huge Forms (about 7 times as in gambas1) when I copied > project from gambas1 to gambas2. > > The answer is the 'Snap to grid' pixels size in Properties/Properties. > Befor moving gambas1 projects to gambas2 set it to 7, so the problem disapear. > If you don'T have no more a gambas1 on your box, you can do it in the .project > file . You have to change the value of 'Snap'. > > I think it is a bug in gambas2. The grid size is not read when change from > 'Move' to 'MoveScaled' . > > Hope that helps all who ran into that problem. > > Amicalment > Charlie > > From joe1962 at ...626... Thu Apr 27 09:14:47 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Thu, 27 Apr 2006 03:14:47 -0400 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <7259b5ae0604261501p52fd795cn2f07f05565370698@...627...> <200604270759.01984.ronstk@...239...> <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> Message-ID: <6c208f950604270014v5ad5a1f6l9ba26ef2569c589f@...627...> Well, the good news is I updated glib2, cairo, pango and gtk+2 using the Slackware current packages and am now working in Gambas 1.9.29. Thank you Daniel for your hard work. I'd help if only I knew some C or C++, but that is not the case. Regards, Joe1962 On 4/27/06, Daniel Campos wrote: > Hi Ron: > > I understand you, but both GTK+ and Curl components are alpha/beta > components and won't be stable until Gambas2 is released, specially GTK+ > component which is a big work. > > If we had here a big team working on these projects, (and lots of money to > pay them :-) it would be possible to make the code necessary to replace the > lacks of the previous versions of GTK+ and test the component with various > versions regullary , but it is not the case at this moment. So I work in > order to make possible to work with the gb.gtk component in a gnuLinex > 2004/2006 system (Debian Sarge compatible, if Debian users upgrade to the > gnuLinex repositories). > > The curl thing was a bit different: I had to change several times the > libcurl version because the "multi" interface, needed to make a coherent > Gambas interface, was quite buggy and unstable in the previous versions, and > I didn't think it was useful for anybody to provide support for a version > that surely would crash the program. > > If other vendors like SUSE or RedHat, or any person trying to provide > support for these distributions, want to provide support to that components > using prior versions they're free to send patches to me or Benoit for these > components, specially now that the gb.gtk component is placed in a CVS, but > I can not do all that work personally. > > Daniel > > 2006/4/27, ron : > > On Thursday 27 April 2006 00:01, Daniel Campos wrote: > > > Hi: > > > > > > Current version has been tested with GTK+ 2.8.x and it probably will not > > > compile with previous versions. > > > > > > Daniel > > > > > > > > > > Be carefull Daniel with using the latest state of the art. > > It is nice to use them for private projects but not for > > redistributable components. Not every distro has it out of the box. > > > > The starting linux user is already happy he get gambas compiled. > > Forcing the upgrade of all distro components, wich may be not > > available is not nice for them. > > Special the major components as GTK and QT wich can require to > > recompile all other applications also. > > > > I had it in the past with curl for the net component and suse8.2 > > Upgrading curl from source was corupting the yast installer. > > It was not easy to restore the old and correct curl without Yast. > > Or recompile Yast myself, but to get the sources I had to use yast. > > I disabled the gb.net component at upgrading gambas. :( > > > > > > Ron > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > From ronstk at ...239... Thu Apr 27 09:16:41 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 09:16:41 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <200604270759.01984.ronstk@...239...> <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> Message-ID: <200604270916.41512.ronstk@...239...> On Thursday 27 April 2006 08:38, Daniel Campos wrote: > Hi Ron: > > I understand you, but both GTK+ and Curl components are alpha/beta > components and won't be stable until Gambas2 is released, specially GTK+ > component which is a big work. > > If we had here a big team working on these projects, (and lots of money to > pay them :-) it would be possible to make the code necessary to replace the > lacks of the previous versions of GTK+ and test the component with various > versions regullary , but it is not the case at this moment. So I work in > order to make possible to work with the gb.gtk component in a gnuLinex > 2004/2006 system (Debian Sarge compatible, if Debian users upgrade to the > gnuLinex repositories). > > The curl thing was a bit different: I had to change several times the > libcurl version because the "multi" interface, needed to make a coherent > Gambas interface, was quite buggy and unstable in the previous versions, and > I didn't think it was useful for anybody to provide support for a version > that surely would crash the program. > > If other vendors like SUSE or RedHat, or any person trying to provide > support for these distributions, want to provide support to that components > using prior versions they're free to send patches to me or Benoit for these > components, specially now that the gb.gtk component is placed in a CVS, but > I can not do all that work personally. > > Daniel > Good morning Daniel, Thanks for your info. For the GTK+ I do understand it is a big work and on behalf of the users that are using it I say many thanks for making it for gambas. That you can not test it with various versions I do understand the problem you have to do it. My idea was/is to use a compile time flag to include new version specific code or replace old version code with new code. You are clever enough to think about such thing already but will have your reason not to do and I should respect that. For the curl problem I had the bad guy was SuSE to make yast to dependent on the curl version the way they did. They should have it static inside yast. I was not the only one with that problem I found in time. Please do not see my message as offence but constructive remarks. And sure we can not stay for ever at the old versions. Ron From dcamposf at ...626... Thu Apr 27 09:36:10 2006 From: dcamposf at ...626... (Daniel Campos) Date: Thu, 27 Apr 2006 09:36:10 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604270916.41512.ronstk@...239...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <200604270759.01984.ronstk@...239...> <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> <200604270916.41512.ronstk@...239...> Message-ID: <7259b5ae0604270036i47c258c1l1556206395c4824a@...627...> Hi Ron: No, of course I do not think your messages are an offence, I was just explaining my point of view, so do not worry about that :-)) The reason to not use conditional compilation is that It would provide versions of gb.gtk with unimplemented features, some of them for GTK+-2.6 , some of them for GTK+-2.4 and if I'd I start to use a possible GTK+-2.10, there would be unimplemented functions for GTK+-2.8 too. So, in that scenario, When I release an stable version there would be hundred of reports from people telling about things that do not work in their systems, and of course hundreds of replies telling that this feature does not work in that version, or that other feature does not work in other version,etc: a lot of improductive work, at the end. That way, I limit the conditional compilation to what I can assume it is impossible to unify at 100%: a X11 version, compatibility with DirectFB and a possible Windows version. A different thing would be having another programmer providing patches that make these features to work with a previous versions of GTK+. Then I wouldn't doubt in adding the needed macros to include the fixes... but just adding stubs is not the way. Daniel 2006/4/27, ron : > > On Thursday 27 April 2006 08:38, Daniel Campos wrote: > > Hi Ron: > > > > I understand you, but both GTK+ and Curl components are alpha/beta > > components and won't be stable until Gambas2 is released, specially GTK+ > > component which is a big work. > > > > If we had here a big team working on these projects, (and lots of money > to > > pay them :-) it would be possible to make the code necessary to replace > the > > lacks of the previous versions of GTK+ and test the component with > various > > versions regullary , but it is not the case at this moment. So I work > in > > order to make possible to work with the gb.gtk component in a gnuLinex > > 2004/2006 system (Debian Sarge compatible, if Debian users upgrade to > the > > gnuLinex repositories). > > > > The curl thing was a bit different: I had to change several times the > > libcurl version because the "multi" interface, needed to make a coherent > > Gambas interface, was quite buggy and unstable in the previous versions, > and > > I didn't think it was useful for anybody to provide support for a > version > > that surely would crash the program. > > > > If other vendors like SUSE or RedHat, or any person trying to provide > > support for these distributions, want to provide support to that > components > > using prior versions they're free to send patches to me or Benoit for > these > > components, specially now that the gb.gtk component is placed in a CVS, > but > > I can not do all that work personally. > > > > Daniel > > > > Good morning Daniel, > > Thanks for your info. > For the GTK+ I do understand it is a big work and on behalf of the > users that are using it I say many thanks for making it for gambas. > > That you can not test it with various versions I do understand > the problem you have to do it. > My idea was/is to use a compile time flag to include new version specific > code or replace old version code with new code. > > You are clever enough to think about such thing already but will have > your reason not to do and I should respect that. > > For the curl problem I had the bad guy was SuSE to make yast to dependent > on the curl version the way they did. They should have it static inside > yast. > I was not the only one with that problem I found in time. > > Please do not see my message as offence but constructive remarks. > And sure we can not stay for ever at the old versions. > > Ron > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benoit.minisini at ...2... Thu Apr 27 10:21:03 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 10:21:03 +0200 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <6c208f950604270008q5319ec46s6e906b3691ffc174@...627...> References: <200510142324.38640.Karl.Reinl@...9...> <6c208f950604270008q5319ec46s6e906b3691ffc174@...627...> Message-ID: <200604271021.03776.benoit.minisini@...2...> On Thursday 27 April 2006 09:08, Jose J. Rodriguez wrote: > Yes, I just moved from Gambas 1.0.15 to 1.9.29 and unfortunately I had > not read your email beforehand. My project's form became huge and I > had to redo all the part sizes by hand. The problem now however is > that it seems to be impossible to change the project's grid size. The > selector is greyed out. I can change the default in the preferences > but that doesn't help. I even tried manually editing the project file, > but no result. I then went as far as creating a new project and adding > the forms and modules to it, but still no joy. Is this a know problem > or is there a fix? > > Regards, > Joe1962 > In the development version, the grid size is always half the height of the default font. The control initial coordinates are ajusted according to it, i.e. if you use a bigger font, your form will become bigger too. Problems come when you open a project made with the stable version with the development version IDE... Sorry for the inconvenience! Regards, -- Benoit Minisini From benoit.minisini at ...2... Thu Apr 27 10:21:25 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 10:21:25 +0200 Subject: [Gambas-user] How to scroll tableview from app In-Reply-To: <200604270823.16332.ronstk@...239...> References: <1441.202.154.41.227.1145928758.squirrel@...1425...> <200604261036.21622.gambas@...1...> <200604270823.16332.ronstk@...239...> Message-ID: <200604271021.25189.benoit.minisini@...2...> On Thursday 27 April 2006 08:23, ron wrote: > On Wednesday 26 April 2006 10:36, Benoit Minisini wrote: > > Cells have an X and Y property you can use from scrolling I think: > > TableView1.ScrollY = TableView1[0, n].Y > > should be then > TableView1.ScrollY = TableView1[n, 0].Y > > because help say > hTableViewCell = hTableView [ Row AS Integer, Column AS Integer ] > > and where n is the last row or TableView1.count-1 > > Ron > Yep! -- Benoit Minisini From benoit.minisini at ...2... Thu Apr 27 10:23:32 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 10:23:32 +0200 Subject: [Gambas-user] VAL() In-Reply-To: <200604270738.48876.ronstk@...239...> References: <15948.1146074936@...1426...> <200604262303.46691.gambas@...1...> <200604270738.48876.ronstk@...239...> Message-ID: <200604271023.32502.benoit.minisini@...2...> On Thursday 27 April 2006 07:38, ron wrote: > On Wednesday 26 April 2006 23:03, Benoit Minisini wrote: > > On Wednesday 26 April 2006 20:08, Tuxforall at ...17... wrote: > > > Hello > > > > > > a little problem, val("&Ha000") is not -24576 :) > > > > > > Regards > > > > > > > > > gambas 1.9.29 > > > > And what should be the result? > > 40960 may be? > > I think he see the argument as always positive value instead signed number > > If argument is in hex then add 65536 if result<0 > 40960-65536 = -24576 :) > > Ron > &HA000 is a negative number. Use &HA000& to get a positive one. See http://gambasdoc.org/help/cat/constants -- Benoit Minisini From benoit.minisini at ...2... Thu Apr 27 10:32:08 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 10:32:08 +0200 Subject: [Gambas-user] iif bug? In-Reply-To: <445000E6.4090904@...1302...> References: <445000E6.4090904@...1302...> Message-ID: <200604271032.08147.benoit.minisini@...2...> On Thursday 27 April 2006 01:23, Oliver Etchebarne Bejarano wrote: > Hey folks, > > I'm trying this: > > ------ > > dim id as integer > dim text as string > > text = "1" > id = iif(IsNull(Val(text)), 0, Val(text)) > > ------ > > Obviously, I want to obtain the numeric value of "text", or 0 if it is > not a valid number. But that code fails with > > ERROR: Type mismatch: wanted Integer, got Null instead. > > It looks like Gambas is evaluating both true and false parts before > doing the iif check, and I think that shouldn't be the correct behavior. > > btw I'm trying this on gambas 1.9.29 > > HTH IIf() is a function, and so evaluates all its arguments. But, moreover, the datatype of its two last arguments must be the same, because the interpreter code optimizer requires that internal functions return always the same datatype. Actually, I could force Iif() to return a Variant, but I didn't want :-) Regards, -- Benoit Minisini From benoit.minisini at ...2... Thu Apr 27 10:34:25 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 10:34:25 +0200 Subject: [Gambas-user] iif bug? In-Reply-To: <200604270808.57979.ronstk@...239...> References: <445000E6.4090904@...1302...> <200604270808.57979.ronstk@...239...> Message-ID: <200604271034.25340.benoit.minisini@...2...> On Thursday 27 April 2006 08:08, ron wrote: > On Thursday 27 April 2006 01:23, Oliver Etchebarne Bejarano wrote: > > It looks like Gambas is evaluating both true and false parts before > > doing the iif check, and I think that shouldn't be the correct behavior. > > That is correct found. > I agree partial on not the correct behaviour. > It is however statet in the help this happens with warning about it. > > So far I know javascript does it too and expect java and jscript too > In MS VB and PHP I know for shure it works as gambas. > Or better gambas follows some standard behaviour, even when it is not > logic. > > The Iff(cond,true:false) is equivalent to (cond) ? true:false > Not at all! IIf evaluates all its arguments. There is no equivalent of '(cond) ? true : false' in Gambas. Regards, -- Benoit Minisini From ronstk at ...239... Thu Apr 27 14:59:03 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 14:59:03 +0200 Subject: [Gambas-user] prb:event programming Message-ID: <200604271459.03607.ronstk@...239...> I have a form Fnavbar 4 buttons in group ------------------------- ' Gambas class file EVENT DoNavigation(sBtnTag AS String) PUBLIC SUB _new() ME.Show timernavbtn = "" TimerLock = FALSE END PUBLIC SUB Navigation_Click() DIM ta AS String ta = LAST.tag PRINT "you clicked:" & ta <-- this works correct RAISE DoNavigation("ta") <-- does not raise event END ' below works for read/write PRIVATE SUB Position_write(Position AS Integer) txtPos.Text = Position IF position = 4 THEN RAISE DoNavigation("pre") <-- this works not END PRIVATE FUNCTION Position_read() AS Integer RETURN txtPos.Text END PRIVATE SUB Total_write(Total AS Integer) txtTotal.Text = Total END PRIVATE FUNCTION Total_read() AS Integer RETURN txtTotal.Text END ---------------------------------- the main form PRIVATE NavBar AS Fnavbar STATIC PUBLIC FUNCTION Run() AS Boolean DIM hForm AS Form hForm = NEW Form1 RETURN hForm.ShowModal() END PUBLIC SUB _new() NavBar = NEW Fnavbar AS "Browser" END PUBLIC SUB Browser_DoNavigation(sBtnTag AS String) TimerNavBtn = "" DoNavigation(sBtnTag) END --------------------------------- I found an example on a german wiki and created that one. http://de.wikibooks.org/wiki/Gambas:_Event at the bottom the example. The event works here but it is a class that raise the event. I try it from a form class. Where to look for wrong thing? From timothy.marshal-nichols at ...247... Thu Apr 27 16:07:43 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Thu, 27 Apr 2006 15:07:43 +0100 Subject: [Gambas-user] Drawing In-Reply-To: Message-ID: Converting a Drawing to a image/picture is easy. Here is code that draws a Drawing on a Picture and saves it in one of the image file types supported by Gambas. ' Convert the drawing to an picture and save it PRIVATE SUB SaveDrawing(drw AS Drawing) DIM savePicture AS Picture Dialog.Filter = FileFilter() IF Dialog.SaveFile() THEN RETURN IF Exist(Dialog.Path) THEN IF Message.Warning("The file \n\n\t" & Dialog.Path & "\n\nalready exists. Do you want to overwrite it?", "Yes", "Cancel") > 1 THEN RETURN END IF END IF savePicture = NEW Picture(drw.Width, drw.Height, FALSE) Draw.Begin(savePicture) Draw.BackColor = Color.White Draw.ForeColor = Color.White Draw.FillColor = Color.White Draw.FillStyle = Fill.Solid Draw.Rect(0, 0, savePicture.Width, savePicture.Height) Draw.Drawing(drw, 0, 0) Draw.End savePicture.Save(Dialog.Path) CATCH Message.Warning("Could not save image\n\n\t" & Dialog.Path & "\n\n" & ERROR.Text) END PRIVATE FUNCTION FileFilter() AS String[] DIM filter AS NEW String[] filter.Add("Portable Network Graphics (*.png)") filter.Add("Joint Photographic Experts Group (*.jpeg *.jpg)") filter.Add("Windows Bitmap (*.bmp)") filter.Add("Graphics Interchange Format (*.gif)") filter.Add("X PixMap (*.xpm)") RETURN filter END Note that I clear the new Picture myself. You could try the Clear() method on the Picture. But I found this method works best. I want to make sure the background to the drawing is white. Look in the help for the distinction between a Picture and a Image. You can convert between them easily: newPicture = oldImage.Picture newImage = oldPicture.Image As for getting the content of a DrawingArea. It can be done with the Grab() method which return a Picture. PUBLIC SUB ButtonSaveDrawingArea_Click() DIM savePicture AS Picture Dialog.Filter = FileFilter() IF Dialog.SaveFile() THEN RETURN IF Exist(Dialog.Path) THEN IF Message.Warning("The file \n\n\t" & Dialog.Path & "\n\nalready exists. Do you want to overwrite it?", "Yes", "Cancel") > 1 THEN RETURN END IF END IF savePicture = DrawingAreaSVG.Grab() savePicture.Save(Dialog.Path) CATCH Message.Warning("Could not save image\n\n\t" & Dialog.Path & "\n\n" & ERROR.Text) END But I would not use this. Grab() only returns the visible area of the DrawingArea so you might not get what you expect. In any case you should not need it. Thanks 8-{)} Timothy Marshal-Nichols -----Original Message----- From: gambas-user-admin at lists.sourceforge.net [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier romero Sent: Wednesday, 26 April 2006 14:51 To: gambas-user at lists.sourceforge.net Subject: RE: Re: [Gambas-user] Drawing Thanks very much for the help. I have an aditional question, is possible to convert a Drawing or a DrawingArea into a Image or Picture? Regards Javier ---------------------------------------- > From: timothy.marshal-nichols at ...247... > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > Date: Wed, 26 Apr 2006 09:39:23 +0100 > > > > You must be using an older version of Gambas. The *= is just multiplication. > Try: > > imageWidth = imageWidth * scaleIsotropic > imageHeight = imageHeight * scaleIsotropic > > this the same code in long hand. > > The PrintImage code was to show you how to use the Resolution of the Printer > and Desktop to find the required image/drawing size. Its just I had code to > hand using a image that I knew worked. You can still Draw a Drawing. > > This is what you might get: > > PRIVATE SUB PrintDrawing(drw AS Drawing) > DIM drawingWidth AS Integer > DIM drawingHeight AS Integer > DIM scaleIsotropic AS Float > ' Display printer dialog > IF Printer.Setup() THEN RETURN > INC Application.Busy > ' Get drawing size for the printer resolution > drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution > drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution > ' Adjust drawing size if it does not fit on the printer page > IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN > ' Scale Isotropic, keep aspect ratio of the image > scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / > drawingHeight) > drawingWidth *= scaleIsotropic > drawingHeight *= scaleIsotropic > END IF > 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width > 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height > ' Draw drawing centred on printer page > Draw.Begin(Printer) > 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, (Printer.Height - > drawingHeight) / 2, drawingWidth, drawingHeight) > Draw.End > DEC Application.Busy > END > > Two points: > > 1. Convert the *= again! > > 2. On my system this still only prints the Drawing at the old resolution. > You can see if you uncomment the Draw.Rect line that the calculation for the > drawing size is correct. By setting the width and height the help says the > drawing should be scaled. I think this has been fixed with later versions of > Gambas as I know there has been some work the SVG code. (I was going to > upgrade after installing SUES 10.1.) > > Also the scaling of a Drawing when drawing on a DrawingArea does not work - > so it must be a problem with the Draw.Drawing method. If this method has not > been fixed then you will never be able to print good image at the right > size. > > Thanks > > 8-{)} Timothy Marshal-Nichols > > > > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > romero > Sent: Tuesday, 25 April 2006 19:24 > To: gambas-user at lists.sourceforge.net > Subject: RE: Re: [Gambas-user] Drawing > > > I try to do that, but in > > imageWidth *= scaleIsotropic > imageHeight *= scaleIsotropic > > the interpreter sends an error. > there is any error in there?. > > Also i need convert a drawing area into a image, how i can do that? > > Thanks > Javier > ---------------------------------------- > > From: timothy.marshal-nichols at ...247... > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > Date: Mon, 24 Apr 2006 17:57:08 +0100 > > > > > > This example shows how to print an image centred on the page. In includes > > code to scale an image for the printer resolution. If the image is the to > > large for the printer height or width resizes it to fit on the page - > > keeping the aspect ratio. > > > > You will need something like this only with a drawing. > > > > PRIVATE SUB PrintImage(img AS Image) > > DIM imageToPrint AS Image > > DIM imageWidth AS Integer > > DIM imageHeight AS Integer > > DIM scaleIsotropic AS Float > > ' Dispaly printer dialog > > IF Printer.Setup() THEN RETURN > > INC Application.Busy > > ' Get image size for the printer resolution > > imageWidth = (img.Width * Printer.Resolution) / Desktop.Resolution > > imageHeight = (img.Height * Printer.Resolution) / Desktop.Resolution > > ' Adjust image size if it does not fit on the printer page > > IF imageWidth > Printer.Width OR imageHeight > Printer.Height THEN > > ' Scale Isotropic, keep aspect ratio of the image > > scaleIsotropic = Min(Printer.Width / imageWidth, Printer.Height / > > imageHeight) > > imageWidth *= scaleIsotropic > > imageHeight *= scaleIsotropic > > END IF > > 'PRINT "Width: " & imageToPrint, Printer.Width > > 'PRINT "Height: " & imageToPrint, Printer.Height > > ' Scale image > > imageToPrint = img.Stretch(imageWidth, imageHeight, TRUE) > > ' Draw image centered on printer page > > Draw.Begin(Printer) > > Draw.Image(imageToPrint, (Printer.Width - imageWidth) / 2, > > (Printer.Height - imageHeight) / 2) > > Draw.End > > DEC Application.Busy > > END > > > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > > > -----Original Message----- > > From: gambas-user-admin at lists.sourceforge.net > > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of javier > > romero > > Sent: Monday, 24 April 2006 14:37 > > To: gambas-user at lists.sourceforge.net > > Subject: RE: Re: [Gambas-user] Drawing > > > > > > Ok, thanks, its works but the print is very small, i try scaling with > this: > > > > draw.Begin(printer) > > draw.drawing(p1,350,350, Printer.Width, Printer.Height) > > draw.End > > but dosent works the print is the same, little, i try then with > > > > draw.Begin(printer) > > draw.drawing(p1,350,350, p1.Width, p1.Height) > > draw.End > > and the same, very little, in both dont change > > > > How i scale? > > > > sorry about my very bad english > > > > Regards > > Javier > > ---------------------------------------- > > > From: christian.faurebouvard at ...357... > > > To: gambas-user at lists.sourceforge.net > > > Subject: Re: [Gambas-user] Drawing > > > Date: Sat, 22 Apr 2006 17:50:15 -0400 > > > > > > El Viernes 21 Abril 2006 09:48, javier romero escribi?: > > > > PUBLIC p1 AS Drawing > > > > PUBLIC pag AS DrawingArea > > > > > > > > PUBLIC SUB _new() > > > > p1 = NEW Drawing > > > > draw.Begin(p1) > > > > draw.Text("Hello", 0, 0) > > > > draw.End > > > > > > > > END > > > > > > > > PUBLIC SUB Form_Open() > > > > > > > > pag = NEW DrawingArea(sv1) > > > > > > > > pag.Cached = TRUE > > > > pag.Clear > > > > pag.BackColor = color.White > > > > pag.Width = printer.Width > > > > pag.Height = printer.Height > > > > pag.Border = 1 > > > > draw.Begin(pag) > > > > draw.Drawing(p1, 0, 0) > > > > draw.End > > > > ' This works OK > > > > pag.Visible = TRUE > > > > > > > > END > > > > > > > > PUBLIC SUB Button1_Click() > > > > > > > > draw.Begin(printer) > > > > draw.drawing(p1,0,0, pag.Width, pag.Height) > > > > draw.End > > > > ' This doesn't works > > > > END > > > > > > Hi Javier, > > > > > > Some printers can't print in (0,0) > > > Try > > > draw.drawing(p1, 350, 350) > > > > > > it work, but very small, need to be scaled. > > > > > > Regards, > > > Christian > > > > > > > > > ------------------------------------------------------- > > > Using Tomcat but need to do more? Need to support web services, > security? > > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > > _______________________________________________ > > > Gambas-user mailing list > > > Gambas-user at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > _________________________________________________________________ > > Descarga gratis la Barra de Herramientas de MSN > > > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > > > > > > ------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Gambas-user mailing list > > Gambas-user at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > _________________________________________________________________ > Descarga gratis la Barra de Herramientas de MSN > http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. > hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user _________________________________________________________________ Descarga gratis la Barra de Herramientas de MSN http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www. hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642 _______________________________________________ Gambas-user mailing list Gambas-user at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user From benoit.minisini at ...2... Thu Apr 27 18:02:33 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 18:02:33 +0200 Subject: [Gambas-user] prb:event programming In-Reply-To: <200604271459.03607.ronstk@...239...> References: <200604271459.03607.ronstk@...239...> Message-ID: <200604271802.34127.benoit.minisini@...2...> On Thursday 27 April 2006 14:59, ron wrote: > I have a form Fnavbar > > 4 buttons in group > ------------------------- > ' Gambas class file > EVENT DoNavigation(sBtnTag AS String) > > PUBLIC SUB _new() > ME.Show > timernavbtn = "" > TimerLock = FALSE > END > > PUBLIC SUB Navigation_Click() > DIM ta AS String > ta = LAST.tag > PRINT "you clicked:" & ta <-- this works correct > RAISE DoNavigation("ta") <-- does not raise event > END > > ' below works for read/write > PRIVATE SUB Position_write(Position AS Integer) > txtPos.Text = Position > IF position = 4 THEN RAISE DoNavigation("pre") <-- this works not > END > PRIVATE FUNCTION Position_read() AS Integer > RETURN txtPos.Text > END > PRIVATE SUB Total_write(Total AS Integer) > txtTotal.Text = Total > END > PRIVATE FUNCTION Total_read() AS Integer > RETURN txtTotal.Text > END > ---------------------------------- > > the main form > > PRIVATE NavBar AS Fnavbar > > STATIC PUBLIC FUNCTION Run() AS Boolean > > DIM hForm AS Form > > hForm = NEW Form1 > RETURN hForm.ShowModal() > > END > > PUBLIC SUB _new() > NavBar = NEW Fnavbar AS "Browser" > END > > PUBLIC SUB Browser_DoNavigation(sBtnTag AS String) > TimerNavBtn = "" > DoNavigation(sBtnTag) > END > > --------------------------------- > I found an example on a german wiki and created that one. > http://de.wikibooks.org/wiki/Gambas:_Event > at the bottom the example. > > The event works here but it is a class that raise the event. > I try it from a form class. > > Where to look for wrong thing? > You must tell which version of Gambas you use, and send me your project so that I can check what happens, and eventually fix the bug if there is a bug! Regards, -- Benoit Minisini From leonardo at ...1237... Thu Apr 27 18:30:20 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Thu, 27 Apr 2006 18:30:20 +0200 Subject: [Gambas-user] Errors compiling 1.9.29 In-Reply-To: <200604270732.47657.ronstk@...239...> References: <444E4407.4010100@...1237...> <200604252123.13971.ronstk@...239...> <444FA3D0.6060907@...1237...> <200604270732.47657.ronstk@...239...> Message-ID: <4450F19C.6010506@...1237...> ron ha scritto: > On Wednesday 26 April 2006 18:46, Leonardo Miliani wrote: >> Thank you for your interest :-) >> > > --8<-- > >>> Ron >> I tried to upgrade libiconv to 1.9.x but I get same errors. >> Searching in my system for libiconv files I found that I have a >> libiconv_plug file. Gambas compiler says that it doesn't find >> "libiconv_open" and "libiconv_close" files. Maybe this is the problem? >> How can I get these 2 files? >> Which version of libiconv has been used to compile Gambas 1.9.29? Where >> can I find it? >> > > hm, i just found I do not have libiconv at all installed. > I have only program iconv in /usr/bin. > iconvconfig -V returns *iconvconfig (GNU libc) 2.3.3* > Maybe a try with --with-libiconv=no or something to find > if there are more problems. Thanks a lot :-) It worked... I didn't have much time to try the new compiled version but it seems that everything works... I'll inform you in case of errors. -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From sourceforge-raindog2 at ...94... Thu Apr 27 18:45:26 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Thu, 27 Apr 2006 12:45:26 -0400 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604270916.41512.ronstk@...239...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <7259b5ae0604262338g785f64ccx8d81257794253ec7@...627...> <200604270916.41512.ronstk@...239...> Message-ID: <200604271245.26543.sourceforge-raindog2@...94...> On Thu April 27 2006 03:16, ron wrote: > My idea was/is to use a compile time flag to include new > version specific code or replace old version code with new > code. I did have a patch for Mandrake 10.1's Gambas packages at one point to get rid of the Gtk 2.6 specific code, but eventually it got to be too much and I just stopped building gb.gtk for Mandrake 10.1. In my own experience, sometimes you don't even realize you're using a library feature that won't compile under older versions of the library. Not all documentation indicates in which version a function or property was exposed.... Rob From sourceforge-raindog2 at ...94... Thu Apr 27 19:07:31 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Thu, 27 Apr 2006 13:07:31 -0400 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <7259b5ae0604270036i47c258c1l1556206395c4824a@...627...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <200604270916.41512.ronstk@...239...> <7259b5ae0604270036i47c258c1l1556206395c4824a@...627...> Message-ID: <200604271307.31660.sourceforge-raindog2@...94...> On Thu April 27 2006 03:36, Daniel Campos wrote: > So, in that scenario, When I release an stable version there > would be hundred of reports from people telling about things > that do not work in their systems, and of course hundreds of > replies telling that this feature does not work in that > version, or that other feature does not work in other > version,etc: a lot of improductive work, at the end. Well, there's always something like #if GTK_CHECK_VERSION(2,8,0) do_something(); #else fprintf(stderr, "Warning, your GTK is old and busted, please don't complain about do_something() not working :-)\n"); #endif but I guess that wouldn't help with people who run Gambas from their window manager's menu and never see debug output. Rob From ronstk at ...239... Thu Apr 27 19:26:55 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 19:26:55 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604270304.23273.sourceforge-raindog2@...94...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <200604270759.01984.ronstk@...239...> <200604270304.23273.sourceforge-raindog2@...94...> Message-ID: <200604271926.55291.ronstk@...239...> On Thursday 27 April 2006 09:04, Rob Kudla wrote: > On Thu April 27 2006 01:59, ron wrote: > > Be carefull Daniel with using the latest state of the art. > > It is nice to use them for private projects but not for > > redistributable components. Not every distro has it out of the > > box. > > I think it's totally fair for the development version of a > project to use cutting-edge libraries. The idea is that by the > time the development version becomes the stable version, they > won't be so cutting-edge anymore. They'll be "the safe choice" > and so will Gambas2, at that time. I have to confess, Daniel noted this too, beside the testing, but your phrase is more clear to me. Allow me to be optimistic, I hope when my program is ready the cutting edge gambas2 is the stable version too :) In effect I do the same as Daniel does, so I have to slap myself doing the same :) > > Those who are looking for a stable, predictable, unchanging, easy > to install experience should be downloading the stable version. True > I think that requiring current libraries provides a useful > barrier of entry to those who probably shouldn't be using an > unstable pre-alpha release for their production work. Im afraid many users of gambas2 do not realize it or do not care because it's a hobby. > Basically, someone who can't get Gtk 2.8 installed on their > system may be ill-equipped to deal with a crashing or quickly > changing Gambas. It's not a judgment of their character, just > the way things are. > > Truthfully, if it weren't for my own policy of never installing > software except via package management systems, I probably > wouldn't even build Mandriva packages of the development > versions, and as it is, I only publicise them alongside stable > releases or when something really major happens. Once Gambas2 > goes beta, we can start worrying about ease of installation and > popularity again. > Right now, I think new features and working > out the bugs that come with them are more important. Again simple true. > > Rob Thanks Rob, your light is shinning here. > Greets from Holland, Ron PS Popularity is realy growing, I remeber with goolge getting the fish pages but now I can't find gambas as fish if I do not ask for fish :):) From ronstk at ...239... Thu Apr 27 19:59:11 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 19:59:11 +0200 Subject: [Gambas-user] GTK component in 1.9.29 In-Reply-To: <200604271245.26543.sourceforge-raindog2@...94...> References: <6c208f950604261431p56b92dd8h44435f61d8dbad13@...627...> <200604270916.41512.ronstk@...239...> <200604271245.26543.sourceforge-raindog2@...94...> Message-ID: <200604271959.11958.ronstk@...239...> On Thursday 27 April 2006 18:45, Rob Kudla wrote: > On Thu April 27 2006 03:16, ron wrote: > > My idea was/is to use a compile time flag to include new > > version specific code or replace old version code with new > > code. > > I did have a patch for Mandrake 10.1's Gambas packages at one > point to get rid of the Gtk 2.6 specific code, but eventually it > got to be too much and I just stopped building gb.gtk for > Mandrake 10.1. > > In my own experience, sometimes you don't even realize you're > using a library feature that won't compile under older versions > of the library. Or even newer. Same experience/realize for me. > Not all documentation indicates in which > version a function or property was exposed.... Bad guys if they do not documenting :) Just like me. :( > > Rob > Benoit must have a hard job to keep al running, and as I found from history for 4 years now. Ron From maillists at ...1367... Thu Apr 27 20:10:52 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Thu, 27 Apr 2006 11:10:52 -0700 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <200604271021.03776.benoit.minisini@...2...> References: <200510142324.38640.Karl.Reinl@...9...> <6c208f950604270008q5319ec46s6e906b3691ffc174@...627...> <200604271021.03776.benoit.minisini@...2...> Message-ID: <1146161452.30002.1.camel@...1368...> If Gambas 2 becomes stable I assume I'll need to recompile my programs to work with it's runtime. Will I have a considerable number of problems in attempting to do so? Jeff On Thu, 2006-04-27 at 10:21 +0200, Benoit Minisini wrote: > > In the development version, the grid size is always half the height of the > default font. > > The control initial coordinates are ajusted according to it, i.e. if you use a > bigger font, your form will become bigger too. > > Problems come when you open a project made with the stable version with the > development version IDE... > > Sorry for the inconvenience! > > Regards, > -- .^. /V\ /( )\ ^^-^^ Linux Advocate From ronstk at ...239... Thu Apr 27 20:16:07 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 20:16:07 +0200 Subject: [Gambas-user] iif bug? In-Reply-To: <200604271034.25340.benoit.minisini@...2...> References: <445000E6.4090904@...1302...> <200604270808.57979.ronstk@...239...> <200604271034.25340.benoit.minisini@...2...> Message-ID: <200604272016.07310.ronstk@...239...> On Thursday 27 April 2006 10:34, Benoit Minisini wrote: > > The Iff(cond,true:false) is equivalent to (cond) ? true:false > > > > Not at all! IIf evaluates all its arguments. There is no equivalent of > '(cond) ? true : false' in Gambas. Sorry but it was not my intention to say the second exists in gambas. It is a function in PHP I know and does the same for evaluating the true/false condition (as I remember correct). Sorry for the incredible misguide. Ron From joe1962 at ...626... Thu Apr 27 20:41:14 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Thu, 27 Apr 2006 14:41:14 -0400 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <200604271021.03776.benoit.minisini@...2...> References: <200510142324.38640.Karl.Reinl@...9...> <6c208f950604270008q5319ec46s6e906b3691ffc174@...627...> <200604271021.03776.benoit.minisini@...2...> Message-ID: <6c208f950604271141r273ade8eq614e1db1eeeaafd9@...627...> Well, I found to my chagrin that you can't share projects (or forms) between gambas 1 and 2, lol. The forms freak out, widgets go all over the place apart from the size issue (specially when going back to gambas 1, heh heh). Also, when using Daniel's gtk component, everything (form included) grows in size about 1.5 times when run, compared to design mode. Benoit, when you say the default font, do you mean the form's font size, or the IDE's font size? Another problem is that many properties say "Incorrect property value" when trying to change them in the IDE, even though they work when coded on Form load event. I think I'll have go back to 1.0.15 and try to fit qt in the initrd for the installer we're working on. Is it possible to use a gambas app with qt-embedded, or even to link gbx statically with qt or qt-embedded? Regards, Joe1962 On 4/27/06, Benoit Minisini wrote: > On Thursday 27 April 2006 09:08, Jose J. Rodriguez wrote: > > Yes, I just moved from Gambas 1.0.15 to 1.9.29 and unfortunately I had > > not read your email beforehand. My project's form became huge and I > > had to redo all the part sizes by hand. The problem now however is > > that it seems to be impossible to change the project's grid size. The > > selector is greyed out. I can change the default in the preferences > > but that doesn't help. I even tried manually editing the project file, > > but no result. I then went as far as creating a new project and adding > > the forms and modules to it, but still no joy. Is this a know problem > > or is there a fix? > > > > Regards, > > Joe1962 > > > > In the development version, the grid size is always half the height of the > default font. > > The control initial coordinates are ajusted according to it, i.e. if you use a > bigger font, your form will become bigger too. > > Problems come when you open a project made with the stable version with the > development version IDE... > > Sorry for the inconvenience! > From ronstk at ...239... Thu Apr 27 21:42:35 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 21:42:35 +0200 Subject: [Gambas-user] prb:event programming In-Reply-To: <200604271802.34127.benoit.minisini@...2...> References: <200604271459.03607.ronstk@...239...> <200604271802.34127.benoit.minisini@...2...> Message-ID: <200604272142.35391.ronstk@...239...> On Thursday 27 April 2006 18:02, Benoit Minisini wrote: ---8<--- > > You must tell which version of Gambas you use, and send me your project so > that I can check what happens, and eventually fix the bug if there is a bug! > > Regards, > Gambas version 1.9.26 but at home .28 > PUBLIC SUB _new() > ? NavBar = NEW Fnavbar AS "Browser" > END I am afraid I had to add here a object.Attach("NavBar",ME,"Browser") > PUBLIC SUB _new() > NavBar = NEW Fnavbar AS "Browser" Object.Attach("NavBar",ME,"Browser") > END The code of the project was in previous message, I stripped a copy of the orginal project for checking, this was leftover. The wiki example uses a class that raise the event, in my case it is a form opened by the main Form1. Have redone at home during this mail. It works now here(.28), I hope next week at work(.26) too. Both Object.Attach(NavBar,ME,"Browser") and Object.Attach(FNavBar,ME,"Browser") do work now. However the logic tell me I must use the handle set with the New FNavBar. :) Is the Object.Atach a minimum requirement for the event management in forms ? As I go in history I did not do it in the 0.xx time and first stable versions. Yes I miss from 1.0.3 and up to now and the 1.9.10 or so to 1.9.24 Have been almost a year not active with gambas and programming in general. TIA from, Ron From sourceforge-raindog2 at ...94... Thu Apr 27 22:06:48 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Thu, 27 Apr 2006 16:06:48 -0400 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <6c208f950604271141r273ade8eq614e1db1eeeaafd9@...627...> References: <200510142324.38640.Karl.Reinl@...9...> <200604271021.03776.benoit.minisini@...2...> <6c208f950604271141r273ade8eq614e1db1eeeaafd9@...627...> Message-ID: <200604271606.49508.sourceforge-raindog2@...94...> On Thu April 27 2006 14:41, Jose J. Rodriguez wrote: > fit qt in the initrd for the installer we're working on. Is > it possible to use a gambas app with qt-embedded, or even to > link gbx statically with qt or qt-embedded? I spent a little time trying to get this to work, but it's not gbx you need to statically link, it's gb.qt.so. My linker-fu is not strong enough for me to have figured it out. I'm not even sure that qt-embedded has everything gb.qt needs to work. Rob > > On 4/27/06, Benoit Minisini wrote: > > On Thursday 27 April 2006 09:08, Jose J. Rodriguez wrote: > > > Yes, I just moved from Gambas 1.0.15 to 1.9.29 and > > > unfortunately I had not read your email beforehand. My > > > project's form became huge and I had to redo all the part > > > sizes by hand. The problem now however is that it seems to > > > be impossible to change the project's grid size. The > > > selector is greyed out. I can change the default in the > > > preferences but that doesn't help. I even tried manually > > > editing the project file, but no result. I then went as > > > far as creating a new project and adding the forms and > > > modules to it, but still no joy. Is this a know problem or > > > is there a fix? > > > > > > Regards, > > > Joe1962 > > > > In the development version, the grid size is always half the > > height of the default font. > > > > The control initial coordinates are ajusted according to it, > > i.e. if you use a bigger font, your form will become bigger > > too. > > > > Problems come when you open a project made with the stable > > version with the development version IDE... > > > > Sorry for the inconvenience! > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web > services, security? Get stuff done quickly with pre-integrated > technology to make your job easier Download IBM WebSphere > Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat >1642 _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user From benoit.minisini at ...2... Thu Apr 27 22:46:23 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Thu, 27 Apr 2006 22:46:23 +0200 Subject: [Gambas-user] prb:event programming In-Reply-To: <200604272142.35391.ronstk@...239...> References: <200604271459.03607.ronstk@...239...> <200604271802.34127.benoit.minisini@...2...> <200604272142.35391.ronstk@...239...> Message-ID: <200604272246.23382.benoit.minisini@...2...> On Thursday 27 April 2006 21:42, ron wrote: > On Thursday 27 April 2006 18:02, Benoit Minisini wrote: > > ---8<--- > > > You must tell which version of Gambas you use, and send me your project > > so that I can check what happens, and eventually fix the bug if there is > > a bug! > > > > Regards, > > Gambas version 1.9.26 but at home .28 > > > PUBLIC SUB _new() > > ? NavBar = NEW Fnavbar AS "Browser" > > END > > I am afraid I had to add here a object.Attach("NavBar",ME,"Browser") > > > PUBLIC SUB _new() > > NavBar = NEW Fnavbar AS "Browser" > > Object.Attach("NavBar",ME,"Browser") > > > END > > The code of the project was in previous message, I stripped a copy of > the orginal project for checking, this was leftover. > > The wiki example uses a class that raise the event, > in my case it is a form opened by the main Form1. > > Have redone at home during this mail. > It works now here(.28), I hope next week at work(.26) too. > > Both Object.Attach(NavBar,ME,"Browser") and > Object.Attach(FNavBar,ME,"Browser") do work now. > However the logic tell me I must use the handle set with the New FNavBar. > :) > > Is the Object.Atach a minimum requirement for the event management in forms > ? As I go in history I did not do it in the 0.xx time and first stable > versions. Yes I miss from 1.0.3 and up to now and the 1.9.10 or so to > 1.9.24 Have been almost a year not active with gambas and programming in > general. > > > TIA from, > > Ron > Sorry, I didn't read well what you wrote. I have problems at the moment that distract me... Forms are always their own event observer, even if you inherits them. So you have to use Object.Attach if you want to catch their events. I did this way so that Forms in Gambas behave the same way as in VB! Regards, -- Benoit Minisini From ronstk at ...239... Thu Apr 27 23:26:31 2006 From: ronstk at ...239... (ron) Date: Thu, 27 Apr 2006 23:26:31 +0200 Subject: [Gambas-user] prb:event programming In-Reply-To: <200604272246.23382.benoit.minisini@...2...> References: <200604271459.03607.ronstk@...239...> <200604272142.35391.ronstk@...239...> <200604272246.23382.benoit.minisini@...2...> Message-ID: <200604272326.31866.ronstk@...239...> OK, best wishes. Thanks for confirming object.atach requirement. I can go on next week with more aknowledge. Ron From joe1962 at ...626... Fri Apr 28 03:02:58 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Thu, 27 Apr 2006 21:02:58 -0400 Subject: [Gambas-user] Huge Forms, when moving gambas1 projects to gambas2 In-Reply-To: <200604271606.49508.sourceforge-raindog2@...94...> References: <200510142324.38640.Karl.Reinl@...9...> <200604271021.03776.benoit.minisini@...2...> <6c208f950604271141r273ade8eq614e1db1eeeaafd9@...627...> <200604271606.49508.sourceforge-raindog2@...94...> Message-ID: <6c208f950604271802n7ddef15bj1c9e9931ae4f8c87@...627...> On 4/27/06, Rob Kudla wrote: > On Thu April 27 2006 14:41, Jose J. Rodriguez wrote: > > fit qt in the initrd for the installer we're working on. Is > > it possible to use a gambas app with qt-embedded, or even to > > link gbx statically with qt or qt-embedded? > > I spent a little time trying to get this to work, but it's not > gbx you need to statically link, it's gb.qt.so. You're right of course :) . > My linker-fu isnot strong enough for me to have figured it out. > I'm not even sure that qt-embedded has everything gb.qt needs > to work. > Hmm... good question. Thanks for sharing your experiences, Rob. Regards, Joe1962 From christian at ...980... Fri Apr 28 09:44:47 2006 From: christian at ...980... (Christian E. =?iso-8859-1?q?L=F3pez?= Finnberg) Date: Fri, 28 Apr 2006 08:44:47 +0100 Subject: [Gambas-user] imprimir tickets desde gambas In-Reply-To: References: Message-ID: <200604280844.47513.christian@...980...> Are you repliying yourself? ;-) ? Te est?s contestando a t? mismo ? ;-) El Mi?rcoles, 26 de Abril de 2006 18:53, Jose Cubillo escribi?: > Eso depende de que impresora este utilizando, yo he utilizado una de datmax > y otra de zebra y es muy facil, con los datos de la impresora como son la > teperatura, los espacios entre cada tiquete y otros valores y como minimo el > codigo de barras a generar se crea un archivo txt y luego se lo envia al > puerto en donde esta conectada y ya tienes funcionando la impresora de > tiquetes, yo he impreso desde un tiquete hasta miles cumpliendo las reglas > de impresion de los puertos seriales si fuera el caso. > > _________________________________________________________________ > Charla con tus amigos en l?nea mediante MSN Messenger: > http://messenger.latam.msn.com/ > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Saludos, Christian E. L?pez Finnberg christian at ...980... Las Palmas de Gran Canaria. From joe1962 at ...626... Fri Apr 28 09:54:42 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Fri, 28 Apr 2006 03:54:42 -0400 Subject: [Gambas-user] "Incorrect property value" Message-ID: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> Anybody else getting these "Incorrect property value" popups while trying to change a lot of widget properties in the IDE (Gambas 1.9.29)? Happens even with simple stuff like the Enabled property of a button. They all work in code, but it makes for some pretty boring form load events... Regards, Joe1962 From benoit.minisini at ...2... Fri Apr 28 10:18:35 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Fri, 28 Apr 2006 10:18:35 +0200 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> Message-ID: <200604281018.35521.benoit.minisini@...2...> On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > Anybody else getting these "Incorrect property value" popups while > trying to change a lot of widget properties in the IDE (Gambas > 1.9.29)? Happens even with simple stuff like the Enabled property of a > button. They all work in code, but it makes for some pretty boring > form load events... > > Regards, > Joe1962 > Actually a project converter will have to be written so that a 1.0 project can be ported to 2.0 easily. Regards, -- Benoit Minisini From joe1962 at ...626... Fri Apr 28 10:24:10 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Fri, 28 Apr 2006 04:24:10 -0400 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <200604281018.35521.benoit.minisini@...2...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281018.35521.benoit.minisini@...2...> Message-ID: <6c208f950604280124p3094f7bcoe31e816da994eab7@...627...> On 4/28/06, Benoit Minisini wrote: > On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > > Anybody else getting these "Incorrect property value" popups while > > trying to change a lot of widget properties in the IDE (Gambas > > 1.9.29)? Happens even with simple stuff like the Enabled property of a > > button. They all work in code, but it makes for some pretty boring > > form load events... > > > > Regards, > > Joe1962 > > > > Actually a project converter will have to be written so that a 1.0 project can > be ported to 2.0 easily. > Yes, but that's not the problem, it happens with new projects created by Gambas 1.9.29 itself. Regards, Joe1962 From benoit.minisini at ...2... Fri Apr 28 10:30:27 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Fri, 28 Apr 2006 10:30:27 +0200 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <6c208f950604280124p3094f7bcoe31e816da994eab7@...627...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281018.35521.benoit.minisini@...2...> <6c208f950604280124p3094f7bcoe31e816da994eab7@...627...> Message-ID: <200604281030.27173.benoit.minisini@...2...> On Friday 28 April 2006 10:24, Jose J. Rodriguez wrote: > On 4/28/06, Benoit Minisini wrote: > > On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > > > Anybody else getting these "Incorrect property value" popups while > > > trying to change a lot of widget properties in the IDE (Gambas > > > 1.9.29)? Happens even with simple stuff like the Enabled property of a > > > button. They all work in code, but it makes for some pretty boring > > > form load events... > > > > > > Regards, > > > Joe1962 > > > > Actually a project converter will have to be written so that a 1.0 > > project can be ported to 2.0 easily. > > Yes, but that's not the problem, it happens with new projects created > by Gambas 1.9.29 itself. > > Regards, > Joe1962 > I think you have a problem in your gambas installation or compilation... Can you send me the output of ./configure, make & make install ? -- Benoit Minisini From joe1962 at ...626... Fri Apr 28 11:25:16 2006 From: joe1962 at ...626... (Jose J. Rodriguez) Date: Fri, 28 Apr 2006 05:25:16 -0400 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <200604281030.27173.benoit.minisini@...2...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281018.35521.benoit.minisini@...2...> <6c208f950604280124p3094f7bcoe31e816da994eab7@...627...> <200604281030.27173.benoit.minisini@...2...> Message-ID: <6c208f950604280225h1500f010j1f825713dd56652d@...627...> On 4/28/06, Benoit Minisini wrote: > On Friday 28 April 2006 10:24, Jose J. Rodriguez wrote: > > On 4/28/06, Benoit Minisini wrote: > > > On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > > > > Anybody else getting these "Incorrect property value" popups while > > > > trying to change a lot of widget properties in the IDE (Gambas > > > > 1.9.29)? Happens even with simple stuff like the Enabled property of a > > > > button. They all work in code, but it makes for some pretty boring > > > > form load events... > > > > > > > > Regards, > > > > Joe1962 > > > > > > Actually a project converter will have to be written so that a 1.0 > > > project can be ported to 2.0 easily. > > > > Yes, but that's not the problem, it happens with new projects created > > by Gambas 1.9.29 itself. > > > > Regards, > > Joe1962 > > > > I think you have a problem in your gambas installation or compilation... Can > you send me the output of ./configure, make & make install ? > Here are the output files: configure-out.txt make-out.txt makeinstall-out.txt I use the following script for the process: jcompile: #!/bin/bash # # VL compile flags: export CFLAGS="-O2 -march=i586 -mcpu=i686" export CXXFLAGS=$CFLAGS export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig export LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib export QTDIR=/usr/lib/qt export KDEDIR=/opt/kde # # Gambas2: ./configure -C --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-kde-includes=/opt/kde/include --with-kde-libraries=/opt/kde/lib --disable-v4l > /home/joe1962/packages/configure-out.txt 2>&1 && make > /home/joe1962/packages/make-out.txt 2>&1 && jmaketemp and jmaketemp: #!/bin/bash # make install DESTDIR=/home/joe1962/packages/tmp_package > /home/joe1962/packages/makeinstall-out.txt 2>&1 This puts the install into a temp dir from where I can prepare and makepkg the Slackware (actually Vector Linux) tgz package. Regards, Joe1962 -------------- next part -------------- A non-text attachment was scrubbed... Name: gambas-debug.tar.bz2 Type: application/x-bzip2 Size: 30063 bytes Desc: not available URL: From ronstk at ...239... Fri Apr 28 13:10:21 2006 From: ronstk at ...239... (ron) Date: Fri, 28 Apr 2006 13:10:21 +0200 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <200604281030.27173.benoit.minisini@...2...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <6c208f950604280124p3094f7bcoe31e816da994eab7@...627...> <200604281030.27173.benoit.minisini@...2...> Message-ID: <200604281310.21832.ronstk@...239...> On Friday 28 April 2006 10:30, Benoit Minisini wrote: > On Friday 28 April 2006 10:24, Jose J. Rodriguez wrote: > > On 4/28/06, Benoit Minisini wrote: > > > On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > > > > Anybody else getting these "Incorrect property value" popups while > > > > trying to change a lot of widget properties in the IDE (Gambas > > > > 1.9.29)? Happens even with simple stuff like the Enabled property of a > > > > button. They all work in code, but it makes for some pretty boring > > > > form load events... > > > > > > > > Regards, > > > > Joe1962 > > > > > > Actually a project converter will have to be written so that a 1.0 > > > project can be ported to 2.0 easily. > > > > Yes, but that's not the problem, it happens with new projects created > > by Gambas 1.9.29 itself. > > > > Regards, > > Joe1962 > > > > I think you have a problem in your gambas installation or compilation... Can > you send me the output of ./configure, make & make install ? > Or the Val() function does wrong. I have checked then FProperty code PRIVATE FUNCTION SaveProperty() AS Boolean $sType ask for "b" CASE "i", "l" ', "b" vVal = Val(vVal) '<---- in vVal is "TRUE" as string IF IsNull(vVal) THEN GOTO _BAD As TRUE should be True it returns NULL Suggest CASE "b" vVal = CBool(vVal) CASE "i", "l" ', "b" vVal = Val(vVal) IF IsNull(vVal) THEN GOTO _BAD The error is gone but the enabled property of a button stay at true if true Changing from False to True works but True to False goes back to true. CASE "b" 'vVal = CBool(vVal) IF vVal = "False" THEN vVal = 0 ELSE vVal = 1 ENDIF And this let worked again. I do not know if there are some other places but it seams to me the Val function has something wrong. Ron From ronstk at ...239... Fri Apr 28 13:31:04 2006 From: ronstk at ...239... (ron) Date: Fri, 28 Apr 2006 13:31:04 +0200 Subject: [Gambas-user] prb:Left() does not work correct. In-Reply-To: <200604240604.34625.ronstk@...239...> References: <200604232329.16829.ronstk@...239...> <200604240039.15936.gambas@...1...> <200604240604.34625.ronstk@...239...> Message-ID: <200604281331.05109.ronstk@...239...> > Found something. > when I place only 3 textbox controls on the form it works > adding some other as button, labels and listbox, is still works > selecting the 3 working textbox, do cut and past so they are not > the *first* controls checked for tag it does not work any more > select all other, do cut and past and it works again. > > Look to me as the first tag is null/empty or not used it does not work. > Test done by remove the first tag, not working, add the tag and it works. > > This must be a bug somewhere, I do not see the logic of it. > > Ron Sorry for kicking. Findings: 3 TextBox controls on form with a .Tag property filled with a word. Using the Left(TextBox#,2) on them returns for all 3 the 2 letters. If the first .Tag is cleared ( in property sheet) the Left does not work any more on the other 2 Controls. The 3 TextBox.Tag are read with a Sub in a For Next loop. Using a temp string variable for the .Tag does work. Syntax say: Result = Left$ ( String [ , Length ] ) Tag is however a Variant. In VB this is alowed as substitut for String and I belived it was in Gambas too. Any time to confirm the behaviour/problem? TIA Ron From ronstk at ...239... Fri Apr 28 13:55:48 2006 From: ronstk at ...239... (ron) Date: Fri, 28 Apr 2006 13:55:48 +0200 Subject: [Gambas-user] Question about SDI/MDI Message-ID: <200604281355.48858.ronstk@...239...> Dispite I wished also the SDI interface I'm using the MDI. The main reason is the internal help. I can not put it on second screen. After using Diff on both source code files I found (.28) most of them are the same. For the gb? executables I do not expect differences. The question, are both in maintenance or are you switching to the SDI and let MDI die? Second question, I have seen gambas-with-editor. Can you tell the gb.qt.GambasEditor will be replaced by gb.qt.ext.Editor Ron From sourceforge-raindog2 at ...94... Fri Apr 28 14:48:31 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Fri, 28 Apr 2006 08:48:31 -0400 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604281355.48858.ronstk@...239...> References: <200604281355.48858.ronstk@...239...> Message-ID: <200604280848.32086.sourceforge-raindog2@...94...> On Fri April 28 2006 07:55, ron wrote: > The question, are both in maintenance or are you switching > to the SDI and let MDI die? SDI = Single Document Interface, which has many windows. MDI = Multiple Document Interface, which has one big window. Are you confusing the two terms here? I still have to reapply my fakebas changes to the new IDE and submit a patch (sorry, 2 clients vying for my time here), so I'll try to address your help issue troubles when I do (if Benoit or Fabien doesn't beat me to it ;) ) Rob From ronstk at ...239... Fri Apr 28 16:08:05 2006 From: ronstk at ...239... (ron) Date: Fri, 28 Apr 2006 16:08:05 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604280848.32086.sourceforge-raindog2@...94...> References: <200604281355.48858.ronstk@...239...> <200604280848.32086.sourceforge-raindog2@...94...> Message-ID: <200604281608.06317.ronstk@...239...> On Friday 28 April 2006 14:48, Rob Kudla wrote: > On Fri April 28 2006 07:55, ron wrote: > > The question, are both in maintenance or are you switching > > to the SDI and let MDI die? > > SDI = Single Document Interface, which has many windows. MDI = > Multiple Document Interface, which has one big window. Are you > confusing the two terms here? > > I still have to reapply my fakebas changes to the new IDE and > submit a patch (sorry, 2 clients vying for my time here), so > I'll try to address your help issue troubles when I do (if > Benoit or Fabien doesn't beat me to it ;) ) > > Rob Oops, yes but other ways the name is a bit confusing. It is more clear if it was called SWI and MWI :) Do I understand it right Benoit works with the SDI and apply your patch for the MDI ? The reason for asking is in the MDI the Find could use a reconstruction. In fact it is the second one preventing me to go. As you may remember I add the search list to it. Now the forms are based on 1/2 character height it is in my view to big. When the list is active it should be smaller so it can be on the side of the document under construction. Sometimes I misuse it with a search for SUB and use it to quick browse in the editor. Therefore I add to the editor a list on the side to quick jump. Yes I know the RMB can do it too. But look the menu with the project, fmain or Feditor file from the IDE if you have 800x600 or 1024x768. The side list shows/works more effecient in those cases. This is the reason to ask for possible change of the editor in Feditor. I do have on the bottom a second editor in viewmode to lookup the code. I've seen also a snapshot for a realy new IDE, wich looks great at first sight. And that all together was the reason to ask this information. May be I can contribute something to the IDE again. Ron From sourceforge-raindog2 at ...94... Fri Apr 28 16:42:21 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Fri, 28 Apr 2006 10:42:21 -0400 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604281608.06317.ronstk@...239...> References: <200604281355.48858.ronstk@...239...> <200604280848.32086.sourceforge-raindog2@...94...> <200604281608.06317.ronstk@...239...> Message-ID: <200604281042.22083.sourceforge-raindog2@...94...> On Fri April 28 2006 10:08, ron wrote: > Do I understand it right Benoit works with the SDI and > apply your patch for the MDI ? No, Benoit made the MDI version himself. But I made Fakebas, which was its own MDI version, about a year ago, and I had some features in there (most importantly a Window menu and a "taskbar" to manage the windows) that aren't in the new MDI version, so I need to add those to what Benoit has done. > Therefore I add to the editor a list on the side to quick > jump. Yes I know the RMB can do it too. But look the menu with > the project, fmain or Feditor file from the IDE if you have > 800x600 or 1024x768. The side list shows/works more effecient > in those cases. I do remember that. At one point I had added the same kind of thing to the top of each window, but as a combobox, not a list going down the side of the window which I felt used too much space. I don't remember whether I included that in Fakebas or not, though. Rob From leonardo at ...1237... Fri Apr 28 18:37:11 2006 From: leonardo at ...1237... (Leonardo Miliani) Date: Fri, 28 Apr 2006 18:37:11 +0200 Subject: [Gambas-user] SDI/MDI Message-ID: <445244B7.4040003@...1237...> Hello, I would like to say that I apprecite a lot the work that Benoit is doing on Gambas but I also would like to say that I don't like the MDI look that Gambas has in the last versions. I apprecited much more SDI look because Linux programs use a lot this interface: MDI programs remember me Windows-like applications ;-) I would suggest to Benoit to consider the use of a parameter in configure command to let the user the ability to choose how to compile the program, with SDI or MDI interface (i.e. configure --with-sdi/mdi or something similar). Yes, I know that I can continue to use SDI look just using gambas2-old program but I think it would be much easier than look for a program in sub-dirs, isn't it? :-) -- Ciao. Leo Visita il mio sito personale: www.leonardomiliani.com e-mail: leonardo at ...1237... From sourceforge-raindog2 at ...94... Fri Apr 28 19:06:32 2006 From: sourceforge-raindog2 at ...94... (Rob Kudla) Date: Fri, 28 Apr 2006 13:06:32 -0400 Subject: [Gambas-user] SDI/MDI In-Reply-To: <445244B7.4040003@...1237...> References: <445244B7.4040003@...1237...> Message-ID: <200604281306.32756.sourceforge-raindog2@...94...> On Fri April 28 2006 12:37, Leonardo Miliani wrote: > I would like to say that I apprecite a lot the work that > Benoit is doing on Gambas but I also would like to say that I > don't like the MDI look that Gambas has in the last versions. > I apprecited much more SDI look because Linux programs use a > lot this interface: MDI programs remember me Windows-like > applications ;-) Well, an MDI version of the IDE is one of the most frequently requested features, and while I'm still surprised Benoit did it (I figured I'd have to do a Fakebas 2.0 eventually) I guess it's no surprise that some people prefer the GIMP model. > I would suggest to Benoit to consider the use of a parameter > in configure command to let the user the ability to choose how > to compile the program, with SDI or MDI interface (i.e. > configure --with-sdi/mdi or something similar). Yes, I know I had hoped to do that with Fakebas and I hope it's also possible with the official MDI IDE. But don't forget that this IDE is going to be replaced before 2.0 regardless of what it looks like. Rob From ronstk at ...239... Fri Apr 28 21:53:57 2006 From: ronstk at ...239... (ron) Date: Fri, 28 Apr 2006 21:53:57 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604280848.32086.sourceforge-raindog2@...94...> References: <200604281355.48858.ronstk@...239...> <200604280848.32086.sourceforge-raindog2@...94...> Message-ID: <200604282153.57570.ronstk@...239...> On Friday 28 April 2006 14:48, Rob Kudla wrote: > On Fri April 28 2006 07:55, ron wrote: > > The question, are both in maintenance or are you switching > > to the SDI and let MDI die? > > SDI = Single Document Interface, which has many windows. MDI = > Multiple Document Interface, which has one big window. Are you > confusing the two terms here? > > I still have to reapply my fakebas changes to the new IDE and > submit a patch (sorry, 2 clients vying for my time here), so > I'll try to address your help issue troubles when I do (if > Benoit or Fabien doesn't beat me to it ;) ) > > Rob > Oops, yes that is true. The name Document is a bit confusing here. Single has many and Multi is single. Why did they not named SWI for Single Window Interface and MWI for Multiple Windows Interface ? :) Ron From benoit.minisini at ...2... Fri Apr 28 22:31:20 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Fri, 28 Apr 2006 22:31:20 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604281355.48858.ronstk@...239...> References: <200604281355.48858.ronstk@...239...> Message-ID: <200604282231.20825.benoit.minisini@...2...> On Friday 28 April 2006 13:55, ron wrote: > Dispite I wished also the SDI interface I'm using the MDI. > The main reason is the internal help. > I can not put it on second screen. > > After using Diff on both source code files I found (.28) > most of them are the same. > For the gb? executables I do not expect differences. > > The question, are both in maintenance or are you switching > to the SDI and let MDI die? See my answer in another post. > > Second question, I have seen gambas-with-editor. > Can you tell the gb.qt.GambasEditor will be replaced by gb.qt.ext.Editor Yes. The gb.qt.ext.editor is faster, and less buggy than the old one. And it can be relatively easily ported to GTK+. Regards, -- Benoit Minisini From benoit.minisini at ...2... Fri Apr 28 22:21:07 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Fri, 28 Apr 2006 22:21:07 +0200 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <200604281310.21832.ronstk@...239...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281030.27173.benoit.minisini@...2...> <200604281310.21832.ronstk@...239...> Message-ID: <200604282221.07940.benoit.minisini@...2...> On Friday 28 April 2006 13:10, ron wrote: > On Friday 28 April 2006 10:30, Benoit Minisini wrote: > > On Friday 28 April 2006 10:24, Jose J. Rodriguez wrote: > > > On 4/28/06, Benoit Minisini wrote: > > > > On Friday 28 April 2006 09:54, Jose J. Rodriguez wrote: > > > > > Anybody else getting these "Incorrect property value" popups while > > > > > trying to change a lot of widget properties in the IDE (Gambas > > > > > 1.9.29)? Happens even with simple stuff like the Enabled property > > > > > of a button. They all work in code, but it makes for some pretty > > > > > boring form load events... > > > > > > > > > > Regards, > > > > > Joe1962 > > > > > > > > Actually a project converter will have to be written so that a 1.0 > > > > project can be ported to 2.0 easily. > > > > > > Yes, but that's not the problem, it happens with new projects created > > > by Gambas 1.9.29 itself. > > > > > > Regards, > > > Joe1962 > > > > I think you have a problem in your gambas installation or compilation... > > Can you send me the output of ./configure, make & make install ? > > Or the Val() function does wrong. > I have checked then FProperty code > > PRIVATE FUNCTION SaveProperty() AS Boolean > $sType ask for "b" > > CASE "i", "l" ', "b" > vVal = Val(vVal) '<---- in vVal is "TRUE" as string > IF IsNull(vVal) THEN GOTO _BAD > > As TRUE should be True it returns NULL > > > Suggest > CASE "b" > vVal = CBool(vVal) > > CASE "i", "l" ', "b" > vVal = Val(vVal) > IF IsNull(vVal) THEN GOTO _BAD > > The error is gone but the enabled property of a button stay at true if true > Changing from False to True works but True to False goes back to true. > > CASE "b" > 'vVal = CBool(vVal) > IF vVal = "False" THEN > vVal = 0 > ELSE > vVal = 1 > ENDIF > > And this let worked again. > I do not know if there are some other places but it seams to me > the Val function has something wrong. > > > Ron > Arf! You have to add a patch. You will find it on the mailing-list, under the following subject: "Stupid bug in 1.9.29" Sorry for the inconvenience! -- Benoit Minisini From benoit.minisini at ...2... Fri Apr 28 22:29:57 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Fri, 28 Apr 2006 22:29:57 +0200 Subject: [Gambas-user] SDI/MDI In-Reply-To: <200604281306.32756.sourceforge-raindog2@...94...> References: <445244B7.4040003@...1237...> <200604281306.32756.sourceforge-raindog2@...94...> Message-ID: <200604282229.57424.benoit.minisini@...2...> On Friday 28 April 2006 19:06, Rob Kudla wrote: > On Fri April 28 2006 12:37, Leonardo Miliani wrote: > > I would like to say that I apprecite a lot the work that > > Benoit is doing on Gambas but I also would like to say that I > > don't like the MDI look that Gambas has in the last versions. > > I apprecited much more SDI look because Linux programs use a > > lot this interface: MDI programs remember me Windows-like > > applications ;-) > > Well, an MDI version of the IDE is one of the most frequently > requested features, and while I'm still surprised Benoit did it > (I figured I'd have to do a Fakebas 2.0 eventually) I guess it's > no surprise that some people prefer the GIMP model. > > > I would suggest to Benoit to consider the use of a parameter > > in configure command to let the user the ability to choose how > > to compile the program, with SDI or MDI interface (i.e. > > configure --with-sdi/mdi or something similar). Yes, I know > > I had hoped to do that with Fakebas and I hope it's also possible > with the official MDI IDE. But don't forget that this IDE is > going to be replaced before 2.0 regardless of what it looks > like. > > Rob > Actually the MDI version was just a quick hack :-) QT Workspace is too badly designed. My goal is to make a Gambas component for implementing MDI/SDI easily. I want it to be able to have toolbars and toolboxes, up, down, left & right, with optional tabs. Like the GIMP 2.0, but in a MDI way. And a flag that can make the program works as SDI or as MDI. This component will be written in Gambas, so that gb.gtk can use it. As I have gave up my acting studies today, I will have more time to do it :-) But don't claim victory, I hope I will be able to continue in another place. Note that this is not an easy job. In a few words, don't worry too mch about the current IDE. Wait for the next one! :-) -- Benoit Minisini From arcalis.prod at ...11... Sat Apr 29 15:31:23 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 29 Apr 2006 15:31:23 +0200 Subject: [Gambas-user] SDI/MDI In-Reply-To: <200604282229.57424.benoit.minisini@...2...> References: <445244B7.4040003@...1237...> <200604281306.32756.sourceforge-raindog2@...94...> <200604282229.57424.benoit.minisini@...2...> Message-ID: <200604291531.23546.arcalis.prod@...11...> Le Vendredi 28 Avril 2006 22:29, Benoit Minisini a ?crit?: > On Friday 28 April 2006 19:06, Rob Kudla wrote: > > On Fri April 28 2006 12:37, Leonardo Miliani wrote: > > > I would like to say that I apprecite a lot the work that > > > Benoit is doing on Gambas but I also would like to say that I > > > don't like the MDI look that Gambas has in the last versions. > > > I apprecited much more SDI look because Linux programs use a > > > lot this interface: MDI programs remember me Windows-like > > > applications ;-) > > > > Well, an MDI version of the IDE is one of the most frequently > > requested features, and while I'm still surprised Benoit did it > > (I figured I'd have to do a Fakebas 2.0 eventually) I guess it's > > no surprise that some people prefer the GIMP model. > > > > > I would suggest to Benoit to consider the use of a parameter > > > in configure command to let the user the ability to choose how > > > to compile the program, with SDI or MDI interface (i.e. > > > configure --with-sdi/mdi or something similar). Yes, I know > > > > I had hoped to do that with Fakebas and I hope it's also possible > > with the official MDI IDE. But don't forget that this IDE is > > going to be replaced before 2.0 regardless of what it looks > > like. > > > > Rob > > Actually the MDI version was just a quick hack :-) QT Workspace is too > badly designed. > > My goal is to make a Gambas component for implementing MDI/SDI easily. I > want it to be able to have toolbars and toolboxes, up, down, left & right, > with optional tabs. Like the GIMP 2.0, but in a MDI way. And a flag that > can make the program works as SDI or as MDI. > > This component will be written in Gambas, so that gb.gtk can use it. > > As I have gave up my acting studies today, I will have more time to do it > :-) But don't claim victory, I hope I will be able to continue in a > nother > place. > > Note that this is not an easy job. > > In a few words, don't worry too mch about the current IDE. Wait for the > next one! :-) Hi Benoit, Can you make this component r?usable ? I wish use this type of toolbar management in my appli too... so if you doing it i can stop to do it myself :-P best regards, Fabien Bodard From timothy.marshal-nichols at ...247... Sat Apr 29 16:26:29 2006 From: timothy.marshal-nichols at ...247... (Timothy Marshal-Nichols) Date: Sat, 29 Apr 2006 15:26:29 +0100 Subject: [Gambas-user] Drawing In-Reply-To: <200604261046.43525.gambas@...1...> Message-ID: > -----Original Message----- > From: gambas-user-admin at lists.sourceforge.net > [mailto:gambas-user-admin at lists.sourceforge.net]On Behalf Of Benoit > Minisini > Sent: Wednesday, 26 April 2006 09:47 > To: gambas-user at lists.sourceforge.net > Subject: Re: [Gambas-user] Drawing > > > On Wednesday 26 April 2006 10:39, Timothy Marshal-Nichols wrote: > > You must be using an older version of Gambas. The *= is just > > multiplication. Try: > > > > imageWidth = imageWidth * scaleIsotropic > > imageHeight = imageHeight * scaleIsotropic > > > > this the same code in long hand. > > > > The PrintImage code was to show you how to use the Resolution of the > > Printer and Desktop to find the required image/drawing size. > Its just I had > > code to hand using a image that I knew worked. You can still Draw a > > Drawing. > > > > This is what you might get: > > > > PRIVATE SUB PrintDrawing(drw AS Drawing) > > DIM drawingWidth AS Integer > > DIM drawingHeight AS Integer > > DIM scaleIsotropic AS Float > > ' Display printer dialog > > IF Printer.Setup() THEN RETURN > > INC Application.Busy > > ' Get drawing size for the printer resolution > > drawingWidth = (drw.Width * Printer.Resolution) / Desktop.Resolution > > drawingHeight = (drw.Height * Printer.Resolution) / Desktop.Resolution > > ' Adjust drawing size if it does not fit on the printer page > > IF drawingWidth > Printer.Width OR drawingHeight > Printer.Height THEN > > ' Scale Isotropic, keep aspect ratio of the image > > scaleIsotropic = Min(Printer.Width / drawingWidth, Printer.Height / > > drawingHeight) > > drawingWidth *= scaleIsotropic > > drawingHeight *= scaleIsotropic > > END IF > > 'PRINT "Width: " & drawingWidth, drw.Width, Printer.Width > > 'PRINT "Height: " & drawingHeight, drw.Height, Printer.Height > > ' Draw drawing centred on printer page > > Draw.Begin(Printer) > > 'Draw.Rect((Printer.Width - drawingWidth) / 2, (Printer.Height - > > drawingHeight) / 2, drawingWidth, drawingHeight) > > Draw.Drawing(drw, (Printer.Width - drawingWidth) / 2, > (Printer.Height - > > drawingHeight) / 2, drawingWidth, drawingHeight) > > Draw.End > > DEC Application.Busy > > END > > > > Two points: > > > > 1. Convert the *= again! > > > > 2. On my system this still only prints the Drawing at the old > resolution. > > You can see if you uncomment the Draw.Rect line that the calculation for > > the drawing size is correct. By setting the width and height > the help says > > the drawing should be scaled. I think this has been fixed with later > > versions of Gambas as I know there has been some work the SVG > code. (I was > > going to upgrade after installing SUES 10.1.) > > > > Also the scaling of a Drawing when drawing on a DrawingArea > does not work - > > so it must be a problem with the Draw.Drawing method. If this method has > > not been fixed then you will never be able to print good image > at the right > > size. > > > > Thanks > > > > 8-{)} Timothy Marshal-Nichols > > > > > > If a kind people could make a little example of printing, I will > put it with > the other Gambas examples :-) > > Regards, > > -- > Benoit Minisini > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gambas-user mailing list > Gambas-user at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > I have created a project to demonstrate the printing of text, images and drawings. There is one problem. This is with the drawing of a SVG file. When you call Draw.Drawing it always draws the SVG file at the same size. For example the following: Draw.Drawing(SVGDrawing, 10, 10, 110, 110) and Draw.Drawing(SVGDrawing, 10, 10, 210, 210) produces drawings at the original size of the drawing. The help says you setting the width and height should scale the drawing. Setting the width and height appears to have no effect. This means when printing you always get a thumbnail whether you want it or not. (You could convert to a Picture, then a Image, then scale, then print. But this would not scale very well for printing.) At first the thought this was just a problem with the version of gambas I was using (1.9.17). But I also created a version of this project in the stable version Gambas 1.0.15. The problem also appears to be in that version also. So now I am now thinking the bug is in both versions 1 and 2 of Gambas. Try out the example. In ModulePrinting look at the procedure PrintDrawing. If you uncomment the line Draw.Rect... you can see the size the SVG size should print out at. Thanks 8-{)} Timothy Marshal-Nichols -------------- next part -------------- A non-text attachment was scrubbed... Name: Printing.Gambas2.V0.0.1.tar Type: application/x-tar Size: 81920 bytes Desc: not available URL: From ronstk at ...239... Sat Apr 29 17:25:10 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 17:25:10 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604282231.20825.benoit.minisini@...2...> References: <200604281355.48858.ronstk@...239...> <200604282231.20825.benoit.minisini@...2...> Message-ID: <200604291725.11138.ronstk@...239...> On Friday 28 April 2006 22:31, Benoit Minisini wrote: > On Friday 28 April 2006 13:55, ron wrote: > > Dispite I wished also the SDI interface I'm using the MDI. > > The main reason is the internal help. > > I can not put it on second screen. > > > > After using Diff on both source code files I found (.28) > > most of them are the same. > > For the gb? executables I do not expect differences. > > > > The question, are both in maintenance or are you switching > > to the SDI and let MDI die? > > See my answer in another post. Any Title or date known? > > > > > Second question, I have seen gambas-with-editor. > > Can you tell the gb.qt.GambasEditor will be replaced by gb.qt.ext.Editor > > Yes. The gb.qt.ext.editor is faster, and less buggy than the old one. And it > can be relatively easily ported to GTK+. Good news. > > Regards, > I just got your message 29-apr 17:20 It hangs for 2 hours at sf and *17 hours* at my provider tiscali.nl. :( During typing this a message from Rob arrived 25 hours late :( Happy time, Ron From ronstk at ...239... Sat Apr 29 17:34:08 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 17:34:08 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604281042.22083.sourceforge-raindog2@...94...> References: <200604281355.48858.ronstk@...239...> <200604281608.06317.ronstk@...239...> <200604281042.22083.sourceforge-raindog2@...94...> Message-ID: <200604291734.08740.ronstk@...239...> On Friday 28 April 2006 16:42, Rob Kudla wrote: > On Fri April 28 2006 10:08, ron wrote: > > Do I understand it right Benoit works with the SDI and > > apply your patch for the MDI ? > > No, Benoit made the MDI version himself. But I made Fakebas, > which was its own MDI version, about a year ago, and I had some > features in there (most importantly a Window menu and a > "taskbar" to manage the windows) that aren't in the new MDI > version, so I need to add those to what Benoit has done. > > > Therefore I add to the editor a list on the side to quick > > jump. Yes I know the RMB can do it too. But look the menu with > > the project, fmain or Feditor file from the IDE if you have > > 800x600 or 1024x768. The side list shows/works more effecient > > in those cases. > > I do remember that. At one point I had added the same kind of > thing to the top of each window, but as a combobox, not a list > going down the side of the window which I felt used too much > space. I don't remember whether I included that in Fakebas or > not, though. > > Rob > I have made the code for the combo box too. I posted at that time also a screenshot with it but Benoit was sleeping :) Looks the same as VB has. He comment in the Hall of Fame I try to make it VB and he will resist. :) Yes the space on the side used is bad. I did put it all in HBox/VBox and with SideBar and that goes well. This was after a sneak preview of the alternative IDE. Ron From benoit.minisini at ...2... Sat Apr 29 17:47:30 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Sat, 29 Apr 2006 17:47:30 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604291725.11138.ronstk@...239...> References: <200604281355.48858.ronstk@...239...> <200604282231.20825.benoit.minisini@...2...> <200604291725.11138.ronstk@...239...> Message-ID: <200604291747.30270.benoit.minisini@...2...> On Saturday 29 April 2006 17:25, ron wrote: > On Friday 28 April 2006 22:31, Benoit Minisini wrote: > > On Friday 28 April 2006 13:55, ron wrote: > > > Dispite I wished also the SDI interface I'm using the MDI. > > > The main reason is the internal help. > > > I can not put it on second screen. > > > > > > After using Diff on both source code files I found (.28) > > > most of them are the same. > > > For the gb? executables I do not expect differences. > > > > > > The question, are both in maintenance or are you switching > > > to the SDI and let MDI die? > > > > See my answer in another post. > > Any Title or date known? > > > > Second question, I have seen gambas-with-editor. > > > Can you tell the gb.qt.GambasEditor will be replaced by > > > gb.qt.ext.Editor > > > > Yes. The gb.qt.ext.editor is faster, and less buggy than the old one. And > > it can be relatively easily ported to GTK+. > > Good news. > > > Regards, > > I just got your message 29-apr 17:20 > It hangs for 2 hours at sf and *17 hours* at my provider tiscali.nl. :( > During typing this a message from Rob arrived 25 hours late :( > > Happy time, > > Ron > There are almost 500 people on this mailing-list, so sending one mail generates about 500 other mails, and so it cannot be immediate! -- Benoit Minisini From benoit.minisini at ...2... Sat Apr 29 17:48:12 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Sat, 29 Apr 2006 17:48:12 +0200 Subject: [Gambas-user] SDI/MDI In-Reply-To: <200604291531.23546.arcalis.prod@...11...> References: <445244B7.4040003@...1237...> <200604282229.57424.benoit.minisini@...2...> <200604291531.23546.arcalis.prod@...11...> Message-ID: <200604291748.12395.benoit.minisini@...2...> On Saturday 29 April 2006 15:31, fabien Bodard wrote: > Hi Benoit, > > Can you make this component r?usable ? > Of course, this is the goal. -- Benoit Minisini From ronstk at ...239... Sat Apr 29 18:05:31 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 18:05:31 +0200 Subject: [Gambas-user] Question about SDI/MDI In-Reply-To: <200604291747.30270.benoit.minisini@...2...> References: <200604281355.48858.ronstk@...239...> <200604291725.11138.ronstk@...239...> <200604291747.30270.benoit.minisini@...2...> Message-ID: <200604291805.31573.ronstk@...239...> On Saturday 29 April 2006 17:47, Benoit Minisini wrote: > There are almost 500 people on this mailing-list, so sending one mail > generates about 500 other mails, and so it cannot be immediate! > The delay at sf is indeed logic. And beside the 500 on the gambas list more on the others too. I got my mail sent to sf almost direct back from sf. The time *at* my provider however is the bad thing. Just got the refered mail anyway via fabian. The snapshot I have seen is in your mind? Ron From arcalis.prod at ...11... Sat Apr 29 18:27:32 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 29 Apr 2006 18:27:32 +0200 Subject: [Gambas-user] Some Little Patch Message-ID: <200604291827.32380.arcalis.prod@...11...> Hi to all this is just a little temporary patch that add a side 'goto' bar. Just replace the project.module file and add the Fsubs.Form and . class files, and recompile the ide ... Regards, Fabien Bodard -------------- next part -------------- ' Gambas module file PUBLIC ProjectTree AS TreeView PUBLIC ProjectMessage AS Label PUBLIC Workspace AS Workspace 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 = 8192 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 DIM iTest AS Integer 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(Workspace) FOutput.Load(Workspace) 'FDebug.Load(Workspace) FIconTool.Load(Workspace) FFormStack.Load(Workspace) FExplorer.Load(Workspace) FToolBox.Load(Workspace) FProperty.Load(Workspace) 'FSubs.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 hImage AS Image 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 TRY hImage = Image.Load(sIcon) IF hImage.Height > 48 THEN hImage = hImage.Stretch(hImage.Width * 48 / hImage.Height, 48) ENDIF IF hImage.Width > 64 THEN hImage = hImage.Stretch(64, hImage.Height * 64 / hImage.Width) ENDIF hPict = hImage.Picture 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/32/../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, Workspace) CASE "form" IF AllowForm() THEN hForm = NEW FForm(sPath, Workspace) CASE "png", "gif", "jpg", "jpeg", "bmp", "xpm" hForm = NEW FIconEditor(sPath, Workspace) CASE ELSE hForm = NEW FTextEditor(sPath, Workspace) 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 'DEBUG "Activate: "; Workspace.ActiveWindow.Title '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 hForm THEN SelectKey(hForm.Path) IF ActiveForm = hForm THEN RETURN ActiveForm = hForm ELSE IF NOT ActiveForm THEN RETURN ENDIF FProperty.RefreshAll FFormStack.RefreshAll IF Object.Type(ActiveForm) = "FIconEditor" THEN FIconTool.Raise ELSE FIconTool.Hide ENDIF IF Object.Type(ActiveForm) = "FForm" THEN FProperty.Raise FToolBox.Raise ActiveForm.Raise ELSE FProperty.Lower FToolBox.Lower ENDIF IF Object.Type(ActiveForm) = "FEditor" THEN FSubs.RefreshAll FSubs.Raise ELSE FSubs.Hide ENDIF ' 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 'DEBUG "DeActivate: "; hForm.Title SELECT CASE Object.Type(hForm) CASE "FIconEditor" FIconTool.Hide CASE "FEditor" FSubs.Hide CASE "FForm" FProperty.HideAll FFormStack.HideAll FProperty.Hide FToolBox.Hide 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 move Project.Dir &/ Project.Name TO 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" hFic = OPEN Path FOR READ 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 hFic = OPEN Path & ".tmp" FOR CREATE 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 move Path & ".tmp" TO 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 move sPath TO 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 move sPath TO 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) move sSrc TO 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.Scan = 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) hForm.Move(Int(Rnd(0, Max(0, Workspace.Width - hForm.Width - 8))), Int(Rnd(0, Max(0, Workspace.Height - hForm.Height - 8)))) 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) TRY hImage = Image.Load(sPath) IF ERROR THEN hImage = NULL BREAK ENDIF WEND CLOSE #hFile FINALLY IF NOT hImage THEN hImage = Image.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 -------------- # Gambas Form File 1.0 { FSubs Form MoveScaled(7.375,0.125,33.125,45.25) 'Move(59,1,265,362) Text = ("Goto") Persistent = True TopOnly = True Arrangement = Arrange.Vertical { Label1 Label MoveScaled(1,1,31,3) 'Move(8,8,248,24) Text = ("Goto") Border = Border.Raised } { tvFct TreeView MoveScaled(2,8,25,27) 'Move(16,64,200,216) Font = Font["-1"] Expand = True } } -------------- next part -------------- A non-text attachment was scrubbed... Name: FSubs.class Type: application/x-java Size: 1886 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: capture5.png Type: image/png Size: 114110 bytes Desc: not available URL: From arcalis.prod at ...11... Sat Apr 29 18:42:47 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 29 Apr 2006 18:42:47 +0200 Subject: [Gambas-user] Some Little Patch In-Reply-To: <200604291827.32380.arcalis.prod@...11...> References: <200604291827.32380.arcalis.prod@...11...> Message-ID: <200604291842.47925.arcalis.prod@...11...> Le Samedi 29 Avril 2006 18:27, fabien Bodard a ?crit?: > Hi to all this is just a little temporary patch that add a side 'goto' bar. > > Just replace the project.module file and add the Fsubs.Form and . class > files, and recompile the ide ... > > Regards, > Fabien Bodard OOps i've forgoten a file ! And to say that is based on 1.9.29 VERSION So this is the file : From arcalis.prod at ...11... Sat Apr 29 18:44:32 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 29 Apr 2006 18:44:32 +0200 Subject: [Gambas-user] Some Little Patch In-Reply-To: <200604291827.32380.arcalis.prod@...11...> References: <200604291827.32380.arcalis.prod@...11...> Message-ID: <200604291844.32766.arcalis.prod@...11...> Le Samedi 29 Avril 2006 18:27, fabien Bodard a ?crit?: > Hi to all this is just a little temporary patch that add a side 'goto' bar. > > Just replace the project.module file and add the Fsubs.Form and . class > files, and recompile the ide ... > > Regards, > Fabien Bodard OOps i've forgoten a file ! And to say that is based on 1.9.29 VERSION So this is the file : -------------- next part -------------- A non-text attachment was scrubbed... Name: FMain.class Type: application/x-java Size: 14735 bytes Desc: not available URL: From arcalis.prod at ...11... Sat Apr 29 19:12:14 2006 From: arcalis.prod at ...11... (fabien Bodard) Date: Sat, 29 Apr 2006 19:12:14 +0200 Subject: [Gambas-devel] Re: [Gambas-user] Some Little Patch In-Reply-To: <200604291844.32766.arcalis.prod@...11...> References: <200604291827.32380.arcalis.prod@...11...> <200604291844.32766.arcalis.prod@...11...> Message-ID: <200604291912.14277.arcalis.prod@...11...> There was an iden bug... this is the patch... sorry :/ Fabien Bodard -------------- next part -------------- A non-text attachment was scrubbed... Name: FSubs.class Type: application/x-java Size: 2028 bytes Desc: not available URL: From ronstk at ...239... Sat Apr 29 19:25:37 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 19:25:37 +0200 Subject: [Gambas-user] "Incorrect property value" In-Reply-To: <200604282221.07940.benoit.minisini@...2...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281310.21832.ronstk@...239...> <200604282221.07940.benoit.minisini@...2...> Message-ID: <200604291925.38000.ronstk@...239...> On Friday 28 April 2006 22:21, Benoit Minisini wrote: > Arf! You have to add a patch. You will find it on the mailing-list, under the > following subject: "Stupid bug in 1.9.29" > > Sorry for the inconvenience! > Ok no problem. I did: make clean make make install The patch is working. :) Thanks, Ron From grosem at ...31... Sat Apr 29 19:32:38 2006 From: grosem at ...31... (Adrian Debbeler) Date: Sat, 29 Apr 2006 19:32:38 +0200 Subject: [Gambas-user] Unscribe In-Reply-To: <200604291925.38000.ronstk@...239...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281310.21832.ronstk@...239...> <200604282221.07940.benoit.minisini@...2...> <200604291925.38000.ronstk@...239...> Message-ID: <1146331958.4452.0.camel@...37...> Unscribe From ronstk at ...239... Sat Apr 29 19:36:35 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 19:36:35 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code Message-ID: <200604291936.35425.ronstk@...239...> function GetRecordCount(mytable) as integer dim Count as integer dim sql as string dim hResult as result sql="select count(*) from " & mytable hresult = hConn.exec(sql) count = hResult.count hResult=null return Count end This returns for Count 1 and the table has 20000 records and each record contains at around 1000bytes (not realy) Using the Count(*), wich is valid SQL syntax as far i know, the backend returns to me 1 record with 1 field and the content of the field is the record count in the table. As I understood from help the hConn.exec passtrough the sql text as is. However it functions only with "select * from table" and would return 20000x1000 bytes as the request is now. Somehow this is not logic to me, using a sub routine to get the count this way may not logic for others but it is part of more. Just stripped to basics. using mysql from cli gives: mysql> use selectdemo; mysql> show tables; +----------------------+ | Tables_in_selectdemo | +----------------------+ | makes | | models | | options | +----------------------+ 3 rows in set (0.00 sec) *** returns 1 field as "Tables_in_selectdemo" and 3 records mysql> select count(*) from makes; +----------+ | count(*) | +----------+ | 7 | +----------+ 1 row in set (0.23 sec) *** returns 1 field as "count(*)" and 1 records mysql> select * from makes; +--------+-----------+ | makeID | makeName | +--------+-----------+ | 1 | Ford | | 2 | Pontiac | | 3 | Chevrolet | | 4 | Hyundai | | 5 | Porsche | | 6 | niels | | 7 | ernie | +--------+-----------+ 7 rows in set (0.04 sec) *** returns 2 fields and 7 records Have a nice day, Ron From ronstk at ...239... Sat Apr 29 19:43:48 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 19:43:48 +0200 Subject: [Gambas-user] Unscribe In-Reply-To: <1146331958.4452.0.camel@...37...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604291925.38000.ronstk@...239...> <1146331958.4452.0.camel@...37...> Message-ID: <200604291943.48968.ronstk@...239...> On Saturday 29 April 2006 19:32, Adrian Debbeler wrote: > Unscribe > > Why? I like it here :) Ron List-Unsubscribe: , From benoit.minisini at ...2... Sat Apr 29 20:22:37 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Sat, 29 Apr 2006 20:22:37 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604291936.35425.ronstk@...239...> References: <200604291936.35425.ronstk@...239...> Message-ID: <200604292022.37806.benoit.minisini@...2...> On Saturday 29 April 2006 19:36, ron wrote: > function GetRecordCount(mytable) as integer > dim Count as integer > dim sql as string > dim hResult as result > > sql="select count(*) from " & mytable > hresult = hConn.exec(sql) > count = hResult.count > hResult=null > return Count > end > > This returns for Count 1 and the table has 20000 records > and each record contains at around 1000bytes (not realy) > > Using the Count(*), wich is valid SQL syntax as far i know, > the backend returns to me 1 record with 1 field and the content > of the field is the record count in the table. > > As I understood from help the hConn.exec passtrough the sql > text as is. > However it functions only with "select * from table" and would > return 20000x1000 bytes as the request is now. > > > Somehow this is not logic to me, using a sub routine to get the > count this way may not logic for others but it is part of more. > Just stripped to basics. > > using mysql from cli gives: > > mysql> use selectdemo; > mysql> show tables; > +----------------------+ > > | Tables_in_selectdemo | > > +----------------------+ > > | makes | > | models | > | options | > > +----------------------+ > 3 rows in set (0.00 sec) > *** returns 1 field as "Tables_in_selectdemo" and 3 records > > mysql> select count(*) from makes; > +----------+ > > | count(*) | > > +----------+ > > | 7 | > > +----------+ > 1 row in set (0.23 sec) > *** returns 1 field as "count(*)" and 1 records > > mysql> select * from makes; > +--------+-----------+ > > | makeID | makeName | > > +--------+-----------+ > > | 1 | Ford | > | 2 | Pontiac | > | 3 | Chevrolet | > | 4 | Hyundai | > | 5 | Porsche | > | 6 | niels | > | 7 | ernie | > > +--------+-----------+ > 7 rows in set (0.04 sec) > *** returns 2 fields and 7 records > > Have a nice day, > > Ron > And what is the problem ? -- Benoit Minisini From ronstk at ...239... Sat Apr 29 20:37:49 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 20:37:49 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604292022.37806.benoit.minisini@...2...> References: <200604291936.35425.ronstk@...239...> <200604292022.37806.benoit.minisini@...2...> Message-ID: <200604292037.50116.ronstk@...239...> On Saturday 29 April 2006 20:22, Benoit Minisini wrote: > On Saturday 29 April 2006 19:36, ron wrote: > > function GetRecordCount(mytable) as integer > > dim Count as integer > > dim sql as string > > dim hResult as result > > > > sql="select count(*) from " & mytable > > hresult = hConn.exec(sql) > > count = hResult.count > > hResult=null > > return Count > > end > > -----8<------ > > > > And what is the problem ? > hConn.Exec("SELECT COUNT(*) FROM table") returns 1 Stupid Me :( > mysql> select count(*) from makes; > +----------+ > | count(*) | > +----------+ > | ? ? ? ?7 | slap, slap and slap I should use: Count = hResult["COUNT(*)"] Thanks, Ron From ronstk at ...239... Sat Apr 29 23:34:14 2006 From: ronstk at ...239... (ron) Date: Sat, 29 Apr 2006 23:34:14 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604292037.50116.ronstk@...239...> References: <200604291936.35425.ronstk@...239...> <200604292022.37806.benoit.minisini@...2...> <200604292037.50116.ronstk@...239...> Message-ID: <200604292334.14725.ronstk@...239...> I'm feeling realy stupid. =========== PRINT sTBLinProc hRecordData = hConn.Create(sTBLinProc) i = hRecordData.Fields.Count i = hRecordData.Count i = hRecordData.Max txtCount.Text = getRecordCount() =========== hRecordData is variable of Result sTBLinProc = table name and correct the first i is correct field count the second i is gives '1' and is wrong, the test table has 7 records the last i returns '0' and should be 6 ? The GetRecordCount() I made get it from the same table and is correct. The help says only 'This class represents the result of a SQL request.' 'Returns the number of records inside the result.' Than it is logic to me that 'hRecordData = hConn.Create(sTBLinProc)' should act as the SQL request and get the whole table as "SELECT * FROM table" and if there is a note in gb.db page not to use .Exec for correct working. using: =========== FOR EACH sName IN asFields '<-- these are the fieldnames in table PRINT sName & " = " & hRecordData[sName] '<-- no data NEXT hRecordData.MoveFirst FOR EACH sName IN asFields PRINT sName & " = " & hRecordData[sName] '<-- no data NEXT =========== But it tells me there is 1 record and nothing in it ? Again from help gb.db - Database access component the information note at the end This works only if: ... You use the Find, Create and Edit methods. ... You don't use the Exec method, that lets you send SQL request directly to the backend, so that you can access its specific features. I use the Create to open/use the table. PUBLIC SUB hurt() DIM hConn AS Connection DIM hResult AS result DIM done AS Integer done = 0 hConn = NEW Connection hConn.Type = "mysql" hConn.host = "127.0.0.1" hConn.Name = "selectdemo" hConn.user = "gambas" hConn.Password = "gambas" hConn.open() hResult = hConn.Create("makes") FOR EACH hResult PRINT hResult!makeID; " "; hResult!makeName; " and "; hResult.Count - done; " To go" INC Done NEXT END I get only ' and 1 To go'? Question is what I'm doing wrong? I do have some idea but want this info to prevent adding incorrect information and wild guesses to the wikihelp. TIA, Ron From benoit.minisini at ...2... Sat Apr 29 23:41:29 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Sat, 29 Apr 2006 23:41:29 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604292334.14725.ronstk@...239...> References: <200604291936.35425.ronstk@...239...> <200604292037.50116.ronstk@...239...> <200604292334.14725.ronstk@...239...> Message-ID: <200604292341.29578.benoit.minisini@...2...> On Saturday 29 April 2006 23:34, ron wrote: > I'm feeling realy stupid. > =========== > PRINT sTBLinProc > hRecordData = hConn.Create(sTBLinProc) > i = hRecordData.Fields.Count > i = hRecordData.Count > i = hRecordData.Max > > txtCount.Text = getRecordCount() > =========== > hRecordData is variable of Result > sTBLinProc = table name and correct > the first i is correct field count > the second i is gives '1' and is wrong, the test table has 7 records > the last i returns '0' and should be 6 ? > > The GetRecordCount() I made get it from the same table and is correct. > > The help says only > 'This class represents the result of a SQL request.' > 'Returns the number of records inside the result.' > > Than it is logic to me that 'hRecordData = hConn.Create(sTBLinProc)' > should act as the SQL request and get the whole table as > "SELECT * FROM table" and if there is a note in gb.db > page not to use .Exec for correct working. Not at all. Create() returns a special read/write Result with one record inside. All record fields are set to NULL, that means, in the Create() case only, that the field will take its default value. Are things clearer? Note: If you want to see what 'gb.db' sends to the database backend, set DB.Debug to TRUE at the start of your program. Regards, -- Benoit Minisini From ronstk at ...239... Sun Apr 30 00:08:58 2006 From: ronstk at ...239... (ron) Date: Sun, 30 Apr 2006 00:08:58 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604292341.29578.benoit.minisini@...2...> References: <200604291936.35425.ronstk@...239...> <200604292334.14725.ronstk@...239...> <200604292341.29578.benoit.minisini@...2...> Message-ID: <200604300008.58819.ronstk@...239...> On Saturday 29 April 2006 23:41, Benoit Minisini wrote: > On Saturday 29 April 2006 23:34, ron wrote: > > I'm feeling realy stupid. > > =========== > > PRINT sTBLinProc > > hRecordData = hConn.Create(sTBLinProc) > > i = hRecordData.Fields.Count > > i = hRecordData.Count > > i = hRecordData.Max > > > > txtCount.Text = getRecordCount() > > =========== > > hRecordData is variable of Result > > sTBLinProc = table name and correct > > the first i is correct field count > > the second i is gives '1' and is wrong, the test table has 7 records > > the last i returns '0' and should be 6 ? > > > > The GetRecordCount() I made get it from the same table and is correct. > > > > The help says only > > 'This class represents the result of a SQL request.' > > 'Returns the number of records inside the result.' > > > > Than it is logic to me that 'hRecordData = hConn.Create(sTBLinProc)' > > should act as the SQL request and get the whole table as > > "SELECT * FROM table" and if there is a note in gb.db > > page not to use .Exec for correct working. > > Not at all. Create() returns a special read/write Result with one record > inside. > > All record fields are set to NULL, that means, in the Create() case only, that > the field will take its default value. > > Are things clearer? It explains my findings, but clearer, I can't say that. I do ATM not understand the purpose of such record. Or do I have to understand .Create(tblname) is a method to create a new record wich is added to he tblname after hConn.Update ? May I suggest in that case to add a method .UseTable(tablename as string) that do the "select * from tablename" and a .MoveFirst() automatic. In that way you can direct use the Result without additional commands. hResult = hConn.UseTable("mytable") for each hResult print hResult["fieldname"] ' do something next > > Note: If you want to see what 'gb.db' sends to the database backend, set > DB.Debug to TRUE at the start of your program. Good tip, as normal from you :) > > Regards, > Mail problem was at provider, maintenance yesterday with problems, and two havy used video streams icm birthday queen will also had influence. Ron From benoit.minisini at ...2... Sun Apr 30 00:14:44 2006 From: benoit.minisini at ...2... (Benoit Minisini) Date: Sun, 30 Apr 2006 00:14:44 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604300008.58819.ronstk@...239...> References: <200604291936.35425.ronstk@...239...> <200604292341.29578.benoit.minisini@...2...> <200604300008.58819.ronstk@...239...> Message-ID: <200604300014.44212.benoit.minisini@...2...> On Sunday 30 April 2006 00:08, ron wrote: > > May I suggest in that case to add a method .UseTable(tablename as string) > that do the "select * from tablename" and a .MoveFirst() automatic. > In that way you can direct use the Result without additional commands. > > hResult = hConn.UseTable("mytable") > for each hResult > print hResult["fieldname"] ' do something > next > Do 'hResult = hConn.Find("mytable")', that's all. Use DB.Debug=TRUE to understand what DB.Create(), DB.Find(), DB.Edit(), and Result.Update() do. Regards, -- Benoit Minisini From ronstk at ...239... Sun Apr 30 00:27:21 2006 From: ronstk at ...239... (ron) Date: Sun, 30 Apr 2006 00:27:21 +0200 Subject: [Gambas-user] prb:Connection.Exec() bypass sql code In-Reply-To: <200604300014.44212.benoit.minisini@...2...> References: <200604291936.35425.ronstk@...239...> <200604300008.58819.ronstk@...239...> <200604300014.44212.benoit.minisini@...2...> Message-ID: <200604300027.21602.ronstk@...239...> On Sunday 30 April 2006 00:14, Benoit Minisini wrote: > On Sunday 30 April 2006 00:08, ron wrote: > > > > May I suggest in that case to add a method .UseTable(tablename as string) > > that do the "select * from tablename" and a .MoveFirst() automatic. > > In that way you can direct use the Result without additional commands. > > > > hResult = hConn.UseTable("mytable") > > for each hResult > > print hResult["fieldname"] ' do something > > next > > > > Do 'hResult = hConn.Find("mytable")', that's all. Not look at that one, as the name did suggest me something else with true/false or a index in the hConn.Tables as return. > > Use DB.Debug=TRUE to understand what DB.Create(), DB.Find(), DB.Edit(), and > Result.Update() do. > > Regards, > enough stuff to play/search/try the next steps. Thanks, Ron From maillists at ...1367... Sun Apr 30 08:56:57 2006 From: maillists at ...1367... (GuruLounge - MailLists) Date: Sat, 29 Apr 2006 23:56:57 -0700 Subject: [Gambas-user] Unscribe In-Reply-To: <1146331958.4452.0.camel@...37...> References: <6c208f950604280054h5c7727e0n235f583c3fad66ce@...627...> <200604281310.21832.ronstk@...239...> <200604282221.07940.benoit.minisini@...2...> <200604291925.38000.ronstk@...239...> <1146331958.4452.0.camel@...37...> Message-ID: <1146380217.27498.0.camel@...1368...> Is that like "unwrite"? Jeff On Sat, 2006-04-29 at 19:32 +0200, Adrian Debbeler wrote: > Unscribe > > > -- .^. /V\ /( )\ ^^-^^ Linux Advocate