From gambas.fr at ...176... Wed Jan 7 16:46:28 2015 From: gambas.fr at ...176... (Fabien Bodard) Date: Wed, 7 Jan 2015 16:46:28 +0100 Subject: [Gambas-devel] Gridview Border Message-ID: A little bug... see the screenshot -- Fabien Bodard -------------- next part -------------- A non-text attachment was scrubbed... Name: capture13.png Type: image/png Size: 17184 bytes Desc: not available URL: From willy at ...732... Thu Jan 15 21:12:40 2015 From: willy at ...732... (Willy Raets) Date: Thu, 15 Jan 2015 21:12:40 +0100 Subject: [Gambas-devel] Possible usefull addition to Gambas? Message-ID: <1421352760.5293.1.camel@...735...> Hi all, I have been running into trouble with localisation making certain Linux folder names being different, depending on language. Like folder Desktop is not Desktop for all languages so when doing User.Home &/ "Desktop" your application gets into trouble on for example a system running Dutch where "Desktop" folder becomes "Bureaublad" folder. I have solved this problem with creating a function in my Gambas library that gets the proper folder named based on the local language settings. I think it might be a good addition for the User class to for example have User.DesktopFolder return the User Desktop folder path taking into account localisation. The function is as follows (and could be added to User class): '' To convert standard linux folder names to user localised folder names.
'' Possible values for FolderName are:
'' Desktop, Documents, Download, Music, Pictures and Videos Public Function FolderLocales(FolderName As String) As String Dim sHelp As String FolderName = Upper(FolderName) Select FolderName Case "DESKTOP", "DOCUMENTS", "DOWNLOAD", "MUSIC", "PICTURES", "VIDEOS" Exec ["xdg-user-dirs-update"] Wait Exec ["xdg-user-dir", FolderName] Wait To sHelp Left(sHelp, -1) Return Left(sHelp, -1) Case Else sHelp = Subst(("Illegal argument &1 for FolderName! Use either Desktop, Documents, Download, Music, Pictures or Videos."), FolderName) Message.Error(sHelp) Error.Raise(sHelp) End Select Catch Error.Clear Return Null End Now User.DesktopFolder could return this: Return Subst(User.Home &/ "&1", FolderLocales("Desktop")) User.MusicFolder could return: Return Subst(User.Home &/ "&1", FolderLocales("Music")) and so on.... What do you think, a useful addition? -- Kind regards, Willy (aka gbWilly) http://gambasshowcase.org/ http://howtogambas.org http://gambos.org From taboege at ...176... Thu Jan 15 21:28:08 2015 From: taboege at ...176... (Tobias Boege) Date: Thu, 15 Jan 2015 21:28:08 +0100 Subject: [Gambas-devel] Possible usefull addition to Gambas? In-Reply-To: <1421352760.5293.1.camel@...735...> References: <1421352760.5293.1.camel@...735...> Message-ID: <20150115202808.GB944@...693...> On Thu, 15 Jan 2015, Willy Raets wrote: > Hi all, > > I have been running into trouble with localisation making certain Linux > folder names being different, depending on language. > > Like folder Desktop is not Desktop for all languages so when doing > User.Home &/ "Desktop" your application gets into trouble on for example > a system running Dutch where "Desktop" folder becomes "Bureaublad" > folder. > > I have solved this problem with creating a function in my Gambas library > that gets the proper folder named based on the local language settings. > > I think it might be a good addition for the User class to for example > have User.DesktopFolder return the User Desktop folder path taking into > account localisation. > > The function is as follows (and could be added to User class): > > '' To convert standard linux folder names to user localised folder > names.
> '' Possible values for FolderName are:
> '' Desktop, Documents, Download, Music, Pictures and Videos > Public Function FolderLocales(FolderName As String) As String > > Dim sHelp As String > FolderName = Upper(FolderName) > Select FolderName > Case "DESKTOP", "DOCUMENTS", "DOWNLOAD", "MUSIC", "PICTURES", > "VIDEOS" > Exec ["xdg-user-dirs-update"] Wait Maybe do this once in your _init(), not on every query? I don't have these scripts installed but from the ArchWiki[0], it seems that xdg-user-dirs-update *creates* directories. I see the following problem: when I explain workflow things in the IDE to German-only-speaking Gambas users I need to switch my IDE to German (when it's normally English). I don't want these directories to be created automatically when the IDE tries to query some directory. Normally I only keep the Documents directory anyway. I don't want to delete the others on a regular basis. A good solution would be an optional parameter EnsureExist = False per default. Then the program can decide if the existence of a particular directory is really necessary for it to function. > Exec ["xdg-user-dir", FolderName] Wait To sHelp Left(sHelp, -1) > Return Left(sHelp, -1) > Case Else > sHelp = Subst(("Illegal argument &1 for FolderName! Use either > Desktop, Documents, Download, Music, Pictures or Videos."), FolderName) > Message.Error(sHelp) > Error.Raise(sHelp) > End Select > > Catch > Error.Clear Why Error.Clear() in Catch? I haven't seen this pattern anywhere in the sources yet and grep shows that indeed this method is only used in the IDE somewhere and there not inside a Catch block. I'm curious what you want to accomplish. > Return Null > > End > > Now User.DesktopFolder could return this: > Return Subst(User.Home &/ "&1", FolderLocales("Desktop")) > > User.MusicFolder could return: > Return Subst(User.Home &/ "&1", FolderLocales("Music")) > > and so on.... > > What do you think, a useful addition? > Using xdg scripts reminds me more of gb.desktop... There are already Desktop.CacheDir and Desktop.DataDir there. Regards, Tobi [0] https://wiki.archlinux.org/index.php/Xdg_user_directories -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk From gambas at ...1... Thu Jan 15 23:55:52 2015 From: gambas at ...1... (=?windows-1252?Q?Beno=EEt_Minisini?=) Date: Thu, 15 Jan 2015 23:55:52 +0100 Subject: [Gambas-devel] Possible usefull addition to Gambas? In-Reply-To: <1421352760.5293.1.camel@...735...> References: <1421352760.5293.1.camel@...735...> Message-ID: <54B84578.6040507@...1...> Le 15/01/2015 21:12, Willy Raets a ?crit : > Hi all, > > I have been running into trouble with localisation making certain Linux > folder names being different, depending on language. > > Like folder Desktop is not Desktop for all languages so when doing > User.Home &/ "Desktop" your application gets into trouble on for example > a system running Dutch where "Desktop" folder becomes "Bureaublad" > folder. > > I have solved this problem with creating a function in my Gambas library > that gets the proper folder named based on the local language settings. > > I think it might be a good addition for the User class to for example > have User.DesktopFolder return the User Desktop folder path taking into > account localisation. > > The function is as follows (and could be added to User class): > > '' To convert standard linux folder names to user localised folder > names.
> '' Possible values for FolderName are:
> '' Desktop, Documents, Download, Music, Pictures and Videos > Public Function FolderLocales(FolderName As String) As String > > Dim sHelp As String > FolderName = Upper(FolderName) > Select FolderName > Case "DESKTOP", "DOCUMENTS", "DOWNLOAD", "MUSIC", "PICTURES", > "VIDEOS" > Exec ["xdg-user-dirs-update"] Wait > Exec ["xdg-user-dir", FolderName] Wait To sHelp Left(sHelp, -1) > Return Left(sHelp, -1) > Case Else > sHelp = Subst(("Illegal argument &1 for FolderName! Use either > Desktop, Documents, Download, Music, Pictures or Videos."), FolderName) > Message.Error(sHelp) > Error.Raise(sHelp) > End Select > > Catch > Error.Clear > Return Null > > End > > Now User.DesktopFolder could return this: > Return Subst(User.Home &/ "&1", FolderLocales("Desktop")) > > User.MusicFolder could return: > Return Subst(User.Home &/ "&1", FolderLocales("Music")) > > and so on.... > > What do you think, a useful addition? > Desktop.Path already returns the path of the current user "Desktop" directory by following the algorithm specified by the freedesktop standard. For example, on my system it returns "/home/benoit/Bureau". The same algorithm can be used when searching for the other directories ("Documents", "Download"...). So I think it's better to add methods or properties to the gb.desktop component that will return these other directories. Regards, -- Beno?t Minisini From gambas.fr at ...176... Fri Jan 16 09:54:40 2015 From: gambas.fr at ...176... (Fabien Bodard) Date: Fri, 16 Jan 2015 09:54:40 +0100 Subject: [Gambas-devel] Report Rebirth In-Reply-To: References: Message-ID: ---------- Message transf?r? ---------- De : "Fabien Bodard" Date : 15 janv. 2015 14:11 Objet : Report Rebirth ? : Cc : Hi, this is a screenshot of the render of the new report engine. It support now Margins and BoxShadow. The code can be tested in trunk/comp/src/gb.report2 I want to take my time and make the better tool i can. For today my time will be focused on the ReportGridView component which will be the equivalent to GridView. So filling code can be the same between the gridview and this widget. The only difference will be the reportgridview have no scrollbar. So pages are generates on need. In a near future i thing i will add an option to report to allow to way i want an horizontal filling or a vertical one. so pages can be generate in an horizontal way... usefull for calendar for example. But before i will be focused on the group indexation. This have been my baddest bug in the prev version, and i will not be able to simply solve it. The goal of group indexation is to allow user to duplicate a container and then all children are duplicate again in function of new count params. the fields can call the good request. It's a complex recursive problem. But the goal is great... be able to generate complex multilevel arrays. For that i will add a cache in the virtual objects to minimize the databases queries. Then i will rewrite the three last containers (column, row, fill). The reportvpanel will have a column property to fix the number of column. (the same for reporthpanel with row property) Do you think i need to blend reportImage and reportSVGImage ? (with a type detection) Do you think i need to blend ReportLabel and ReportRichLabel ? In these two case gb.report2 will never be compatible with the previous report component ... But maybe it's time to do something better. It is now the time to explain your needs, to give me example of report you want to be able to do (pdf join), Tell me what you hate and what you like in gb.report V1. I need verbose users. Best regards, -- Fabien Bodard -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: google1.png Type: image/png Size: 92022 bytes Desc: not available URL: