Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-08

[GTK Z order & fixed frame]

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Samuel Liddicott
to Michal Bukovjan: Hmm, I am not sure at this point, but as I studied the GTK, I think there is some…
Show quoted text 16 lines
-----Original Message----- From: Michal Bukovjan Sent: 20 August 1999 07:03 PM To: Subject: Re: [[lazarus] GTK Z order & fixed frame] Hmm, I am not sure at this point, but as I studied the GTK, I think there is some gtk_??widget??_??set??_??window??_??policy?? (I really do not remember now), in which you pass four arguments for scaling, in a range 0-1, where 1 means resize totally in that direction upon parent resize, 0 means do not resize. (you can pass float values in between). So, I think if you set that up to 0,0,0,0, you get non-resizable control.

Oh, good.

Show quoted text 14 lines
> Next problem is that in windows, each "window" is er... a normal window and > can actually have child controls. > A button or a list box can have child controls (I've done this in some > applications...). > > Can GTK list boxes have child controls? Yes. In fact, the GtkList is only a container containing GktItems (provide white background behind the text), which in turn may contain a GtkLabel, which is then what you see. But theoretically, the list may contain anything, pictures, buttons, any other container containing yet another controls, anything you like.

Does this imply that any gtkWidget may contain other gtkWidgets?

Show quoted text 18 lines
> Do we get to intercept the painting for child controls? In delphi I do this > quite a bit - not least for OwnerDraw buttons and OwnerDraw list boxes? Now this is what I am interested now. I am not sure though, maybe Shane, who does this Canvas stuff, will listen. Do you, Shane? Is it possible to get/make use/map arbitrary widget's GdkCanvas to a Delphi-like TCanvas, or better yet, to an arbitrary control ? (i.e. I don't want a control that creates its Canvas, but rather have a dummy control (say TGraphicControl descendant) and assign an existing GdkCanvas (of some existing GtkWidget) to it on the fly ? This OwnerDraw stuff as I see it now is the most likely candidate to be incompatible with WinDelphi.

We can make it work! We may have to do a ReCreateWnd and make a generic GTK window if it is ownerdraw and then err.... draw by hand. No probs! (Except of course TListBoxStrings will be implemented slightly differently to cope for the fact when there is no gtkListBox)

It seems that the only things which may affect how things work then, are:

Z order stetting
Can any gtk widget be a parent widget

If this are both possible we can implement the full VCL model the way Delphi does.

Sam

Baeseman, Cliff

The form automatically has a fixed widget attached to it when you add a control to the form. The fixed widget is applied to the form and the controls is placed on by x y position and then it is sized.

When a form is streched the form tells the children to reset the position and size on the parents fixed widget.

This is a very good approach. Myself and shane fought a ugly battle with control positioning before arriving at the current solution.

Cliff

Earlier message 84 lines
-----Original Message----- From: Michal Bukovjan Sent: Friday, August 20, 1999 1:03 PM To: Subject: Re: [[lazarus] GTK Z order & fixed frame] "Samuel Liddicott" wrote: > I've been reading the GTK doco's and it doesn't look to good. > > I can't find much refernce on setting Z order and (worse still) its mostly > based around auto-scaling controls. Ugh - stretchy buttons! My tastes are > if the button is big enough for the text, why make it bigger just because > the user grew the form! > > Anway, it looks to me like we will need to host most controls in a gtk > fixed-frame which is about the only thing that allows absolute x-y > positioning. Is this right? If so I imagine thats what we do now? Do we? Hmm, I am not sure at this point, but as I studied the GTK, I think there is some gtk_??widget??_??set??_??window??_??policy?? (I really do not remember now), in which you pass four arguments for scaling, in a range 0-1, where 1 means resize totally in that direction upon parent resize, 0 means do not resize. (you can pass float values in between). So, I think if you set that up to 0,0,0,0, you get non-resizable control. > > Next problem is that in windows, each "window" is er... a normal window and > can actually have child controls. > A button or a list box can have child controls (I've done this in some > applications...). > > Can GTK list boxes have child controls? Yes. In fact, the GtkList is only a container containing GktItems (provide white background behind the text), which in turn may contain a GtkLabel, which is then what you see. But theoretically, the list may contain anything, pictures, buttons, any other container containing yet another controls, anything you like. > > Do we get to intercept the painting for child controls? In delphi I do this > quite a bit - not least for OwnerDraw buttons and OwnerDraw list boxes? > Now this is what I am interested now. I am not sure though, maybe Shane, who does this Canvas stuff, will listen. Do you, Shane? Is it possible to get/make use/map arbitrary widget's GdkCanvas to a Delphi-like TCanvas, or better yet, to an arbitrary control ? (i.e. I don't want a control that creates its Canvas, but rather have a dummy control (say TGraphicControl descendant) and assign an existing GdkCanvas (of some existing GtkWidget) to it on the fly ? This OwnerDraw stuff as I see it now is the most likely candidate to be incompatible with WinDelphi. > Sorry for so many questions, I'm trying to get up to speed on where we are > at the moment. > > Sam > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus ____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus
Michal Bukovjan
"Samuel Liddicott" wrote 10 lines
I've been reading the GTK doco's and it doesn't look to good. I can't find much refernce on setting Z order and (worse still) its mostly based around auto-scaling controls. Ugh - stretchy buttons! My tastes are if the button is big enough for the text, why make it bigger just because the user grew the form! Anway, it looks to me like we will need to host most controls in a gtk fixed-frame which is about the only thing that allows absolute x-y positioning. Is this right? If so I imagine thats what we do now? Do we?

Hmm, I am not sure at this point, but as I studied the GTK, I think there is some gtk_??widget??_??set??_??window??_??policy?? (I really do not remember now), in which you pass four arguments for scaling, in a range 0-1, where 1 means resize totally in that direction upon parent resize, 0 means do not resize. (you can pass float values in between). So, I think if you set that up to 0,0,0,0, you get non-resizable control.

Show quoted text 7 lines
Next problem is that in windows, each "window" is er... a normal window and can actually have child controls. A button or a list box can have child controls (I've done this in some applications...). Can GTK list boxes have child controls?

Yes. In fact, the GtkList is only a container containing GktItems (provide white background behind the text), which in turn may contain a GtkLabel, which is then what you see. But theoretically, the list may contain anything, pictures, buttons, any other container containing yet another controls, anything you like.

Do we get to intercept the painting for child controls? In delphi I do

this

quite a bit - not least for OwnerDraw buttons and OwnerDraw list boxes?

Now this is what I am interested now. I am not sure though, maybe Shane, who does this Canvas stuff, will listen. Do you, Shane? Is it possible to get/make use/map arbitrary widget's GdkCanvas to a Delphi-like TCanvas, or better yet, to an arbitrary control ? (i.e. I don't want a control that creates its Canvas, but rather have a dummy control (say TGraphicControl descendant) and assign an existing GdkCanvas (of some existing GtkWidget) to it on the fly ?

This OwnerDraw stuff as I see it now is the most likely candidate to be incompatible with WinDelphi.

Show quoted text 9 lines
Sorry for so many questions, I'm trying to get up to speed on where we are at the moment. Sam _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

Baeseman, Cliff

-----Original Message-----

Earlier message 51 lines
From: Samuel Liddicott Sent: Monday, August 23, 1999 5:34 AM To: Subject: RE: [[lazarus] GTK Z order & fixed frame] > -----Original Message----- > From: Baeseman, Cliff > Sent: 20 August 1999 06:16 PM > To: > Subject: RE: [[lazarus] GTK Z order & fixed frame] > > > The form automatically has a fixed widget attached to it when you add a > control to the form. The fixed widget is applied to the form and the > controls is placed on by x y position and then it is sized. > > When a form is streched the form tells the children to reset the position > and size on the parents fixed widget. > > This is a very good approach. Myself and shane fought a ugly battle with > control positioning before arriving at the current solution. I agree it is a very good solution. The fact that you get multiple handles refering to different parts of the form is annoying... and may break API stuff that sets a windowed controls parent handle to be the parent form's handle.... but hey this API stuff usually goes on INSIDE components not applications and components will take some porting. Besides there is no reason to expect the API widget routines and handles uses to be nearly similar to the windows API model. Err... do child widgets also have a fixed widget attached when they have a child widget added? I mean is this TWinControl behaviour or just TForm behaviour. I think it should be TWinControl behaviour. If they are of widget type container. Does GTK have any z order functions? Does it even have z order (Surely it must have...) Perhaps the order is the gtk-add'd order? Sam _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus
Samuel Liddicott
to Baeseman, Cliff: The form automatically has a fixed widget attached to it when you add a control to the…
Show quoted text 16 lines
-----Original Message----- From: Baeseman, Cliff Sent: 20 August 1999 06:16 PM To: Subject: RE: [[lazarus] GTK Z order & fixed frame] The form automatically has a fixed widget attached to it when you add a control to the form. The fixed widget is applied to the form and the controls is placed on by x y position and then it is sized. When a form is streched the form tells the children to reset the position and size on the parents fixed widget. This is a very good approach. Myself and shane fought a ugly battle with control positioning before arriving at the current solution.

I agree it is a very good solution. The fact that you get multiple handles refering to different parts of the form is annoying... and may break API stuff that sets a windowed controls parent handle to be the parent form's handle.... but hey this API stuff usually goes on INSIDE components not applications and components will take some porting. Besides there is no reason to expect the API widget routines and handles uses to be nearly similar to the windows API model.

Err... do child widgets also have a fixed widget attached when they have a child widget added? I mean is this TWinControl behaviour or just TForm behaviour. I think it should be TWinControl behaviour.

Does GTK have any z order functions? Does it even have z order (Surely it must have...)
Perhaps the order is the gtk-add'd order?

Sam