LookAndFeel requests

Discussion and support for general JUCE issues

Postby jules » Wed Aug 13, 2008 7:37 pm

The ResizableWindow already has a way of specifying the background colour, and doesn't draw any text, so not sure about why you need those..

And for a tabbed component, it lets you change the colour of each tab individually, so a global tab colour doesn't really apply. I guess it could let you set a default tab colour, but that would involve changing the addTab method to remove the colour parameter, and breaking a lot of code.
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby photon » Wed Sep 24, 2008 5:08 pm

The minimum height of a menu item is restricted in PopupMenuWindow::addItem() by:

Code: Select all
mic->setSize (itemW, jlimit (10, 600, itemH));


I would like to have that minimum height set to 1px (but that may break someones menus), or be configurable by the LookAndFeel:

Code: Select all
LookAndFeel::getMinimumPopupMenuItemSize (int &minimumWidth, int &minimumHeight);


I hit this minimal height limit, because I want menu separators to be smaller than 10px in my custom LookAndFeel.
photon
JUCE Obsessive
 
Posts: 69
Joined: Fri Aug 11, 2006 11:52 am

Postby jules » Wed Sep 24, 2008 6:37 pm

It does seem a bit hard-coded, and could easily be less than 10 without doing any harm, I think. I doubt if there are any custom components that set their size to less than 10..
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby mdsp » Mon Oct 27, 2008 7:21 pm

I'd like to create a subclass of MidiKeyboardComponent that would delegate its drawing to a custom LnF however I can't because MidiKeyboardComponent::getKeyPos is private.
protected or friend class LookAndFeel should be enough for me.

If you feel like factoring the drawing code from MidiKeyboardComponent into the LookAndFeel I'm all for it too.
mdsp
JUCE UberWeenie
 
Posts: 277
Joined: Fri Oct 29, 2004 12:00 pm
Location: Paris

Postby jules » Mon Oct 27, 2008 8:57 pm

Can't you do what you need with drawUpDownButton(), getKeyPosition(), etc?
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby mdsp » Tue Oct 28, 2008 11:36 am

ah sorry I didn't see getKeyPosition(), thanks
mdsp
JUCE UberWeenie
 
Posts: 277
Joined: Fri Oct 29, 2004 12:00 pm
Location: Paris

Postby 0746 » Thu Dec 04, 2008 7:30 am

I'd appreciate some color ids for table header
0746
JUCE Geek
 
Posts: 23
Joined: Sun Jun 08, 2008 6:13 pm

Still having probs with AlertWindow

Postby spiderman » Tue Dec 16, 2008 9:08 am

Jules, a while back you extended the AlertWindow class so you can now change the button height and text font. The button height works fine, but still cannot set change the font. If I'm not mistaken, it works only for named texteditor and combo components. So:

* please make font change fwork for message and title
* or better yet, make the title and message string accessible (getTitle, getMessage) for flexible painting

While at the subject, would it be possible to add a setFont method to all the components with text? GroupComponent, TextEditor, etc. Perhaps even a font member and a Component::setFont just in case the comp wants to write something.

Thanks,
LB
spiderman
JUCE Obsessive
 
Posts: 81
Joined: Thu Oct 04, 2007 12:48 pm
Location: Hungary

Postby jules » Tue Dec 16, 2008 11:56 am

There's a LookAndFeel::getAlertWindowFont() method that you should be using for this. It's really a design decision that things like fonts belong in the l+f, and shouldn't be a property of the individual components.
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Postby spiderman » Tue Dec 16, 2008 12:52 pm

jules wrote:There's a LookAndFeel::getAlertWindowFont() method that you should be using for this. It's really a design decision that things like fonts belong in the l+f, and shouldn't be a property of the individual components.


I know, but it doesn't work for me. Will doublecheck it though.

Yes, it's two different concepts, but I thought a couple of extra public functions don't hurt. Use them, or rely on the defaults.
spiderman
JUCE Obsessive
 
Posts: 81
Joined: Thu Oct 04, 2007 12:48 pm
Location: Hungary

Postby spiderman » Tue Dec 16, 2008 1:06 pm

spiderman wrote:
jules wrote:There's a LookAndFeel::getAlertWindowFont() method that you should be using for this. It's really a design decision that things like fonts belong in the l+f, and shouldn't be a property of the individual components.


I know, but it doesn't work for me. Will doublecheck it though.

Yes, it's two different concepts, but I thought a couple of extra public functions don't hurt. Use them, or rely on the defaults.


Well, let me rephrase that. The real reason is to be able to put components of the same class on a window and give them different emphasis or set some of them to monospaced etc. So this is a real life thing, not just l'art pour l'art. But I can certainly live without it, so I hereby surrender :)
spiderman
JUCE Obsessive
 
Posts: 81
Joined: Thu Oct 04, 2007 12:48 pm
Location: Hungary

Postby jules » Tue Dec 16, 2008 2:12 pm

Well, let me rephrase that. The real reason is to be able to put components of the same class on a window and give them different emphasis or set some of them to monospaced etc. So this is a real life thing, not just l'art pour l'art. But I can certainly live without it, so I hereby surrender Smile


Well, you don't have to live without it - just give each component a different l+f.
User avatar
jules
Fearless Leader
 
Posts: 17227
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

you can do that

Postby amcleran » Fri Mar 27, 2009 10:05 pm

zamrate wrote:Apart fom LookAndFeel, it would be cool if one could assign an integer tag/id to each component and retrieve the component based upon that tag/id.


Since you are probably always creating subclasses of Component, why can't you do this yourself? You could pass in the id value into your component during the constructor or with setter/getter methods.

Or, if you wanted to have all your components aware of each other, automatically setting unique ids for each of them, you could create a subclass of component with a static data member that increments each time the constructor is called -- then you make subclasses of this subclass, each sharing the static id, setting their own internal id number to the current id in their own constructors.
amcleran
JUCE Geek
 
Posts: 27
Joined: Sat Feb 28, 2009 11:45 pm

Re: you can do that

Postby amcleran » Fri Mar 27, 2009 10:07 pm

amcleran wrote:Or, if you wanted to have all your components aware of each other, automatically setting unique ids for each of them, you could create a subclass of component with a static data member that increments each time the constructor is called -- then you make subclasses of this subclass, each sharing the static id, setting their own internal id number to the current id in their own constructors.


Better yet, you could make a simple class whose entire function is keep track of a class-wide static data member, then just inherit from it (since we can do multiple inheritance in C++) whenever you want a particular object (or component) to have a unique ID.
amcleran
JUCE Geek
 
Posts: 27
Joined: Sat Feb 28, 2009 11:45 pm

Postby yfede » Mon Jul 06, 2009 2:31 pm

I'd like the DocumentWindow::getBorderSize () method to be a protected virtual method instead of a private one. That way, I may decide to have a border size of choiche for my subclasses of DocumentWindow.
User avatar
yfede
JUCE UberWeenie
 
Posts: 426
Joined: Fri Jun 08, 2007 5:04 pm
Location: Modena - Italy

PreviousNext

Return to General JUCE discussion

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests