[Gambas-user] Message() upgrades/restoration options

Bruce Steers bsteers4 at gmail.com
Fri Feb 26 14:03:42 CET 2021


So i fixed the window size problem, I just had to move the setting of the
AutoResize property to before the button sizes were being added to the
width.

i also cleaned up the look of the initial auto-complete for Message by
moving ALL the new properties and settings to a new class that
Message.Custom points to.

So at first glance the only addition visible to the list of Message
properties/commands it Message.Custom so I think that keeping things simple
for most.

All defaults setting changes are now set using something like
Message.Custom.WindowCloseEnabled = True

I have also now added the following to the Custom property list...

*Message.Custom.ShowOnTaskbar As Boolean*
this will force the message boxes to always show on the taskbar if that is
your desire.

*Message.Custom.FlatStyleClosewindow As Boolean*
this adds a nice Close Window ToolButton to the flat style window
*Message.Custom.ForcePicture As Picture*
with this option set any picture can be loaded and will display on ALL
Message type calls.
this will be useful if you wish to use a custom image of your choice in
your message calls not just a stock icon.
Once the picture is set Calling Message.Question or Message.Info , etc will
show the set picture.
this is also useful to set a new picture for existing code without any
modification to existing Message calls.
*Message.Custom.ClearSettings()*
Resets all custom settings

You gotta be keen on at least one of these features.?

surely being able to add
*Message.Custom.WindowCloseEnabled* *= True*
to your project startup to re-enable the close window button on all your
message calls is a cool thing?

Wishing well
BruceS



On Thu, 25 Feb 2021 at 20:07, Bruce Steers <bsteers4 at gmail.com> wrote:

> Doh!  This is not ready.
> I just noticed auto resizing the buttons does not a smaller window make. :(
>
> That's all I see wrong with it.
>
> All the best
> BruceS
>
> On Thu, 25 Feb 2021, 18:57 Bruce Steers, <bsteers4 at gmail.com> wrote:
>
>> Hi all
>> I have made a slightly customised version of the Message class and
>> wondered if there was interest in the new features. (especially Benoits
>> views)
>>
>> the minor changes are of the following nature...
>> *Options to restore some old behaviour*
>>   Message.WindowCloseEnabled to restore close button being cancel
>>   Message.LeftButtonDefault to restore left hand button having focus
>>
>> *3 new features.*
>> Message.Custom() , a more versatile Message function with minimal coding
>> that will show ANY number of buttons and ANY stock icon image.
>>
>> Message.ShrinkButtons simply adds AutoResize to all the buttons to
>> improve the flexibility of being able to use many buttons.
>>
>> Message.SeparateCancel is just a nice feature i think to make the cancel
>> button stand out.
>>
>>
>> Personally i've often wanted that extra 1 or 2 buttons in a message
>> and allowing any stock icon image was such a tiny bit of code for a great
>> expansion on variation.
>>
>> Benoit , the changes in the code are small but the improvement in Message
>> usability is great.
>> I understand if you are not interested.
>> My main drive for doing this is the amount of times i've clicked the
>> bloomin close window button since it's stopped working, grrrr ;) lol
>>
>> commit url and message below..
>>
>> Wishing well
>> BruceS
>>
>>
>>
>> https://gitlab.com/bsteers4/gambas/-/commit/0a8525de63d770580c32825f3f8d312ea303036a
>>
>> [GB.GUI.BASE]
>> * NEW: Added command Message.Custom(sMessage As String, sButtons As String[], sStockIcon As String)
>>   Any number of buttons may be given as String[] and Any stock icon image name may be given.
>> * NEW: Static Boolean Property Message.WindowCloseEnabled, Restores old behaviour of the window close button being cancel/escape.
>> * NEW: Static Boolean Property Message.LeftButtonDefault, Gives the left hand button focus instead of the right hand one.
>> * NEW: Static Boolean Property Message.SeparateCancel , adds a space between the cancel button and the others.
>> * NEW: Static Boolean Property Message.ShrinkButtons, Sets AutoResize on the buttons so they fit their texts
>>   the normal method is to make All the buttons the same size as the largest button text.
>>
>> ANY number of buttons can be entered, it is up to the user to ensure they do not exceed screen width.
>> ANY stock icon image name can be given, if not found it falls back to "info"
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210226/8182d1dc/attachment.htm>


More information about the User mailing list