Re: [lazarus] Lazarus and InstantObjects ?
On 10/11/2007, Al Boldi <[EMAIL PROTECTED]> wrote: > > You don't need to do this. Eg: create a form without code or non-visual > > components, bind BO attributes and components in a single line, and the > > MVP will do the rest for you using informations from the model. > > Sure, this is great when you are working with a disconnected presentation > layer like a web interface. But for native apps, you don't need this, > because your presentation layer is already connected to your model via > TForm. I've lost you there. Why don't you need something like that? You should never be mixing your BOM (business object model) with your presentation layer. Borland didn't help this much be DB-aware components and developers slapping loads of business rules in the Forms directly. A GUI is the presentation layer. A Web interface is another. Separating the BOM and the presentation layer you can have one application that can server a standard GUI or Web interface. We have such a product. And the business rules are maintained in a single location. So if we change a text entry validation rule, it gets automatically applied to both the GUI and Web application. Because we have not business rules in our forms. This also makes unit testing much easier. I don't use MVP, but instead MGM (Model-GUI-Mediator) which is an alternative to MVP. I used it extensively with tiOPF in our products. I wrote mediators for LCL and fpGUI which can make any standard (non-db) component object aware without sub-classing. http://www.atug.com/andypatterns/mgm.htm Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
I would try using the Parent property. What's the difference between Parent and ParentWindow? -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Canvas.clBackground ?
I tried to create moving objects. drawing in blue; drawind in background-color, drawing again in a slightly changes Position, I use - lazarus 0.9.15 beta - debian Problem : what is the color of the background of a (normal) form? clBackground doesn't fit (it's clteal?) The different grays dont match. In wich way i may setr the Background-Color? Friedrich -- Lernen ist wie das Rudern gegen den Strom; sobald man aufhört, treibt man zurück Benjamin Britten _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: Anybody using FVWM window manager?
On 09/11/2007, Micha Nelissen <[EMAIL PROTECTED]> wrote: > > My opinion is that modal forms are buggy in gtk/X. For me, they are > present on all desktops, which is not what I want. The behavior I described was visible in many apps. fpGUI (not gtk based), Firefox (not sure if they use gtk), FlameRobin whith is Qt based and Lazarus (gtk1 based on my system). On all desktops? You mean your virtual desktops and taskbars? I haven't noticed that behavior on my Ubuntu machine running IceWM, FVWM2 and Gnome (I think. I'll have to confirm on Monday). Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: Anybody using FVWM window manager?
On 09/11/2007, Giuliano Colla <[EMAIL PROTECTED]> wrote: > (such as splash screens), and in that case they stay above any other > window, but they will show in all desktops. Happens with Gtk, and with > Qt also, because it's an X11 spec. I haven't implemented a dedicated splash screen class in fpGUI yet. Do you have a X11 reference for me, explaining that behaviour. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Hello Felipe, I would try using the Parent property. What's the difference between Parent and ParentWindow? Thanks for the tip, but I tried that already. Parent needs a TWinControl, which I don't have. I only have the window handle. I tried FindControl(Handle : THandle) : TWinControl (or similar, don't remember exactly from memory), but it only returned nil. Having a look at the FindControl() code, it seems as if it was just querying a list of self instancieted TWinControl descendants. Having another look at the code I found another constructor TWinControl.CreateParented(Handle : THandle) useful. It exactly allows me to specify and set the private fParentedWindow property of a TWinControl element. However a) I can't just recreate that form, since it already exists and b) even in one test, where I recreated the form it fails (the behavior is that the form is located always on pixel (0, 0) of my screen). The second thing is: I don't know how to do it platform independent. I know since the SDK I'm using also exists on the mac and on linux, that it must work similar, but rewriting the SDK in pascal from scratch I do not have a clue how to do this. The rest (of my translated SDK) works perfectly fine, but this tiny problem stops me from using it. Kind regards, Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus and InstantObjects ?
Graeme Geldenhuys wrote: > On 10/11/2007, Al Boldi <[EMAIL PROTECTED]> wrote: > > > You don't need to do this. Eg: create a form without code or > > > non-visual components, bind BO attributes and components in a single > > > line, and the MVP will do the rest for you using informations from the > > > model. > > > > Sure, this is great when you are working with a disconnected > > presentation layer like a web interface. But for native apps, you don't > > need this, because your presentation layer is already connected to your > > model via TForm. > > I've lost you there. Why don't you need something like that? You > should never be mixing your BOM (business object model) with your > presentation layer. Borland didn't help this much be DB-aware > components and developers slapping loads of business rules in the > Forms directly. This is a big misconception. The fact that TForm has the ability to host business rules and whatever else does not mean that you have to do it this way. You can maintain whatever model you like with TForm, for the mere fact that it's event-driven. > A GUI is the presentation layer. A Web interface is > another. Separating the BOM and the presentation layer you can have > one application that can server a standard GUI or Web interface. We > have such a product. And the business rules are maintained in a > single location. So if we change a text entry validation rule, it gets > automatically applied to both the GUI and Web application. Because we > have not business rules in our forms. This also makes unit testing > much easier. Yes, if your requirements are such that they call for a disconnected presentation layer, then you have a case to use an MVP. But again, don't let the TForm name mislead you into thinking that the TForm is about the presentation layer only. It's a lot more than that. It's about an event driven approach that happens to easily and directly inline the presentation layer. You don't have to use this layer if you don't like to, and you could conceivably create a disconnected model based on TForms much like the MVP, but this would increase code complexity a lot, so you would only want to do it when absolutely necessary. > I don't use MVP, but instead MGM (Model-GUI-Mediator) which is an > alternative to MVP. I used it extensively with tiOPF in our products. > I wrote mediators for LCL and fpGUI which can make any standard > (non-db) component object aware without sub-classing. > > http://www.atug.com/andypatterns/mgm.htm Sounds interesting. Does it feature a WebPresentation proxy? Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
To me it seams like this would require being implemented on LCL level. If you wish to follow this road we can guide you. I would say it would require adding a new widgetset function which needs to be implemented for all widgetsets. This function would reparent a form given just a system handle. Is the interface of your SDK fixed? I mean, can't you ask users of the SDK to pass a TForm or something instead of a system handle? -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Felipe Monteiro de Carvalho schrieb: Is the interface of your SDK fixed? I mean, can't you ask users of the SDK to pass a TForm or something instead of a system handle? Yes, it is fixed (it's the VST Plugin SDK). I also have written some host code for these plugins, but since the specification is fixed, I have to live with that limitation. To me it seams like this would require being implemented on LCL level. If you wish to follow this road we can guide you. I would say it would require adding a new widgetset function which needs to be implemented for all widgetsets. This function would reparent a form given just a system handle. Yes I'd wish to do so. I have windows and OSX here (I guess I can test the GTK part in OSX). What I don't have is much time, so I'd really like to only implement that function. Do you have a link where I can find instructions about how to do so? I already tried it once, but I had to recompile the LCL quite often and I probably lost patience. Thanks for the helping hand, Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
> Yes I'd wish to do so. I have windows and OSX here (I guess I can test > the GTK part in OSX). What I don't have is much time, so I'd really like > to only implement that function. Do you have a link where I can find > instructions about how to do so? I don't think there are instructions. I just made a commit where I added a new function to TWSCustomTrayIcon, called ShowBalloonHint: http://www.freepascal.org/cgi-bin/viewcvs.cgi?root=lazarus&rev=12809&view=rev You can study it and see which places were altered. Would would need to do something similar. Where is ParentWindow declared? TCustomForm? > I already tried it once, but I had to recompile the LCL quite often and > I probably lost patience You will have to rebuild lcl sometimes to do this, and also to test and fix if it's wrong. -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: Anybody using FVWM window manager?
Graeme Geldenhuys wrote: On 09/11/2007, Giuliano Colla <[EMAIL PROTECTED]> wrote: (such as splash screens), and in that case they stay above any other window, but they will show in all desktops. Happens with Gtk, and with Qt also, because it's an X11 spec. I haven't implemented a dedicated splash screen class in fpGUI yet. Do you have a X11 reference for me, explaining that behaviour. I came to this conclusion by trial and error. Many trials and many errors! :( Then I stumbled into an X11 manual page which, in a somewhat obscure language, roughly explained what I had found out. I'll try and locate again it for you. But hopes are scant. Giuliano -- Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde) _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
I realize if i want unicode support i must use units "Laz_DOM", "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", XMLWrite". -- Valdas Jankūnas _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
Valdas Jankūnas schreef: I realize if i want unicode support i must use units "Laz_DOM", "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", XMLWrite". Which is contrary to what I would expect (although I think it may be true). The FP units use widestring internally, the Lazarus units ansistring, which may hold UTF-8 encoded strings. Did you use UTF8Decode / UTF8Encode when you passed your UTF8 encoded strings to the widestring properties of the FP units? Vincent P.S. please remove the reply to header. _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
On Sat, 10 Nov 2007 13:01:55 +0100 "Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote: > > Yes I'd wish to do so. I have windows and OSX here (I guess I can > > test the GTK part in OSX). What I don't have is much time, so I'd > > really like to only implement that function. Do you have a link > > where I can find instructions about how to do so? > > I don't think there are instructions. I just made a commit where I > added a new function to TWSCustomTrayIcon, called ShowBalloonHint: > > http://www.freepascal.org/cgi-bin/viewcvs.cgi?root=lazarus&rev=12809&view=rev > > You can study it and see which places were altered. Would would need > to do something similar. > > Where is ParentWindow declared? TCustomForm? > > > I already tried it once, but I had to recompile the LCL quite often > > and I probably lost patience > > You will have to rebuild lcl sometimes to do this, and also to test > and fix if it's wrong. I think ParentWindow is very widgetset specific (see below). Probably it will work cross platform very limited. See at end for an alternative solution. - AFAIK under winapi you can stack handles even of different processes. gtk does not allow this. I don't know about qt, carbon, fpgui, but probably they all have some limitations of child/parent relationships. - the LCL handles messages and delegates them downwards and upwards to parents/childs TControls. But if the Handle has no associated TWinControl then messages can not be passed this way. Only the widgetset knows how to handle this. You must check every place where a handle is used if it is a normal LCL handle or a foreign handle. This will be a lot of work. Solution: It is probably easier to create a wrapper TWinControl / TCustomForm with the ability to use the foreign Handle. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus and InstantObjects ?
Al Boldi wrote: Joao Morais wrote: Al Boldi wrote: Of course you are not caching any relational data, but you said that you are using a connection broker to the rdb, which caches the rdb data, which means extra overhead. Hmmm... the rdb or the suite that access the rdb caching data means extra resource usage I think, on behalf of performance. Exactly. But you wouldn't want to do this caching twice. I think my comment wasn't fair. First: the suite doesn't cache data, the OPF opens an unidirectional dataset, read all records and release it. The connection manager has the ability to prepare and unprepare datasets, but this feature wasn't implemented yet (iirc). Database does cache and I personally don't mind. If you don't want db cache (??), you just need to change its configuration. Ok, I had a quick look through the docs, and it seems that you have the design tightly coupled to the MVP. The MVP _is_ the design, or even better, is the presentation framework. Oh, I meant the OPF design. Is it possible to isolate the OPF from the MVP? Ah yes, they are completely decoupled. You can: var VClient: TClient; VClientList: TPressProxyList; begin VClient := TClient.Create; // or VClient := TClient.Retrieve('1'); // or VClientList := PressOPFService.OQLQuery( 'select * from TClient where name = ''SomeName'''); if VClientList.Count > 0 then VClient := VClientList[0].Instance as TClient; // or use a query class // and then VClient.Name := 'AnotherName'; VClient.Store; VClient.Free; // with respective try/finally, of course end; Is there a way to directly attach LCL objects to your OPF? You don't need to do this. Eg: create a form without code or non-visual components, bind BO attributes and components in a single line, and the MVP will do the rest for you using informations from the model. Sure, this is great when you are working with a disconnected presentation layer like a web interface. But for native apps, you don't need this, because your presentation layer is already connected to your model via TForm. So what we need is for a TForm to directly connect to the OPF without going through the redundant MVP framework. Is this possible? Redundand!? No, no! You simply cannot compare a form with three combos and two grids between dbware and mvp approaches. The former will eat five groups of data access components, shortcuts to include some funcionality and a lot of time to configure and debug everything. MVP will eat five lines of code, nothing more. The same model that will manage this controls, will also generate the DDL necessary to build the database metadata for you. BTW, as I said, the MVP would be great for a disconnected presentation layer like in web development, so it would be really useful to have an MVP to WebPresentation proxy. Does your MVP include this feature? No web features atm, it is included in the 2.0 roadmap though. Also, I tried to compile the demo, but it gives this error: ObjectModel.pas(23,3) Error: Only class which are compiled in $M+ mode can be published I think I have fixed this annoying issue. Just place $M+/$M- around the forward class declaration, or include a $M+ on the top of the unit. Notes: There are known issues with combobox and the F2 shortcut that I have not workarounded to the LCL interface (VCL interface is nice). They are registered in the Lazarus tracker. I am refactoring the demo app in order to use some new features, take a look at the project page now and then. -- Joao Morais _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Sat, 10 Nov 2007 13:25:52 +0100 Vincent Snijders <[EMAIL PROTECTED]> wrote: > Valdas Jankūnas schreef: > > I realize if i want unicode support i must use units "Laz_DOM", > > "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", > > XMLWrite". > > > Which is contrary to what I would expect (although I think it may be > true). Many people expect contrary. That's the reason why the UTF8/16 discussions come up so often. The above is just proving that UTF-8 works with nearly no special code because of its ansistring compatibility. > The FP units use widestring internally, the Lazarus units > ansistring, which may hold UTF-8 encoded strings. Yes. Here are the main differences: the laz_XXX units use plain ansistrings, which work with UTF-8. The IDE and LCL use UTF-8 too. They are often much faster. But they lack some DOM features. They are only tested and maintained for simple xml documents. > Did you use UTF8Decode / UTF8Encode when you passed your UTF8 encoded > strings to the widestring properties of the FP units? Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Mattias Gaertner wrote: > I think ParentWindow is very widgetset specific (see below). Probably > it will work cross platform very limited. See at end for an > alternative solution. > > - AFAIK under winapi you can stack handles even of different processes. > gtk does not allow this. I don't know about qt, carbon, fpgui, but > probably they all have some limitations of child/parent relationships. Actually the gtk does support this, but in a really hacky way, using GTKSocket/GTKPlug. > - the LCL handles messages and delegates them downwards and upwards to > parents/childs TControls. But if the Handle has no associated > TWinControl then messages can not be passed this way. Only the > widgetset knows how to handle this. You must check every place where a > handle is used if it is a normal LCL handle or a foreign handle. This > will be a lot of work. > > Solution: > It is probably easier to create a wrapper TWinControl / TCustomForm > with the ability to use the foreign Handle. Correct; all that is needed is a SetParent(hWnd) method. Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Ok, just for the records: I tried to do it with TWinForm.CreateParented(ParentWindow: hwnd), but I get an access violation. So that does not work. I think ParentWindow is very widgetset specific (see below). Probably it will work cross platform very limited. Ok, thanks for the information. I'm willing to find a cross platform solution, so I don't necessary need to go that ParentWindow road. Solution: It is probably easier to create a wrapper TWinControl / TCustomForm with the ability to use the foreign Handle. I just had a look at the wincontrol.inc and I already found this: {-- TWinControl CreateParentedControl --} class function TWinControl.CreateParentedControl(ParentWindow: hwnd): TWinControl; begin // ToDo Result:=nil; end; Is this what you thought of? I mean it's still pretty "ToDo", but I guess the structure is already there. Now all I need to do is fill it with live. Any ideas? Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
On Sat, 10 Nov 2007 15:55:38 +0300 Al Boldi <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: > > I think ParentWindow is very widgetset specific (see below). > > Probably it will work cross platform very limited. See at end for an > > alternative solution. > > > > - AFAIK under winapi you can stack handles even of different > > processes. gtk does not allow this. I don't know about qt, carbon, > > fpgui, but probably they all have some limitations of child/parent > > relationships. > > Actually the gtk does support this, but in a really hacky way, using > GTKSocket/GTKPlug. I see. So, you need special handles under gtk, while winapi allows nearly any window handle. Then I guess, ParentWindow will be far too complicated to implement cross platform in a generic way. > > > - the LCL handles messages and delegates them downwards and upwards > > to parents/childs TControls. But if the Handle has no associated > > TWinControl then messages can not be passed this way. Only the > > widgetset knows how to handle this. You must check every place > > where a handle is used if it is a normal LCL handle or a foreign > > handle. This will be a lot of work. > > > > Solution: > > It is probably easier to create a wrapper TWinControl / TCustomForm > > with the ability to use the foreign Handle. > > Correct; all that is needed is a SetParent(hWnd) method. Huh? Maybe my statement was not clear: The Parent/Child connection is the main problem. It would be easier to handle the child/parent relationship by the LCL and keep the 1:1 mapping between controls and handles. So, all that is needed is a TForeignHandleControl with a SetHandle method. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Right now I have made it very simple and as expected it doesn't work. I implemented it as: {-- TWinControl CreateParentedControl --} class function TWinControl.CreateParentedControl(ParentWindow: hwnd): TWinControl; begin Result := TWinControl.CreateParented(ParentWindow); end; I guess I have to dig a bit deeper into the OS-APIs to see how the handle stuff works. For Windows I can probably use the Windows.SetParent(...), but I'm not sure. Any hints? Do I really need to implement a new TForeignHandleControl class? Kind regards, Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
On Sat, 10 Nov 2007 14:41:18 +0100 Christian Budde <[EMAIL PROTECTED]> wrote: > Right now I have made it very simple and as expected it doesn't work. > I implemented it as: > > {-- > TWinControl CreateParentedControl > --} > class function TWinControl.CreateParentedControl(ParentWindow: hwnd): > TWinControl; > begin > Result := TWinControl.CreateParented(ParentWindow); > end; > > I guess I have to dig a bit deeper into the OS-APIs to see how the > handle stuff works. For Windows I can probably use the > Windows.SetParent(...), but I'm not sure. > > Any hints? Do I really need to implement a new TForeignHandleControl > class? If you only need a reparented control, that will not get focus, get incorrect mouse and keyboard events and will likely crash, then it is easier to implement only CreateParented. ;) That's because the biggest part of the LCL and the LCL interfaces expects LCL controls. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus and InstantObjects ?
Joao Morais wrote: > Al Boldi wrote: > > Oh, I meant the OPF design. Is it possible to isolate the OPF from the > > MVP? > > Ah yes, they are completely decoupled. You can: > > var >VClient: TClient; >VClientList: TPressProxyList; > begin >VClient := TClient.Create; >// or >VClient := TClient.Retrieve('1'); >// or >VClientList := PressOPFService.OQLQuery( > 'select * from TClient where name = ''SomeName'''); >if VClientList.Count > 0 then > VClient := VClientList[0].Instance as TClient; >// or use a query class > >// and then >VClient.Name := 'AnotherName'; >VClient.Store; >VClient.Free; // with respective try/finally, of course > end; Looks neat. Can you give a more complete example based on a simple TPerson db with 2 fields: id, name > > Sure, this is great when you are working with a disconnected > > presentation layer like a web interface. But for native apps, you don't > > need this, because your presentation layer is already connected to your > > model via TForm. So what we need is for a TForm to directly connect to > > the OPF without going through the redundant MVP framework. Is this > > possible? > > Redundand!? No, no! You simply cannot compare a form with three combos > and two grids between dbware and mvp approaches. The former will eat > five groups of data access components, shortcuts to include some > funcionality and a lot of time to configure and debug everything. MVP > will eat five lines of code, nothing more. The same model that will > manage this controls, will also generate the DDL necessary to build the > database metadata for you. Well, your demo phone app doesn't look so simple. Maybe you can just create a mini app with just 2 fields: id name , with dbnav/edit-buttons. > > BTW, as I said, the MVP would be great for a disconnected presentation > > layer like in web development, so it would be really useful to have an > > MVP to WebPresentation proxy. Does your MVP include this feature? > > No web features atm, it is included in the 2.0 roadmap though. Great. Keep us posted. > > Also, I tried to compile the demo, but it gives this error: > > ObjectModel.pas(23,3) Error: Only class which are compiled in $M+ mode > > can be published > > I think I have fixed this annoying issue. Just place $M+/$M- around the > forward class declaration, or include a $M+ on the top of the unit. Still doesn't work. But I just moved the default published fields into public and it compiles and runs, but then I get this dialog: No service 'Messages' assigned or registered So I turn {$DEFINE UsePressOPF} on and then I get this ../Press/Source/Brokers/PressSQLdbBroker.pas(48,16) Error: Identifier not found "TSQLConnector" > Notes: There are known issues with combobox and the F2 shortcut that I > have not workarounded to the LCL interface (VCL interface is nice). They > are registered in the Lazarus tracker. I am refactoring the demo app in > order to use some new features, take a look at the project page now and > then. Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] what is this package error message
On Fri, 9 Nov 2007 16:12:02 -0600 (CST) Jesus Reyes <[EMAIL PROTECTED]> wrote: > > --- wile64 <[EMAIL PROTECTED]> escribió: > > > > Strange. > > > Normally if you open a package and install it the IDE saves the > > > found .lpk files to packagefiles.xml. > > > Either this file was not written or it not read on restart. > > I can reproduce the problem under linux too, here it first fails with > package pascalscript, this section is from .lazarus/packagefiles.xml > > > > >Value="/pascalscript/Source/pascalscript.lpk"/> > > > of course /pascalscript/Source/pascalscript.lpk > exists and righs are ok. I added a dialog to see the current list of package links. IDE / View / IDE internals / Package links ... Can you take a look and see if pascalscript is there? And analog for pkg_gifanim. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Sat, 10 Nov 2007, Valdas Jankūnas wrote: > I realize if i want unicode support i must use units "Laz_DOM", > "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", XMLWrite". This is not correct. DOM/XMLRead/XMLWrite are written 100% with WideStrings. However: Linux does not support widestrings out-of-the-box. To enable widestring support for DOM/XMLRead/XMLWrite on linux, you must insert cwstring in the uses clause of your program. That's it. The DOM units will pick this up. Michael.
Re: XML and UTF-8
On Sat, 10 Nov 2007 15:25:05 +0100 (CET) Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > On Sat, 10 Nov 2007, Valdas Jankūnas wrote: > > > I realize if i want unicode support i must use units "Laz_DOM", > > "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", > > XMLWrite". > > This is not correct. DOM/XMLRead/XMLWrite are written 100% with > WideStrings. > > However: Linux does not support widestrings out-of-the-box. > To enable widestring support for DOM/XMLRead/XMLWrite on linux, > you must insert cwstring in the uses clause of your program. > That's it. The DOM units will pick this up. The source code is UTF-8. Are you sure, that cwstrings works under linux with an ISO charset as default? And what about windows, if the codepage is 1251 (or whatever non UTF-8)? Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Hello Mattias, If you only need a reparented control, that will not get focus, get incorrect mouse and keyboard events and will likely crash, then it is easier to implement only CreateParented. ;) I not sure if I understand correctly what you meant with this. For sure I don't want it to crash and I want something that gets the focus, but I'm nearly a complete newbie here and thus I need some constructive help. So what is the best way to accomplish my goal? As far as I understood everything you wrote before, I do need to write a descendant of TWinControl, that behalves like a normal LCL control (gets the focus and other events) but also has the ability to reparent another control only given by a handle. In the original SDK the handle reads something like this: void * systemWindow platform-dependent parent window (HWND or WindowRef) so it seems as if this isn't very platform-independent in the original spec. I wonder how they do it on OSX and Linux (which are both supported platforms)... Thanks for the help so far, Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Lazarus and InstantObjects ?
Al Boldi wrote: You simply cannot compare a form with three combos and two grids between dbware and mvp approaches. The former will eat five groups of data access components, shortcuts to include some funcionality and a lot of time to configure and debug everything. MVP will eat five lines of code, nothing more. The same model that will manage this controls, will also generate the DDL necessary to build the database metadata for you. Well, your demo phone app doesn't look so simple. I wasn't very happy with this app, it is being refactored. After all: 1. the project still lacks an expert and better docs; 2. even without an expert, after learn all steps everything comes clear (and amusing if you are an oop guy ;)); 3. You need to be familiar with OOP, with or without an expert. It's harder to start a project, eg you need to write more code to see some result, but after write the core classes it is more simple to extend and maintain. Maybe you can just create a mini app with just 2 fields: id name , with dbnav/edit-buttons. Yup. This one, a wiki and a tutorial are in the plans. BTW, as I said, the MVP would be great for a disconnected presentation layer like in web development, so it would be really useful to have an MVP to WebPresentation proxy. Does your MVP include this feature? No web features atm, it is included in the 2.0 roadmap though. Great. Keep us posted. Sure. Can you give a more complete example based on a simple TPerson db with 2 fields: id, name === I think I have fixed this annoying issue. Just place $M+/$M- around the forward class declaration, or include a $M+ on the top of the unit. Still doesn't work. But I just moved the default published fields into public and it compiles and runs, but then I get this dialog: No service 'Messages' assigned or registered So I turn {$DEFINE UsePressOPF} on and then I get this ../Press/Source/Brokers/PressSQLdbBroker.pas(48,16) Error: Identifier not found "TSQLConnector" I think this is even more off topic here. Would you mind to move questions directly to me, or to the support mailing list so others interested in this thread can follow. -- Joao Morais _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Mattias Gaertner wrote: > Maybe my statement was not clear: The Parent/Child connection is the > main problem. It would be easier to handle the child/parent > relationship by the LCL and keep the 1:1 mapping between controls and > handles. > So, all that is needed is a TForeignHandleControl with a SetHandle > method. Still not clear what you mean. Maybe like this: TForeignHandleControl(x).SetHandle:=hWnd; then: form1.parent:=TForeignHandleControl(x).SetHandle; or : TForeignHandleControl(x).Setparent:=form1.hWnd; Thanks! -- Al _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
Vincent Snijders rašė: Valdas Jankūnas schreef: I realize if i want unicode support i must use units "Laz_DOM", "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", XMLWrite". Which is contrary to what I would expect (although I think it may be true). The FP units use widestring internally, the Lazarus units ansistring, which may hold UTF-8 encoded strings. Did you use UTF8Decode / UTF8Encode when you passed your UTF8 encoded strings to the widestring properties of the FP units? Thanks for tip, UTF8Decode solved my problem. Vincent P.S. please remove the reply to header. ...done -- Valdas Jankūnas _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Nov 10, 2007 3:31 PM, Mattias Gaertner <[EMAIL PROTECTED]> wrote: > The source code is UTF-8. Are you sure, that cwstrings works under > linux with an ISO charset as default? And what about windows, if the > codepage is 1251 (or whatever non UTF-8)? Under windows it will usually work because of a coincidence which seams to work on most cases. SynEdit usually won't add a BOM, so FPC thinks the file is encoded in ansi, and then at run-time it identifyes the system as using ansi too, so it doesn't convert, and it doesn't mess the utf-8 strings. Unintuitively, the utf-8 code get's messed if you add a BOM marker to the source code. More information here: http://www.freepascal.org/mantis/view.php?id=9305 -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] ParentWindow
Christian Budde wrote: Ok, just for the records: I tried to do it with TWinForm.CreateParented(ParentWindow: hwnd), but I get an access violation. So that does not work. I think ParentWindow is very widgetset specific (see below). Probably it will work cross platform very limited. Ok, thanks for the information. I'm willing to find a cross platform solution, so I don't necessary need to go that ParentWindow road. Solution: It is probably easier to create a wrapper TWinControl / TCustomForm with the ability to use the foreign Handle. I just had a look at the wincontrol.inc and I already found this: {-- TWinControl CreateParentedControl --} class function TWinControl.CreateParentedControl(ParentWindow: hwnd): TWinControl; begin // ToDo Result:=nil; end; Is this what you thought of? I mean it's still pretty "ToDo", but I guess the structure is already there. Now all I need to do is fill it with live. Any ideas? The main reason it exists is delphi compatebility. Using this function instead of using windows.SetParent has the advantage that the VCL/LCL knows that the parent is not a VCL/LCL control so it can do special things. I think on win32 for sure and on X or OSX it is doable. However I think it will take loads of time to debug the LCL prevent it to assume that a parent always is a LCL control. And the result will always have less functionality that when it has a real LCL parent. Even in delphi this is the case. So it is a lot of effort for something with limited functionality and limited use. I rather spend my time on other things. Marc Christian _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Sat, 10 Nov 2007, Mattias Gaertner wrote: > On Sat, 10 Nov 2007 15:25:05 +0100 (CET) > Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > > > > > On Sat, 10 Nov 2007, Valdas Jankūnas wrote: > > > > > I realize if i want unicode support i must use units "Laz_DOM", > > > "Laz_XMLRead", "Laz_XMLWrite" instead of FP "DOM", "XMLRead", > > > XMLWrite". > > > > This is not correct. DOM/XMLRead/XMLWrite are written 100% with > > WideStrings. > > > > However: Linux does not support widestrings out-of-the-box. > > To enable widestring support for DOM/XMLRead/XMLWrite on linux, > > you must insert cwstring in the uses clause of your program. > > That's it. The DOM units will pick this up. > > The source code is UTF-8. Are you sure, that cwstrings works under > linux with an ISO charset as default? And what about windows, if the > codepage is 1251 (or whatever non UTF-8)? This, I don't know. cwstrings is for Linux only. As far as ISO is concerned, I assume that the reader code takes care of correct conversion ? Michael.
Re: XML and UTF-8
> On Sat, 10 Nov 2007, Mattias Gaertner wrote: > > > > The source code is UTF-8. Are you sure, that cwstrings works under > > linux with an ISO charset as default? And what about windows, if the > > codepage is 1251 (or whatever non UTF-8)? > > This, I don't know. cwstrings is for Linux only. Afaik it works fine on FreeBSD. (Darwin?) _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Sat, 10 Nov 2007, Felipe Monteiro de Carvalho wrote: > On Nov 10, 2007 3:31 PM, Mattias Gaertner <[EMAIL PROTECTED]> wrote: > > The source code is UTF-8. Are you sure, that cwstrings works under > > linux with an ISO charset as default? And what about windows, if the > > codepage is 1251 (or whatever non UTF-8)? > > Under windows it will usually work because of a coincidence which > seams to work on most cases. SynEdit usually won't add a BOM, so FPC > thinks the file is encoded in ansi, and then at run-time it identifyes > the system as using ansi too, so it doesn't convert, and it doesn't > mess the utf-8 strings. > > Unintuitively, the utf-8 code get's messed if you add a BOM marker to > the source code. As far as I know, FPC has no support for a BOM marker at all ? Michael. _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Nov 10, 2007 5:49 PM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > As far as I know, FPC has no support for a BOM marker at all ? That would be inconsistent with my tests until now. http://www.freepascal.org/mantis/view.php?id=9058 -- Felipe Monteiro de Carvalho _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] Having a problem updating when packages are installed
I set up a shell program: [EMAIL PROTECTED]:~/Programs/lazarus$ cat ./updatelaz #!/bin/sh svn update export LCL_PLATFORM=gtk2; make clean all idepkg When I run this from the lazarus directory, I get the following error: Linking ../lazbuild 984 lines compiled, 6.2 sec make[2]: Leaving directory `/home/matt/Programs/lazarus/ide' make[1]: Leaving directory `/home/matt/Programs/lazarus/ide' make -C ide idepkg make[1]: Entering directory `/home/matt/Programs/lazarus/ide' make --assume-new=lazarus.pp lazarus OPT=' @/home/matt/.lazarus/idemake.cfg' make[2]: Entering directory `/home/matt/Programs/lazarus/ide' /usr/bin/ppc386 -gl -Fu../lcl/units/i386-linux -Fu../lcl/units/i386-linux/gtk2 -Fu../components/codetools/units/i386-linux -Fu../components/synedit/units/i386-linux -Fu../components/custom -Fu../components/mpaslex -Fu../ideintf/units/i386-linux -Fu../designer -Fu../designer/jitform/units/i386-linux -Fu../debugger -Fu../converter -Fu../packager -Fu../packager/units/i386-linux -Fu../units/i386-linux -Fu. -Fu/usr/lib/fpc/2.2.0/units/i386-linux/rtl -Fu/usr/lib/fpc/2.2.0/units/i386-linux/regexpr -Fiinclude -Fiinclude/linux -Fi../images -FE.. -FU../units/i386-linux -Fl/usr/lib/gcc/i686-pc-linux-gnu/4.1.2 -Fl/usr/local/lib -Fl//usr//lib/opengl/nvidia/lib -Fl/usr/i686-pc-linux-gnu/lib -Fl/usr/lib/gcc/i686-pc-linux-gnu/4.1.2 -Fl/usr/lib/gcc/i686-pc-linux-gnu/4.2.1 -Fl/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6 -Fl/usr/lib/nspr -Fl/usr/lib/nss -Fl/usr/lib/qt4 -Fl/usr/kde/3.5/lib -Fl/usr/qt/3/lib -Fl/usr/games/lib -Fl/usr/lib/bibblelabs/bibblepro/libs -Fl/usr/lib/fltk-1.1 @/home/matt/.lazarus/idemake.cfg -di386 lazarus.pp Free Pascal Compiler version 2.2.0 [2007/09/20] for i386 Copyright (c) 1993-2007 by Florian Klaempfl Target OS: Linux for i386 Compiling lazarus.pp PPU Loading /home/matt/Programs/lazarus/components/printers/lib/i386-linux/printersdlgs.ppu PPU Source: printersdlgs.pp not found PPU Source: cupsprndialogs.inc not found PPU Source: printersdlgs.lrs not found Recompiling PrintersDlgs, checksum changed for Dialogs PPU Loading /home/matt/Programs/lazarus/components/printers/lib/i386-linux/printersdlgs.ppu main.pp(74,12) Fatal: Can't find unit PrintersDlgs used by Printer4Lazarus Fatal: Compilation aborted make[2]: *** [lazarus] Error 1 make[2]: Leaving directory `/home/matt/Programs/lazarus/ide' make[1]: *** [idepkg] Error 2 make[1]: Leaving directory `/home/matt/Programs/lazarus/ide' make: *** [idepkg] Error 2 I have a couple of packages installed including Printers4Lazarus and ZeosDBO Is there something else I need to add? On Oct 31, 2007 9:08 AM, Marc Weustink <[EMAIL PROTECTED]> wrote: > Matt Henley wrote: > > I have one question. I use the zeoslib package and use lazarus from > > svn. When i do an > > svn update > > make clean all > > > > and then start lazarus, I have to rebuild from inside lazarus to get > > the zeoslib installed. Is there a way to do that when i rebuild from > > the command line? > > its in the message below :) > > > > On 10/29/07, Micha Nelissen <[EMAIL PROTECTED]> wrote: > >> Mattias Gaertner wrote: > >>> First you can try > >>> $ export LCL_PLATFORM=gtk2; make clean all idepkg > ^ > > Marc > > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives > _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: XML and UTF-8
On Sat, 10 Nov 2007, Felipe Monteiro de Carvalho wrote: > On Nov 10, 2007 5:49 PM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > As far as I know, FPC has no support for a BOM marker at all ? > > That would be inconsistent with my tests until now. > > http://www.freepascal.org/mantis/view.php?id=9058 Ah, you meant the compiler. I thought you meant the RTL. The RTL has none, the compiler has special support for it, this is correct =-) Michael. _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] Having a problem updating when packages are installed
On Sat, 10 Nov 2007 10:13:12 -0600 "Matt Henley" <[EMAIL PROTECTED]> wrote: > I set up a shell program: > > [EMAIL PROTECTED]:~/Programs/lazarus$ cat ./updatelaz > #!/bin/sh > > svn update > export LCL_PLATFORM=gtk2; make clean all idepkg >[...] After an update you must compile your packages too: make clean all lazbuild package1.lpk package2.lpk ... make idepkg Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] what is this package error message
2007/11/10, Mattias Gaertner <[EMAIL PROTECTED]>: > > On Fri, 9 Nov 2007 16:12:02 -0600 (CST) > Jesus Reyes <[EMAIL PROTECTED]> wrote: > > > > > --- wile64 <[EMAIL PROTECTED]> escribió: > > > > > > Strange. > > > > Normally if you open a package and install it the IDE saves the > > > > found .lpk files to packagefiles.xml. > > > > Either this file was not written or it not read on restart. > > > > I can reproduce the problem under linux too, here it first fails with > > package pascalscript, this section is from .lazarus/packagefiles.xml > > > > > > > > > >> Value="/pascalscript/Source/pascalscript.lpk"/> > > > > > > of course /pascalscript/Source/pascalscript.lpk > > exists and righs are ok. > > I added a dialog to see the current list of package links. IDE / View / > IDE internals / Package links ... > > Can you take a look and see if pascalscript is there? > > And analog for pkg_gifanim. > > > Mattias > > Yes it is, but since yesterday it work, we should see with the error, but impossible to repeat. Thanks, Laurent. French Forum : http://lazforum-fr.tuxfamily.org/index.php
Re: [lazarus] Lazarus and InstantObjects ?
On 10/11/2007, Al Boldi <[EMAIL PROTECTED]> wrote: > > This is a big misconception. The fact that TForm has the ability to host > business rules and whatever else does not mean that you have to do it this > way. You can maintain whatever model you like with TForm, for the mere fact > that it's event-driven. And that's where the problem comes in. Borland gave developers DB-Aware components with all these great events to hook into. They simply guide the developer into adding code into the forms, mixing business rules with the presentation layer. I've maintained enough Delphi code from multiple projects in my career and every app designed with DB-Aware components have business rules embedded in the forms. >From specific filters to calculated fields, hard coded SQL etc... Not to mention all these DB-Aware components tie you into a specify database structure due to hard coded field names used in the components + tying you to a specific component vendor. DB-Aware components are great for quick prototyping, but that's about it. But hey, this is a totally separate topic that can go on forever OPF's vs DB-Aware components. > Yes, if your requirements are such that they call for a disconnected > presentation layer, then you have a case to use an MVP. Business rules should *always* be disconnected from the presentation layer! They are separate layers to start with. > the presentation layer. You don't have to use this layer if you don't like > to, and you could conceivably create a disconnected model based on TForms Yes it might be possible, but in my career I am still waiting to see a DB-Aware based application where the layers are neatly separated. > > Sounds interesting. Does it feature a WebPresentation proxy? Mediators are very easy to implement. Unfortunately I cannot share more code than I have in the tiOPF project due to IP held by my employer. My MGM implementation as show in tiOPF uses RTTI extensively so is slightly different to the design mentioned in Andy's article. The end result is the same. To me, MGM sits somewhere between MVC and MVP. A nice middle ground and very easy to implement. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] how to path of active project?
Hi, In design, In design, how to path of active project? Expandfilepath alway /lazarus/ Thanks -- Laurent. French Forum : http://lazforum-fr.tuxfamily.org/index.php