[Gambas-user] IDE doesn't show picture property of a custom Button control
Bruce Steers
bsteers4 at gmail.com
Wed May 10 20:19:00 CEST 2023
On Wed, 10 May 2023 at 12:44, BB <adamnt42 at gmail.com> wrote:
>
> On 10/5/23 9:01 pm, Bruce Steers wrote:
>
>
>
> On Wed, 10 May 2023 at 11:04, Jorge Carrión <shordi at gmail.com> wrote:
>
>> Hi, everybody.
>> I'm making a control that is a Button that supports a background image. It
>> works reasonably well, but the IDE doesn't show me the selected Stock image. All
>> the buttons look the same at develop time and that's confusing. Does
>> anyone know how to make the IDE recognize the Picture property and display
>> the image as it does with, say, the Button control? I attach a small
>> project that illustrates what I say.
>>
>
> Not really.
>
> gambas IDE form designer can only show native controls,
> The IDE loads the controls internally and that are coded to both construct
> at runtime and to display in the IDE also. so it's not a good idea to allow
> custom made controls to load into the IDE itself as it can cause
> problems/crashes. So they do not.
>
> I added code to my gambas IDE that "does" load custom controls and made
> them visible but it's no longer working due to some recent changes.
>
> Maybe if you made your class inherit Button not UserControl you may get it
> to show the images but at best all you will see is the generic Button in
> the IDE not any of your custom drawings.
>
> BruceS
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> You know, in 2023 I would really like this to work. 🙁
>
Yes it would be lovely.
On closer inspection of my mod it does still "kinda" work. it still tries
to display the controls but it's not able to deal with any designer set
values anymore so all i get is the generic default control as seen in the
attached image the designer view on the left and the runtime look on the
right.
So even my mod would not help Jorge here.
It worked fine a couple of months ago but Ben changed something and now
it's limited. But still better than just a box
It truly does give problems when you are working on the control though. as
the IDE has pre-loaded the control code any changes you make confuse things
(like changing property names). you have to do a lot of "compiling the
control, then shutting down the IDE and restarting it to reload the
controls changes"
Point being it's not as simple and straight cut as you would think to see
your custom control properly in the designer, especially if you are working
on it. there's a whole load of error checking and control reloading going
to be needed.
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230510/03bf22b2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Untitled.jpg
Type: image/jpeg
Size: 77790 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230510/03bf22b2/attachment-0001.jpg>
More information about the User
mailing list