About Window Border & ImageButton (two questions)


#1

Hello,

I’ve two question totally differents :

  1. The grey border around the window :
    Is it a method to remove the window border ? I know you can use setBackgroundColour(const juce::Colour &newColour) on a DocumentWindow, but what about the (1pixel?) border around ?

  2. The ImageButton :
    I want to use purely image button, but in a case of a group (setRadioGroupId(const int newGroupId)) that allow to have only one of theses buttons in On state at time.
    The documentation indicate : all the buttons for a particular group must be placed inside the same parent component. So to be sure the ImageButton(s) was add into a single Component (the ImageButton group).

	Component* group = new Component(T("group"));
	group->setBounds(0, 0, WINDOW_WIDTH, TOP_HEIGHT);
	addAndMakeVisible(group);


	buttonHome = new ImageButton(T("HomeButton"));
	buttonHome->setImages(true, true, true,
						  buttonHomeOff, 0.8f, Colours::transparentBlack,
						  buttonHomeOff, 1.0f, Colours::transparentBlack,
						  buttonHomeOn, 1.0f, Colours::transparentBlack
						  );
	group->addAndMakeVisible(buttonHome);
	buttonHome->setTopLeftPosition(36, 0);
	buttonHome->setTooltip(T("Home - Go to the navigation panel"));
	buttonHome->setClickingTogglesState(true);
	buttonHome->setRadioGroupId(23456);
	buttonHome->addButtonListener(this);

                ...

My seven buttons works and the image change when over or down.

My problem is simple, I can’t have the TogglesState property (setClickingTogglesState(true)) on my group. I want to have only one button in the stateOn at the same time (with the same image that the button down (buttonHomeOn))

Perhaps the ImageButton is not really a ToggleButton, but when i read the demo source code, the radiobutton section of the WidgetsDemo.cpp, i see that Juce allow the ToogleState & RadioGroupId on the ToggleButton/DrawableButton/TextButton ? What about the ImageButton ?

Thank you in advance.
Max


#2

Hi there

The window outline will be drawn in LookAndFeel::drawDocumentWindowTitleBar - can’t remember how it’s calculated, but you can always create a custom look and feel if you need a really specific look

All buttons can be toggles - it’s in the base class, so imagebuttons are no different from the others in that regard.


#3