[Lazarus] Component visibility at design time

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Component visibility at design time

patspiper
I modified TEditBtn and made the button optional in order to make that
component more generic. However, the button stays visible during design
time no matter what its visible setting is.

Isn't it possible to hide a (sub) component in design time?

Thanks,
Stephano

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

Michael Van Canneyt


On Sun, 10 Apr 2011, patspiper wrote:

> I modified TEditBtn and made the button optional in order to make that
> component more generic.

But showing the button is exactly the purpose of this control, so how can it be optional ?

Michael.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

zeljko
In reply to this post by patspiper
On Sunday 10 of April 2011 12:11:44 patspiper wrote:
> I modified TEditBtn and made the button optional in order to make that
> component more generic. However, the button stays visible during design
> time no matter what its visible setting is.
>
> Isn't it possible to hide a (sub) component in design time?

TControlStyle
csNoDesignVisible

zeljko

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

patspiper
In reply to this post by Michael Van Canneyt
On 04/10/2011 02:00 PM, Michael Van Canneyt wrote:
>
>
> On Sun, 10 Apr 2011, patspiper wrote:
>
>> I modified TEditBtn and made the button optional in order to make
>> that component more generic.
>
> But showing the button is exactly the purpose of this control, so how
> can it be optional ?
The button will be visible by default. The application would show or
hide the button depending on the context.

Anyway, my actual modifications to TEditBtn just add the necessary logic
so that a descendant that can hide/show the button becomes feasible.

Stephano

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

patspiper
In reply to this post by zeljko
On 04/10/2011 02:40 PM, zeljko wrote:
> On Sunday 10 of April 2011 12:11:44 patspiper wrote:
>> I modified TEditBtn and made the button optional in order to make that
>> component more generic. However, the button stays visible during design
>> time no matter what its visible setting is.
>>
>> Isn't it possible to hide a (sub) component in design time?
> TControlStyle
> csNoDesignVisible
Thanks Zeljan!!

Saved me a lot of grief :-)

Stephano

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

Juha Manninen
In reply to this post by patspiper
patspiper kirjoitti sunnuntai, 10. huhtikuuta 2011 20:56:17:
> The button will be visible by default. The application would show or
> hide the button depending on the context.
>
> Anyway, my actual modifications to TEditBtn just add the necessary logic
> so that a descendant that can hide/show the button becomes feasible.

I think you mean component TCustomEditButton.

Your modification could be used for a filter-edit component I planned to make
and use for different list- and treeviews in Lazarus.
When empty, the control shows a gray "(filter)" or "(search)".
When user types something, an erase-button shows up. Clicking the button makes
the control empty again.
I wanted to draw an erase-button on the right end of the edit control itself,
but it may be more difficult.

Anyway, if you have modifications for TCustomEditButton which don't break
existing code, I think it can be used in LCL.

Juha

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Component visibility at design time

patspiper
On 04/11/2011 11:19 PM, Juha (gmail) wrote:
> patspiper kirjoitti sunnuntai, 10. huhtikuuta 2011 20:56:17:
>> The button will be visible by default. The application would show or
>> hide the button depending on the context.
>>
>> Anyway, my actual modifications to TEditBtn just add the necessary logic
>> so that a descendant that can hide/show the button becomes feasible.
> I think you mean component TCustomEditButton.
Indeed.

> Your modification could be used for a filter-edit component I planned to make
> and use for different list- and treeviews in Lazarus.
> When empty, the control shows a gray "(filter)" or "(search)".
> When user types something, an erase-button shows up. Clicking the button makes
> the control empty again.
> I wanted to draw an erase-button on the right end of the edit control itself,
> but it may be more difficult.
>
> Anyway, if you have modifications for TCustomEditButton which don't break
> existing code, I think it can be used in LCL.
I think my modifications suit your exact needs. I'll submit the patch.

Stephano

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus