[Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, I wrote a little text induction feature to TCustomEdit, is is being done using LCL in Windows platform (without using Windows unit) where it works fine. The induction is the grayed text that appears in some textboxes like the attached one (taken from my windows code). To work

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Paul Ishenin
05.02.2010 19:57, JoshyFun wrote: Hello Lazarus-List, I wrote a little text induction feature to TCustomEdit, is is being done using LCL in Windows platform (without using Windows unit) where it works fine. The induction is the grayed text that appears in some textboxes like the attached one (ta

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Martin
On 05/02/2010 12:57, JoshyFun wrote: Hello Lazarus-List, I wrote a little text induction feature to TCustomEdit, is is being done using LCL in Windows platform (without using Windows unit) where it works fine. The induction is the grayed text that appears in some textboxes like the attached one

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, Friday, February 5, 2010, 2:47:20 PM, you wrote: M> why don't you override/change RealSetText (called by SetText). M> If it's empty, supply the special text (and change the color). if it M> isn't empty, change the color back (only if it was changed; if the text M> was empty be

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, Friday, February 5, 2010, 2:41:16 PM, you wrote: >> The problem is that in GTK2 this effect is not obtained as the >> EraseBackground is never called and message WMEraseBackground is never >> called also. PI> EraseBackground message is only send for TCustomControl descendants.

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Graeme Geldenhuys
On 5 February 2010 16:30, JoshyFun wrote: > > Because in that case you are "fooling" the text content and prone to > errors because the control must handle every possible way to get the In fpGUI we introduced a new property called TfpgEdit.ExtraHint That way it doesn't interfere with the actual

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread zeljko
On Friday 05 February 2010 16:35, Graeme Geldenhuys wrote: > On 5 February 2010 16:30, JoshyFun wrote: > > Because in that case you are "fooling" the text content and prone to > > errors because the control must handle every possible way to get the > > In fpGUI we introduced a new property called

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Felipe Monteiro de Carvalho
Yes, trying to change the painting of standard controls leads to problems because each widgetset will deal with it differently. The most assured solution to work everywhere is to implement your own TEdit from scratch with just custom painting. -- Felipe Monteiro de Carvalho -- _

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, Friday, February 5, 2010, 4:35:18 PM, you wrote: GG> In fpGUI we introduced a new property called TfpgEdit.ExtraHint GG> That way it doesn't interfere with the actual text content - no matter GG> how it is set. The ExtraHint text is painted directly onto the GG> TfpgEdit backg

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, Friday, February 5, 2010, 5:33:29 PM, you wrote: >> Painting directly onto TEdit's background canvas - is that what you >> are having issues with under GTK2? z> It's because ws paints such control (same like under qt), you can paint on it z> whatever, but at the end your chang

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Felipe Monteiro de Carvalho
On Fri, Feb 5, 2010 at 5:00 PM, JoshyFun wrote: > I do not wish to struggle GTK, I wish to do everything in "plain" LCL > way, but seems to be not possible. Anyway I'll investigate a bit and > get more familiar with GTK way of life. Yes, you need to mess with Gtk to do it. I would however recomme

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Kjow
2010/2/5 Felipe Monteiro de Carvalho : > Yes, you need to mess with Gtk to do it. I would however recommend > that you try it with Qt instead. The Qt API is much easier to use and > the Qt interface is also much better organized. The downside is that > you need the Pascal binding library if you use

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Graeme Geldenhuys
On 5 February 2010 18:33, zeljko wrote: > > It's because ws paints such control (same like under qt), you > can paint on it whatever, but at the end your changes won't be > visible since ws theme painter do the job. OK, I understand the problem now. So background/theme painting is out of LCL's co

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Graeme Geldenhuys
On 5 February 2010 19:19, Felipe Monteiro de Carvalho wrote: > Yes, trying to change the painting of standard controls leads to > problems because each widgetset will deal with it differently. Ah, so you confirmed what I was thinking (in my reply to zeljko). No solution that works on all widgetse

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Graeme Geldenhuys
On 5 February 2010 23:03, Felipe Monteiro de Carvalho wrote: > > Yes, you need to mess with Gtk to do it. I would however recommend > that you try it with Qt instead. But that defeats the point of LCL then - not all features work in all widgetsets. So you end up having an application that looks o

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Graeme Geldenhuys
On 6 February 2010 00:31, Kjow wrote: > > What about licenses using of QT in commercial projects? You need to purchase a commercial license. $2500 US per developer - starting price (if I remember correctly). -- Regards, - Graeme - ___ fpGUI - a c

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread JoshyFun
Hello Lazarus-List, Saturday, February 6, 2010, 12:01:38 AM, you wrote: GG> On 5 February 2010 20:56, JoshyFun wrote: >> More or less :) Mostly is tell to GTK2 that I'll paint something over >> TEdit and please GTK do not erase it :) or I "you" do it let me know >> to repaint my own content. GG

Re: [Lazarus] GTK2 EraseBackgound

2010-02-05 Thread Felipe Monteiro de Carvalho
On Fri, Feb 5, 2010 at 8:31 PM, Kjow wrote: > What about licenses using of QT in commercial projects? This is a problem if you are using Qt 4.4 or previous. But now Lazarus uses and requires Qt 4.5+ which is LGPL, the same license as Gtk, which means in short: no problems Nokia changed the lice

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Friday 05 February 2010 23:49, Graeme Geldenhuys wrote: > I can only imagine such "hacks" will inevitably fail somewhere down > the line - or is simply not supported by all widgetsets. Is it just my > imagination, or is there more and more feature being added to LCL > which only works on specif

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Friday 05 February 2010 23:31, Kjow wrote: > 2010/2/5 Felipe Monteiro de Carvalho : > > Yes, you need to mess with Gtk to do it. I would however recommend > > that you try it with Qt instead. The Qt API is much easier to use and > > the Qt interface is also much better organized. The downside is

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Saturday 06 February 2010 00:05, Graeme Geldenhuys wrote: > On 5 February 2010 23:03, Felipe Monteiro de Carvalho > > wrote: > > Yes, you need to mess with Gtk to do it. I would however recommend > > that you try it with Qt instead. > > But that defeats the point of LCL then - not all features

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Saturday 06 February 2010 00:07, Graeme Geldenhuys wrote: > On 6 February 2010 00:31, Kjow wrote: > > What about licenses using of QT in commercial projects? > > You need to purchase a commercial license. $2500 US per developer - > starting price (if I remember correctly). No, you not.You're c

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Friday 05 February 2010 19:56, JoshyFun wrote: > More or less :) Mostly is tell to GTK2 that I'll paint something over > TEdit and please GTK do not erase it :) or I "you" do it let me know > to repaint my own content. Exact example is on my wiki page (but works with qt only :) ). --

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 6 February 2010 01:43, JoshyFun wrote: > > Every widgetset has its own pros/cons and most things can be done in > all of them. I can't argue that. :) > The "problem" with LCL is that it inherits a lot of > habits from Windows platforms This is something I have experienced as well, so am gla

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 6 February 2010 04:28, Felipe Monteiro de Carvalho wrote: > > But now Lazarus uses and requires Qt 4.5+ which is LGPL, the same > license as Gtk, which means in short: no problems What does that mean? Can you now use Qt 4.5+ in commercial software without buying a Qt License? Why then do they

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 6 February 2010 10:09, zeljko wrote: > and less buggy (just look at bug tracker, and compare number and type of qt > bugs vs. gtk2 bugs), But that could also be explain as follows... not as many people are using the LCL-Qt widgetset compared to the LCL-GTK2 widgetset. :-) > primary target. S

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Saturday 06 February 2010 09:35, Graeme Geldenhuys wrote: > On 6 February 2010 10:09, zeljko wrote: > > and less buggy (just look at bug tracker, and compare number and type of > > qt bugs vs. gtk2 bugs), > > But that could also be explain as follows... not as many people are > using the LCL-Qt

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Hans-Peter Diettrich
Graeme Geldenhuys schrieb: Yes, you need to mess with Gtk to do it. I would however recommend that you try it with Qt instead. But that defeats the point of LCL then - not all features work in all widgetsets. So you end up having an application that looks or behaves different depending on widg

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 6 February 2010 10:46, zeljko wrote: >> But that could also be explain as follows... not as many people are >> using the LCL-Qt widgetset compared to the LCL-GTK2 widgetset. :-) > > well, over 3500 client machines happily runs LCL-Qt apps I meant, used by various developers, not a single app d

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Paul Ishenin
06.02.2010 6:43, JoshyFun wrote: Oh! no! for sure no, that's not the intention. My intention was to add a new facility to native TEdit, in fact I only need that facility for Win32 but as it is very simple I'm using it to investigate other widgetsets and try to resolve the same problem in differen

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Kjow
2010/2/6 Graeme Geldenhuys : > On 6 February 2010 00:31, Kjow wrote: >> >> What about licenses using of QT in commercial projects? > > You need to purchase a commercial license. $2500 US per developer - > starting price (if I remember correctly). > > > -- > Regards, >  - Graeme - WOW... really to

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Saturday 06 February 2010 12:02, Kjow wrote: > 2010/2/6 Graeme Geldenhuys : > > On 6 February 2010 00:31, Kjow wrote: > >> What about licenses using of QT in commercial projects? > > > > You need to purchase a commercial license. $2500 US per developer - > > starting price (if I remember correc

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Kjow
2010/2/6 zeljko : > No, Graeme is wrong. Qt is LGPL-ed so you can create commercial apps without > buying Qt commercial licenses. > > zeljko Oh, well this reevaluates the question. So if I use QT in my Lazarus projects I don't have to pay nothing to Nokia. And what about sources? Do I need to rele

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 06/02/2010, zeljko wrote: > > No, Graeme is wrong. Qt is LGPL-ed so you can create commercial apps without > buying Qt commercial licenses. So when do you need a Qt license then? -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread Graeme Geldenhuys
On 06/02/2010, zeljko wrote: > > > > I'll try Lazarus with LCL-Qt for the next week to see how it goes - I > > haven't tried LCL-Qt in a while. > > > Feedback is welcome :) See my new message thread "Lazarus IDE + Qt annoyances". -- Regards, - Graeme - _

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Saturday 06 February 2010 12:39, Kjow wrote: > 2010/2/6 zeljko : > > No, Graeme is wrong. Qt is LGPL-ed so you can create commercial apps > > without buying Qt commercial licenses. > > > > zeljko > > Oh, well this reevaluates the question. So if I use QT in my Lazarus > projects I don't have to

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread JoshyFun
Hello Lazarus-List, Saturday, February 6, 2010, 9:17:01 AM, you wrote: >> The "problem" with LCL is that it inherits a lot of >> habits from Windows platforms GG> This is something I have experienced as well, so am glad to see others GG> are noticing the same thing. LCL is meant to be cross-platf

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread JoshyFun
Hello Lazarus-List, Saturday, February 6, 2010, 10:39:45 AM, you wrote: PI> Ok. Open lcl\interfaces\gtk\gtkcallback.inc search for LM_ERASEBKGND, PI> comment then line: PI> if (TObject(Target) is TCustomControl) PI> and recompiler the LCL. Test after that - does this solves your problem? I'll ch

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread JoshyFun
Hello Lazarus-List, Saturday, February 6, 2010, 10:39:45 AM, you wrote: >> Oh! no! for sure no, that's not the intention. My intention was to add >> a new facility to native TEdit, in fact I only need that facility for >> Win32 but as it is very simple I'm using it to investigate other >> widgets

Re: [Lazarus] GTK2 EraseBackgound

2010-02-06 Thread zeljko
On Sunday 07 February 2010 00:08, JoshyFun wrote: > No "problem" is not solved because: > > 1) EraseBackground is now invoked, but calling "inherited > EraseBackground" does not perform the default erasebackground > procedure. > > 2) Now background is completly gone due (1) > > 3) WMPaint is invok

Re: [Lazarus] GTK2 EraseBackgound

2010-02-07 Thread JoshyFun
Hello Lazarus-List, Sunday, February 7, 2010, 8:41:37 AM, you wrote: >> I think a deeper change in GTK is needed to handle this situation, >> maybe all controls must be APP_PAINTABLE and call some methods to >> perform the operations, but I'm not completly sure that it could be >> done in fact in