54 mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
62 mPreviewBox->setScrollPolicy(gcn::ScrollArea::SHOW_NEVER,
63 gcn::ScrollArea::SHOW_NEVER);
77 const char *longText =
_(
"Static");
78 int longWidth = getFont()->getWidth(longText);
80 auto maybeLonger = [&] (
const char *text) {
81 const int width = getFont()->getWidth(text);
82 if (width > longWidth)
88 maybeLonger(
_(
"Pulse"));
89 maybeLonger(
_(
"Rainbow"));
90 maybeLonger(
_(
"Spectrum"));
188 if (event.getId() ==
"slider_grad")
195 if (event.getId() ==
"slider_graddelay")
202 if (event.getId() ==
"slider_red")
209 if (event.getId() ==
"slider_green")
216 if (event.getId() ==
"slider_blue")
278 snprintf(buffer, 100,
"%d", value);
301void Setup_Colors::listen(
const TextField *tf)
A simple browser box able to handle links and forward events to the parent conteiner.
void clearRows()
Remove all rows.
@ AUTO_WRAP
Maybe it needs a fix or to be redone.
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
LayoutCell & setVAlign(Alignment a)
Sets the vertical alignment of the cell content.
A list box, meant to be used inside a scroll area.
GradientType getGradientType(int type) const
Gets the GradientType associated with the specified type.
const gcn::Color & getColor(int type) const
Gets the color associated with the type.
GradientType
Colors can be static or can alter over time.
int getGradientDelay(int type) const
Gets the gradient delay for the specified type.
void setName(const std::string &name)
Sets the name displayed on the tab.
static const std::string rawmsg
void valueChanged(const gcn::SelectionEvent &event) override
TextField * mGradDelayText
gcn::Slider * mGradTypeSlider
gcn::ScrollArea * mPreviewBox
gcn::ScrollArea * mScroll
void setEntry(gcn::Slider *s, TextField *t, int value)
gcn::Slider * mGreenSlider
void apply() override
Called when the Apply button is pressed in the setup window.
gcn::Label * mGradTypeLabel
TextPreview * mTextPreview
void action(const gcn::ActionEvent &event) override
gcn::Slider * mBlueSlider
gcn::Label * mGradTypeText
gcn::Label * mGradDelayLabel
gcn::Slider * mGradDelaySlider
void cancel() override
Called when the Cancel button is pressed in the setup window.
int getValue() const
Return the value for a numeric field.
void setRange(int min, int max)
Set the range on the field if it is numeric.
void setNumeric(bool numeric)
Determine whether the field should be numeric or not.
Preview widget for particle colors, etc.
void setFont(gcn::Font *font)
Sets the font to render the text in.
void setOutline(bool outline)
Sets whether to use an outline while rendering.
void setTextColor(const gcn::Color *color)
Sets the color the text is printed in.
void setShadow(bool shadow)
Sets whether to use a shadow while rendering.
void setColor(int type, int r, int g, int b)
Sets the color for the specified type.
void rollback()
Rollback the colors.
void setGradient(int type, Palette::GradientType grad)
Sets the gradient type for the specified color.
int getColorTypeAt(int i)
Gets the ColorType used by the color for the element at index i in the current color model.
void commit()
Commit the colors.
void setTestColor(int type, const gcn::Color &color)
Sets the test color associated with the specified type.
const gcn::Color & getCommittedColor(int type)
Gets the committed color associated with the specified type.
const gcn::Color & getTestColor(int type)
Gets the test color associated with the specified type.
void setGradientDelay(int type, int delay)
Sets the gradient delay for the specified color.
UserPalette * userPalette
gcn::Font * boldFont
Bolded text font.
std::string toString(const T &arg)
Converts the given value to a string using std::stringstream.