Quantcast

Creating wxRibbonBar buttons without images

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

Creating wxRibbonBar buttons without images

Gunter Königsmann
Dear all,

Seems like my last try to post here didn't work => resending:
I am thinking if wxMaxima would profit of a wxRibbonBar that can be enabled instead of the toolbar.

Making a proof-of-concept that contains all the toolbar buttons was easy. then I tried to add
 - A panel with the basic functions: "Simplify", Simplify trigonometric, Expand, Factorize, Solve, Solve equation system, Taylor, Limit,...
 - A list panel containing create Append, First n, Last n, sort
and so on.

AddButton on a wxRibbonButtonBar requires me to provide an image. For some of the above functions I can provide one that actually tells what I mean. For others it will be hard to add an image one can guess from what it means => In many cases it would make sense to create buttons containing only text that will be automatically shuffled around by the RibbonBar depending to the available space.

Just passing wxNullBitmap to AddButton() actually yields the result I want. But it triggers hundreds of asserts.

Is there a way to get buttons with text instead of images that are handled by the wxRibbonBar like its buttons are?

Thanks a lot,
and
Kind regards,

   Gunter.
 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Iwbnwif Yiw
Hi,

Almost certainly the easiest way of approaching this is to create some kind of 'dummy image' which is whatever bitmap size you are working with with the alpha of all pixels set to transparent.

Not tested, but probably the reason for the asserts is that the wxNullBitmap size is -1,-1 which could cause problems with the layout algorithms. So instead create a wxDummyBitmap with (for example) 64x64.

However, I think empty button images would make an usual user interface compared to most other software that uses the ribbon concept. IMHO it would be better to have some sort of relevant image and leave the button text and tooltip to convey the precise meaning.

If your meaning is to replace the bitmap image with just text, you can still create bitmaps and write the text using a DC.

HTH




On Monday, April 10, 2017 at 8:41:14 AM UTC+1, Gunter Königsmann wrote:
Dear all,

Seems like my last try to post here didn't work => resending:
I am thinking if wxMaxima would profit of a wxRibbonBar that can be enabled instead of the toolbar.

Making a proof-of-concept that contains all the toolbar buttons was easy. then I tried to add
 - A panel with the basic functions: "Simplify", Simplify trigonometric, Expand, Factorize, Solve, Solve equation system, Taylor, Limit,...
 - A list panel containing create Append, First n, Last n, sort
and so on.

AddButton on a wxRibbonButtonBar requires me to provide an image. For some of the above functions I can provide one that actually tells what I mean. For others it will be hard to add an image one can guess from what it means => In many cases it would make sense to create buttons containing only text that will be automatically shuffled around by the RibbonBar depending to the available space.

Just passing wxNullBitmap to AddButton() actually yields the result I want. But it triggers hundreds of asserts.

Is there a way to get buttons with text instead of images that are handled by the wxRibbonBar like its buttons are?

Thanks a lot,
and
Kind regards,

   Gunter.
 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Gunter Königsmann


On 10.04.2017 12:55, Iwbnwif Yiw wrote:
> Hi,
>
> Almost certainly the easiest way of approaching this is to create some
> kind of 'dummy image' which is whatever bitmap size you are working with
> with the alpha of all pixels set to transparent.
>
That kind of works, if the bitmap is >2x2 pixels. But (depending on the
space available) this leaves space for the bitmap above or to the left
of the text.
>
> However, I think empty button images would make an usual user interface
> compared to most other software that uses the ribbon concept. IMHO it
> would be better to have some sort of relevant image and leave the button
> text and tooltip to convey the precise meaning.
Good idea. But for most mathematical concepts and programming tasks
(convert arrays to lists and vice versa) icons won't make an intuitive
interface.
> If your meaning is to replace the bitmap image with just text, you can
> still create bitmaps and write the text using a DC.
Arrgh! I don't like that possibility, doing these things by hand and
having to find out which signals to listen on. But it would be possible,
of course.

Kind regards,

   Gunter.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Iwbnwif Yiw
Sorry then, I think that I misunderstood what you are trying to do.

Perhaps you include a mockup image so I can understand better.

On Monday, April 10, 2017 at 4:46:31 PM UTC+1, Gunter Königsmann wrote:

>> However, I think empty button images would make an usual user interface 
>> compared to most other software that uses the ribbon concept. IMHO it 
>> would be better to have some sort of relevant image and leave the button 
>> text and tooltip to convey the precise meaning. 
Good idea. But for most mathematical concepts and programming tasks 
(convert arrays to lists and vice versa) icons won't make an intuitive 
interface. 
 
Well, the meaning of some Excel and Word icons wouldn't be all that obvious unless the function was written next to it. For example, you could reverse the Excel's "Text to Columns" icon on the "Data" tab to indicate array to list ;)

> If your meaning is to replace the bitmap image with just text, you can
> still create bitmaps and write the text using a DC.
Arrgh! I don't like that possibility, doing these things by hand and
having to find out which signals to listen on. But it would be possible,
of course.


There shouldn't be any signals to listen to unless you want to dynamically change the text. Just create a wxBitmap and then wxMemoryDC (myBitmap). 

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Gunter Königsmann


On 10.04.2017 18:30, Iwbnwif Yiw wrote:
> Sorry then, I think that I misunderstood what you are trying to do.
>
> Perhaps you include a mockup image so I can understand better.
>

Attached you find a mockup of what I am trying to do. I am still not
sure at this stage, admittedly, if what I am planning actually makes
sense. Perhaps that is the real problem: I originally wanted to create a
design study if a ribbon increases the usability of the program - or if
it is the right idea, but not for the kind of task I want to use it for.

Kind regards,

   Gunter.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

Untitled.png (135K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Gunter Königsmann
For lists I have managed to come up with icons that half-way make sense.
But on Linux the results looks strange and I assume for greek characters
and so on the ribbon might be the Wrong Way To Go. Well, it was worth a try.

Kind regards,

    Gunter.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

Untitled.png (224K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Creating wxRibbonBar buttons without images

Iwbnwif Yiw
Thank you for the images, it certainly helps.

One of the main strengths of the ribbonbar concept is the ability to group sets of functionality on different tabs, which are implemented using the wxRibbonPage class.

Part of the problem with today's screenshot is that the ribbon has re-scaled the buttons in the "List" panel to they can all fit in. For some reason the label font looks like it might to be too large, which is causing the text to overlap. See if you have increased the default setting, or if not try to reduce it. It might depend on your desktop theme, because I think that is obtained via wxSYS_DEFAULT_GUI_FONT or similar.

You might like to consider putting the equation entry and editing functions on one wxRibbonPage (e.g. "List" panel) and the analysis functions (e.g. "Simplify" panel) on another wxRibbonPage. This will give more space for each panel, so will only cause re-scaling for relatively small main frame sizes.

Also, I would recommend you create your icons as 32x32 pixels, even if only part of the bitmap actually has anything on it. Making all the icons this size will help with the layout issues.

The smaller icons in the wxRibbonToolbars ("Maxima" and "Edit") could probably be safely 16x16 pixels.

FWIW, I agree that the Greek character entry may not be suited to the ribbonbar concept. Word does attempt this in its equation editor using a gallery (see wxRibbonGallery), but I think your current approach with dedicated AUI panes might be somewhat more usable!

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Loading...