Re: [Lazarus] Z-order not working

2015-04-01 Thread Anthony Walter
Graeme,

Does someone else have access to your account? Because the questions you're
asking are trivial to answer.

TEdit is a windowed control and as such its rectangular clipping path is
controlled by the Z-order of its siblings.

TImage is a graphic control and as such its rectangular clipping path is
controlled by the Z-order of its parent window.

If you case, the image, edit, and status bar all have the same parent
window, thus the image will always be clipped by the edit and status bar.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Dmitry Boyarintsev
TImage is a graphic control (it doesn't have its own handle), thus cannot
be put above any other control than it's parent.

It should be a place into another control (i.e. TPanel) that is TWinControl
(and does have a handle)

thanks,
Dmitry

On Wed, Apr 1, 2015 at 9:45 AM, Graeme Geldenhuys 
mailingli...@geldenhuys.co.uk wrote:

 Hi,

 Why can I place a TEdit above a StatusBar, but a TImage I can't? See
 attached screenshot.


 Regards,
   - Graeme -

 --
 fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
 http://fpgui.sourceforge.net/

 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Graeme Geldenhuys
Hi Dmitry,

On 2015-04-01 15:01, Dmitry Boyarintsev wrote:
 TImage is a graphic control (it doesn't have its own handle),

Ah, okay.  One of those differences between LCL and fpGUI.


 It should be a place into another control (i.e. TPanel) that is
 TWinControl (and does have a handle)

And that's where my second (actually I lost count today) problem lies.
How do I add a TPanel inside a TStatusBar for example. The TStatusbar
doesn't seem to accept child widgets.

My thinking is based on the auto-resizing issue of StatusBar Panels I
mentioned earlier. What I'm trying to do is paint an image at the right
edge of the StatusBar.

A quick test reveals that I can't place a TPanel inside a TStatusBar. It
seems the TStatusBar doesn't accept children.

So based on that and what you said, I have to now place a TPanel on the
form, then place a TImage inside the TPanel, then make sure the z-order
of the TPanel is correct so it appears above the TStatusBar, then
position the TPanel at the correct location relative to the right edge
of the statusbar. This is a pretty nasty solution.

Is there any better solution than the above?


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Graeme Geldenhuys
Hi Anthony,

On 2015-04-01 15:01, Anthony Walter wrote:
 If you case, the image, edit, and status bar all have the same parent
 window, thus the image will always be clipped by the edit and status bar.

Many thanks for the explanation. I forgot the fact that a graphic
control doesn't have a handle.

And no, nobody hijacked my email account. :-) I'm just not used to
working with LCL any more. fpGUI seems so much simpler now, and with way
less workarounds.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Anthony Walter
Graeme,

Personally, I never use a status bar, just because if I want something in
the footer, it usually involves more than just text. For example I may want
editor controls, images, buttons, and text in the bottom area of the form.
See the screenshot below as an example coming from one of my apps:

http://cache.getlazarus.org/images/showcase/linux.business.charity.jpg

See the form in back can have a search function, a date range button, and
you can remove it by clicking close? You can do whatever you want in the
bottom area of a a form if you just reserve it by overriding
GetLogicalClientRect and using control alignments. You don't even need a
panel, just a trivial piece of code in the form.

If you're like me you'll even put that logic in a base form class, make it
optional, and use that type of base form anytime you might want a status
like area.

Oh and if you're concerned about drawing the size grip handle in the bottom
right, the Theme API does that for you, or you can even write you own one
time reusable code to draw size grip handles.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Graeme Geldenhuys
On 2015-04-01 15:42, Anthony Walter wrote:
 
 Personally, I never use a status bar, just because if I want something
 in the footer, it usually involves more than just text.

Well, I'm modifying an existing project for a client, so I don't have
much say in that regard. A nice idea though.

All I wanted to do (which should have taken 5 minutes) is something like
this:

  http://edysoftware.com/delphi/index.php?pilih=invoiceid=159

Simple status lights appearing on the right edge of the statusbar.

But because of the damn platform inconsistencies with LCL it doesn't
work. [sorry, I'm just a bit frustrated at this point] My initial
solution worked fine under Windows, but totally screwed on Linux and
FreeBSD because of the statusbar panels resizing themselves, and not to
the width values I set, and also the statusbar panels don't have bevels
displaying.  Clearly nobody uses the StatusBar widget, or they simply
don't pay attention, or they only develop for LCL-Win32/64 (where most
LCL things seem to work).


 If you're like me you'll even put that logic in a base form class, make
 it optional, and use that type of base form anytime you might want a
 status like area.

Can Lazarus already handle such developer defined components? I
remember the good old days of Delphi 7. Define a nice Form or Frame
template. Select everything and drag it to the component palette and
magically you have a developer defined component you can reuse. D7 also
had some shared code repository setting if I remember correctly, for
whole programming units.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Kostas Michalopoulos
On Wed, Apr 1, 2015 at 5:19 PM, Graeme Geldenhuys 
mailingli...@geldenhuys.co.uk wrote:


 Can Lazarus already handle such developer defined components? I
 remember the good old days of Delphi 7. Define a nice Form or Frame
 template. Select everything and drag it to the component palette and
 magically you have a developer defined component you can reuse.


I'm not sure about drag-drop (i only have Delphi 2 available and last time
i used any more recent Delphi was the personal edition of 6 -ithink- that i
got from a magazine CD cover years ago).

But you can create custom designable components using frames in Lazarus.
They're not as neat as a custom component made in pure code (and i honestly
haven't yet figured out if i can modify the components in a frame after
placing them or not and what happens if i modify the frame after that, so i
usually avoid touching frames after making them). I use frames all the time
(although because of the ambiguousness i mentioned i almost always
instantiate them via code instead of via the component bar).
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Dmitry Boyarintsev
On Wed, Apr 1, 2015 at 10:23 AM, Graeme Geldenhuys 
mailingli...@geldenhuys.co.uk wrote:

 And that's where my second (actually I lost count today) problem lies.
 How do I add a TPanel inside a TStatusBar for example. The TStatusbar
 doesn't seem to accept child widgets.

I'd think that's an editor (design time) limitation . TStatusBar is
TWinControl (has it's own handle).
Thus it can accept any child control.

If you assign Panel's parent in run time
Panel1.Parent:=StatusBar1;
You might get what you're looking for.

Keep in mind though StatusBar rearranges its children automatically.


 So based on that and what you said, I have to now place a TPanel on the
 form, then place a TImage inside the TPanel, then make sure the z-order
 of the TPanel is correct so it appears above the TStatusBar, then
 position the TPanel at the correct location relative to the right edge
 of the statusbar. This is a pretty nasty solution.


The only nastiness about it is that TPanel might draw a background, thus
the transparent image would look square.
Let me see...
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Anthony Walter
If all you want to do is add graphic indicators to a panel, just fill
out DrawPanel and use StatusBar.Canvas.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Z-order not working

2015-04-01 Thread Dmitry Boyarintsev
On Wed, Apr 1, 2015 at 9:45 AM, Graeme Geldenhuys 
mailingli...@geldenhuys.co.uk wrote:

 Why can I place a TEdit above a StatusBar, but a TImage I can't? See
 attached screenshot.

Follow up on the forum.
http://forum.lazarus.freepascal.org/index.php/topic,27932.0.html

thanks,
Dmitry
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus