From 5ecd27dcaf1553f142cee0a89400d2335ba504f6 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sat, 2 Dec 2023 11:30:45 +0100 Subject: [PATCH] Apply part of guichan's changes 753608c0c8cd0196c19c467db0f8df5f61d99b3c (25/dec/2007): - `Widget::drawBorder`, `Widget::getBorderSize` and `Widget::setBorderSize` have been renamed to `Widget::drawFrame`, `Widget::getFrameSize` and `Widget::setFrameSize`. --- demo/ff/src/ffcharacterchooser.cpp | 2 +- demo/ff/src/ffcontainer.cpp | 2 +- demo/ff/src/ffdemo.cpp | 36 ++++++------- demo/ff/src/fflistbox.cpp | 2 +- demo/ff/src/ffscrollarea.cpp | 2 +- examples/openglwidgets.cpp | 6 +-- examples/sdl2widgets.cpp | 6 +-- examples/sdlwidgets.cpp | 6 +-- include/guisan/widget.hpp | 73 +++++++++++++++++--------- include/guisan/widgets/button.hpp | 2 +- include/guisan/widgets/checkbox.hpp | 2 +- include/guisan/widgets/container.hpp | 2 +- include/guisan/widgets/dropdown.hpp | 2 +- include/guisan/widgets/icon.hpp | 2 +- include/guisan/widgets/inputbox.hpp | 2 +- include/guisan/widgets/label.hpp | 2 +- include/guisan/widgets/listbox.hpp | 2 +- include/guisan/widgets/messagebox.hpp | 2 +- include/guisan/widgets/progressbar.hpp | 2 +- include/guisan/widgets/radiobutton.hpp | 2 +- include/guisan/widgets/scrollarea.hpp | 2 +- include/guisan/widgets/slider.hpp | 2 +- include/guisan/widgets/tab.hpp | 2 +- include/guisan/widgets/tabbedarea.hpp | 2 +- include/guisan/widgets/textbox.hpp | 2 +- include/guisan/widgets/textfield.hpp | 2 +- include/guisan/widgets/window.hpp | 2 +- src/basiccontainer.cpp | 14 ++--- src/gui.cpp | 14 ++--- src/widget.cpp | 4 +- src/widgets/button.cpp | 12 ++--- src/widgets/checkbox.cpp | 8 +-- src/widgets/container.cpp | 8 +-- src/widgets/dropdown.cpp | 10 ++-- src/widgets/icon.cpp | 8 +-- src/widgets/inputbox.cpp | 26 ++++----- src/widgets/label.cpp | 8 +-- src/widgets/listbox.cpp | 8 +-- src/widgets/messagebox.cpp | 12 ++--- src/widgets/progressbar.cpp | 14 ++--- src/widgets/radiobutton.cpp | 8 +-- src/widgets/scrollarea.cpp | 20 +++---- src/widgets/slider.cpp | 12 ++--- src/widgets/tab.cpp | 10 ++-- src/widgets/tabbedarea.cpp | 18 +++---- src/widgets/textbox.cpp | 12 ++--- src/widgets/textfield.cpp | 12 ++--- src/widgets/window.cpp | 16 +++--- 48 files changed, 224 insertions(+), 201 deletions(-) diff --git a/demo/ff/src/ffcharacterchooser.cpp b/demo/ff/src/ffcharacterchooser.cpp index 646e4ae..a188e77 100644 --- a/demo/ff/src/ffcharacterchooser.cpp +++ b/demo/ff/src/ffcharacterchooser.cpp @@ -52,7 +52,7 @@ FFCharacterChooser::FFCharacterChooser() mHand = gcn::Image::load("images/hand.png"); setFocusable(true); addKeyListener(this); - setBorderSize(0); + setFrameSize(0); } FFCharacterChooser::~FFCharacterChooser() diff --git a/demo/ff/src/ffcontainer.cpp b/demo/ff/src/ffcontainer.cpp index 5f78c56..2b5917a 100644 --- a/demo/ff/src/ffcontainer.cpp +++ b/demo/ff/src/ffcontainer.cpp @@ -79,7 +79,7 @@ FFContainer::FFContainer() Container::setHeight(0); mSlideTarget = 0; mCurrentSlide = 0; - setBorderSize(0); + setFrameSize(0); } FFContainer::~FFContainer() diff --git a/demo/ff/src/ffdemo.cpp b/demo/ff/src/ffdemo.cpp index 360fceb..3ebae5f 100644 --- a/demo/ff/src/ffdemo.cpp +++ b/demo/ff/src/ffdemo.cpp @@ -96,7 +96,7 @@ FFDemo::FFDemo() mGoldFootsteps = new FFContainer(); mGoldFootsteps->setDimension(gcn::Rectangle(210, 170, 110, 70)); mGoldFootsteps->setOpaque(false); - mGoldFootsteps->setBorderSize(0); + mGoldFootsteps->setFrameSize(0); mTop->add(mGoldFootsteps); mTime = new FFContainer(); @@ -109,13 +109,13 @@ FFDemo::FFDemo() mGoldFootstepsInfo1->setOpaque(false); mGoldFootstepsInfo1->setEditable(false); mGoldFootstepsInfo1->setFocusable(false); - mGoldFootstepsInfo1->setBorderSize(0); + mGoldFootstepsInfo1->setFrameSize(0); mGoldFootstepsInfo2 = new gcn::TextBox("\n 9119092\n\n 1009213"); mGoldFootstepsInfo2->setOpaque(false); mGoldFootstepsInfo2->setEditable(false); mGoldFootstepsInfo2->setFocusable(false); - mGoldFootstepsInfo2->setBorderSize(0); + mGoldFootstepsInfo2->setFrameSize(0); mTimeLabel1 = new gcn::Label("Time"); mTimeLabel1->setFont(mFontCyan); @@ -210,39 +210,39 @@ void FFDemo::initMain() mPerInfo1->setOpaque(false); mPerInfo1->setEditable(false); mPerInfo1->setFocusable(false); - mPerInfo1->setBorderSize(0); + mPerInfo1->setFrameSize(0); mPerInfo2 = new gcn::TextBox("FINALMAN\n 13\n 12/ 336\n 33/ 40"); mPerInfo2->setOpaque(false); mPerInfo2->setEditable(false); mPerInfo2->setFocusable(false); - mPerInfo2->setBorderSize(0); + mPerInfo2->setFrameSize(0); mOlofInfo1 = new gcn::TextBox("\n LV\n HP\n MP"); mOlofInfo1->setFont(mFontCyan); mOlofInfo1->setOpaque(false); mOlofInfo1->setEditable(false); mOlofInfo1->setFocusable(false); - mOlofInfo1->setBorderSize(0); + mOlofInfo1->setFrameSize(0); mOlofInfo2 = new gcn::TextBox("YAKSLEM\n 41\n 1304/2932\n 298/ 300"); mOlofInfo2->setOpaque(false); mOlofInfo2->setEditable(false); mOlofInfo2->setFocusable(false); - mOlofInfo2->setBorderSize(0); + mOlofInfo2->setFrameSize(0); mTomasInfo1 = new gcn::TextBox("\n LV\n HP\n MP"); mTomasInfo1->setFont(mFontCyan); mTomasInfo1->setOpaque(false); mTomasInfo1->setEditable(false); mTomasInfo1->setFocusable(false); - mTomasInfo1->setBorderSize(0); + mTomasInfo1->setFrameSize(0); mTomasInfo2 = new gcn::TextBox("PEAK\n 6\n 101/ 101\n 0/ 0"); mTomasInfo2->setOpaque(false); mTomasInfo2->setEditable(false); mTomasInfo2->setFocusable(false); - mTomasInfo2->setBorderSize(0); + mTomasInfo2->setFrameSize(0); int offset = 6; mMain->add(mPerIcon, 10, offset); @@ -308,7 +308,7 @@ void FFDemo::initStatus() mPerStatus1->setEditable(false); mPerStatus1->setFocusable(false); mPerStatus1->setVisible(false); - mPerStatus1->setBorderSize(0); + mPerStatus1->setFrameSize(0); mPerStatus2 = new gcn::TextBox(" 32 12382\n" " 56 13872\n" @@ -321,7 +321,7 @@ void FFDemo::initStatus() mPerStatus2->setEditable(false); mPerStatus2->setFocusable(false); mPerStatus2->setVisible(false); - mPerStatus2->setBorderSize(0); + mPerStatus2->setFrameSize(0); mOlofStatus1 = new gcn::TextBox(" STR EXP\n" " INT NEXT\n" @@ -332,7 +332,7 @@ void FFDemo::initStatus() mOlofStatus1->setEditable(false); mOlofStatus1->setFocusable(false); mOlofStatus1->setVisible(false); - mOlofStatus1->setBorderSize(0); + mOlofStatus1->setFrameSize(0); mOlofStatus2 = new gcn::TextBox(" 2 412382\n" " 72 513872\n" @@ -345,7 +345,7 @@ void FFDemo::initStatus() mOlofStatus2->setEditable(false); mOlofStatus2->setFocusable(false); mOlofStatus2->setVisible(false); - mOlofStatus2->setBorderSize(0); + mOlofStatus2->setFrameSize(0); mTomasStatus1 = new gcn::TextBox(" STR EXP\n" " INT NEXT\n" @@ -356,7 +356,7 @@ void FFDemo::initStatus() mTomasStatus1->setEditable(false); mTomasStatus1->setFocusable(false); mTomasStatus1->setVisible(false); - mTomasStatus1->setBorderSize(0); + mTomasStatus1->setFrameSize(0); mTomasStatus2 = new gcn::TextBox(" 1 412382\n" " 3 513872\n" @@ -369,7 +369,7 @@ void FFDemo::initStatus() mTomasStatus2->setEditable(false); mTomasStatus2->setFocusable(false); mTomasStatus2->setVisible(false); - mTomasStatus2->setBorderSize(0); + mTomasStatus2->setFrameSize(0); mStatus->add(mPerStatus2, 5, 10); mStatus->add(mPerStatus1, 5, 10); @@ -509,7 +509,7 @@ void FFDemo::initItems() mItemsInfoInfo->setEditable(false); mItemsInfoInfo->setFocusable(false); mItemsInfoInfo->setDimension(gcn::Rectangle(5, 5, 310, 40)); - mItemsInfoInfo->setBorderSize(0); + mItemsInfoInfo->setFrameSize(0); mItemsInfo->add(mItemsInfoInfo); mItemsList = new FFListBox(); @@ -584,9 +584,9 @@ void FFDemo::initAbout() mAboutScrollArea->setContent(mAboutInfo); mAboutScrollArea->setFocusable(true); mAboutScrollArea->setDimension(gcn::Rectangle(5, 5, 310, 230)); - mAboutScrollArea->setBorderSize(0); + mAboutScrollArea->setFrameSize(0); mAbout->add(mAboutScrollArea); - mAbout->setBorderSize(0); + mAbout->setFrameSize(0); } void FFDemo::cleanAbout() diff --git a/demo/ff/src/fflistbox.cpp b/demo/ff/src/fflistbox.cpp index 3b04dc6..fdbe5ea 100644 --- a/demo/ff/src/fflistbox.cpp +++ b/demo/ff/src/fflistbox.cpp @@ -61,7 +61,7 @@ FFListBox::FFListBox() } mInstances++; - setBorderSize(0); + setFrameSize(0); setWrappingEnabled(true); } diff --git a/demo/ff/src/ffscrollarea.cpp b/demo/ff/src/ffscrollarea.cpp index 61cc9a9..d4dfc4a 100644 --- a/demo/ff/src/ffscrollarea.cpp +++ b/demo/ff/src/ffscrollarea.cpp @@ -50,7 +50,7 @@ FFScrollArea::FFScrollArea() setScrollPolicy(SHOW_NEVER, SHOW_NEVER); addKeyListener(this); setFocusable(false); - setBorderSize(0); + setFrameSize(0); } void FFScrollArea::draw(gcn::Graphics *graphics) diff --git a/examples/openglwidgets.cpp b/examples/openglwidgets.cpp index 5bf3d7f..5dfdb96 100644 --- a/examples/openglwidgets.cpp +++ b/examples/openglwidgets.cpp @@ -138,10 +138,10 @@ void initWidgets() textBoxScrollArea = new gcn::ScrollArea(textBox); textBoxScrollArea->setWidth(270); textBoxScrollArea->setHeight(100); - textBoxScrollArea->setBorderSize(1); + textBoxScrollArea->setFrameSize(1); listBox = new gcn::ListBox(&demoListModel); - listBox->setBorderSize(1); + listBox->setFrameSize(1); dropDown = new gcn::DropDown(&demoListModel); @@ -172,7 +172,7 @@ void initWidgets() nestedScrollArea = new gcn::ScrollArea(nestedContainer); nestedScrollArea->setSize(180, 90); - nestedScrollArea->setBorderSize(1); + nestedScrollArea->setFrameSize(1); /* * Add them to the top container diff --git a/examples/sdl2widgets.cpp b/examples/sdl2widgets.cpp index 423abd6..37af935 100644 --- a/examples/sdl2widgets.cpp +++ b/examples/sdl2widgets.cpp @@ -120,10 +120,10 @@ initWidgets() textBoxScrollArea = new gcn::ScrollArea(textBox); textBoxScrollArea->setWidth(270); textBoxScrollArea->setHeight(100); - textBoxScrollArea->setBorderSize(1); + textBoxScrollArea->setFrameSize(1); listBox = new gcn::ListBox(&demoListModel); - listBox->setBorderSize(1); + listBox->setFrameSize(1); dropDown = new gcn::DropDown(&demoListModel); @@ -154,7 +154,7 @@ initWidgets() nestedScrollArea = new gcn::ScrollArea(nestedContainer); nestedScrollArea->setSize(180, 90); - nestedScrollArea->setBorderSize(1); + nestedScrollArea->setFrameSize(1); /* * Add them to the top container diff --git a/examples/sdlwidgets.cpp b/examples/sdlwidgets.cpp index 01af829..4d25164 100644 --- a/examples/sdlwidgets.cpp +++ b/examples/sdlwidgets.cpp @@ -121,10 +121,10 @@ initWidgets() textBoxScrollArea = new gcn::ScrollArea(textBox); textBoxScrollArea->setWidth(270); textBoxScrollArea->setHeight(100); - textBoxScrollArea->setBorderSize(1); + textBoxScrollArea->setFrameSize(1); listBox = new gcn::ListBox(&demoListModel); - listBox->setBorderSize(1); + listBox->setFrameSize(1); dropDown = new gcn::DropDown(&demoListModel); @@ -159,7 +159,7 @@ initWidgets() nestedScrollArea = new gcn::ScrollArea(nestedContainer); nestedScrollArea->setSize(180, 90); - nestedScrollArea->setBorderSize(1); + nestedScrollArea->setFrameSize(1); /* * Add them to the top container diff --git a/include/guisan/widget.hpp b/include/guisan/widget.hpp index d9c4826..29aed85 100644 --- a/include/guisan/widget.hpp +++ b/include/guisan/widget.hpp @@ -117,14 +117,57 @@ namespace gcn virtual void draw(Graphics* graphics) = 0; /** - * Draws the widget border. A border is drawn around a widget. - * The width and height of the border is therefore the widgets - * height+2*bordersize. Think of a painting that has a certain size, - * the border surrounds the painting. + * Called when a widget is given a chance to draw a frame around itself. + * The frame is not considered a part of the widget, it only allows a frame + * to be drawn around the widget, thus a frame will never be included when + * calculating if a widget should receive events from user input. Also + * a widget's frame will never be included when calculating a widget's + * position. + * + * The size of the frame is calculated using the widget's frame size. + * If a widget has a frame size of 10 pixels than the area the drawFrame + * function can draw to will be the size of the widget with an additional + * extension of 10 pixels in each direction. * * @param graphics a Graphics object to draw with. + * An example when drawFrame is a useful function is if a widget needs + * a glow around itself. + * + * @param graphics a graphics object to draw with. + * @see setFrameSize, getFrameSize + */ + virtual void drawFrame(Graphics* graphics) { } + + /** + * Sets the size of the widget's frame. The frame is not considered a part of + * the widget, it only allows a frame to be drawn around the widget, thus a frame + * will never be included when calculating if a widget should receive events + * from user input. Also a widget's frame will never be included when calculating + * a widget's position. + * + * A frame size of 0 means that the widget has no frame. The default frame size + * is 0. + * + * @param frameSize The size of the widget's frame. + * @see getFrameSize, drawFrame + */ + void setFrameSize(unsigned int frameSize); + + /** + * Gets the size of the widget's frame. The frame is not considered a part of + * the widget, it only allows a frame to be drawn around the widget, thus a frame + * will never be included when calculating if a widget should receive events + * from user input. Also a widget's frame will never be included when calculating + * a widget's position. + * + * A frame size of 0 means that the widget has no frame. The default frame size + * is 0. + * + * @return The size of the widget's frame. + * @see setFrameSize, drawFrame */ - virtual void drawBorder(Graphics* graphics) { } + unsigned int getFrameSize() const; + /** * Called for all widgets in the gui each time Gui::logic is called. @@ -221,26 +264,6 @@ namespace gcn */ void setDimension(const Rectangle& dimension); - /** - * Sets the size of the border, or the width if you so like. The size - * is the number of pixels that the border extends outside the widget. - * Border size = 0 means no border. - * - * @param borderSize the size of the border. - * @see drawBorder - */ - void setBorderSize(unsigned int borderSize); - - /** - * Gets the size of the border, or the width if you so like. The size - * is the number of pixels that the border extends outside the widget. - * Border size = 0 means no border. - * - * @return the size of the border. - * @see drawBorder - */ - unsigned int getBorderSize() const; - /** * Gets the dimension of the widget. It is relative to its parent. * diff --git a/include/guisan/widgets/button.hpp b/include/guisan/widgets/button.hpp index c565132..c4a6968 100644 --- a/include/guisan/widgets/button.hpp +++ b/include/guisan/widgets/button.hpp @@ -149,7 +149,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from FocusListener diff --git a/include/guisan/widgets/checkbox.hpp b/include/guisan/widgets/checkbox.hpp index 995fd6c..1ca0aff 100644 --- a/include/guisan/widgets/checkbox.hpp +++ b/include/guisan/widgets/checkbox.hpp @@ -144,7 +144,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from KeyListener diff --git a/include/guisan/widgets/container.hpp b/include/guisan/widgets/container.hpp index 6a2d4d4..5396f0a 100644 --- a/include/guisan/widgets/container.hpp +++ b/include/guisan/widgets/container.hpp @@ -164,7 +164,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); protected: /** diff --git a/include/guisan/widgets/dropdown.hpp b/include/guisan/widgets/dropdown.hpp index f854df0..738892d 100644 --- a/include/guisan/widgets/dropdown.hpp +++ b/include/guisan/widgets/dropdown.hpp @@ -177,7 +177,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); void setBaseColor(const Color& color); diff --git a/include/guisan/widgets/icon.hpp b/include/guisan/widgets/icon.hpp index 6360414..d444e80 100644 --- a/include/guisan/widgets/icon.hpp +++ b/include/guisan/widgets/icon.hpp @@ -93,7 +93,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); protected: /** diff --git a/include/guisan/widgets/inputbox.hpp b/include/guisan/widgets/inputbox.hpp index df4ec60..57406f1 100644 --- a/include/guisan/widgets/inputbox.hpp +++ b/include/guisan/widgets/inputbox.hpp @@ -119,7 +119,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener diff --git a/include/guisan/widgets/label.hpp b/include/guisan/widgets/label.hpp index 8a3b0f3..89fe25f 100644 --- a/include/guisan/widgets/label.hpp +++ b/include/guisan/widgets/label.hpp @@ -130,7 +130,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); protected: /** diff --git a/include/guisan/widgets/listbox.hpp b/include/guisan/widgets/listbox.hpp index eac472c..c7d04d3 100644 --- a/include/guisan/widgets/listbox.hpp +++ b/include/guisan/widgets/listbox.hpp @@ -189,7 +189,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); virtual void logic(); diff --git a/include/guisan/widgets/messagebox.hpp b/include/guisan/widgets/messagebox.hpp index e1856a6..44a9d04 100644 --- a/include/guisan/widgets/messagebox.hpp +++ b/include/guisan/widgets/messagebox.hpp @@ -209,7 +209,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener diff --git a/include/guisan/widgets/progressbar.hpp b/include/guisan/widgets/progressbar.hpp index 8349f35..6030ce5 100644 --- a/include/guisan/widgets/progressbar.hpp +++ b/include/guisan/widgets/progressbar.hpp @@ -190,7 +190,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); protected: /** diff --git a/include/guisan/widgets/radiobutton.hpp b/include/guisan/widgets/radiobutton.hpp index bf05979..0acbf99 100644 --- a/include/guisan/widgets/radiobutton.hpp +++ b/include/guisan/widgets/radiobutton.hpp @@ -169,7 +169,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from KeyListener diff --git a/include/guisan/widgets/scrollarea.hpp b/include/guisan/widgets/scrollarea.hpp index 695f857..37ad2df 100644 --- a/include/guisan/widgets/scrollarea.hpp +++ b/include/guisan/widgets/scrollarea.hpp @@ -306,7 +306,7 @@ namespace gcn virtual void draw(Graphics *graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); virtual void logic(); diff --git a/include/guisan/widgets/slider.hpp b/include/guisan/widgets/slider.hpp index 3248245..eadb793 100644 --- a/include/guisan/widgets/slider.hpp +++ b/include/guisan/widgets/slider.hpp @@ -221,7 +221,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener. diff --git a/include/guisan/widgets/tab.hpp b/include/guisan/widgets/tab.hpp index 121b4a2..1bcabb7 100644 --- a/include/guisan/widgets/tab.hpp +++ b/include/guisan/widgets/tab.hpp @@ -134,7 +134,7 @@ namespace gcn virtual void draw(Graphics *graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener diff --git a/include/guisan/widgets/tabbedarea.hpp b/include/guisan/widgets/tabbedarea.hpp index 14497d3..8db17e9 100644 --- a/include/guisan/widgets/tabbedarea.hpp +++ b/include/guisan/widgets/tabbedarea.hpp @@ -184,7 +184,7 @@ namespace gcn virtual void draw(Graphics *graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); virtual void logic(); diff --git a/include/guisan/widgets/textbox.hpp b/include/guisan/widgets/textbox.hpp index 74a250b..7368b6d 100644 --- a/include/guisan/widgets/textbox.hpp +++ b/include/guisan/widgets/textbox.hpp @@ -242,7 +242,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); virtual void fontChanged(); diff --git a/include/guisan/widgets/textfield.hpp b/include/guisan/widgets/textfield.hpp index b946894..4a9dd7d 100644 --- a/include/guisan/widgets/textfield.hpp +++ b/include/guisan/widgets/textfield.hpp @@ -139,7 +139,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener diff --git a/include/guisan/widgets/window.hpp b/include/guisan/widgets/window.hpp index d16ae03..9c35cfe 100644 --- a/include/guisan/widgets/window.hpp +++ b/include/guisan/widgets/window.hpp @@ -204,7 +204,7 @@ namespace gcn virtual void draw(Graphics* graphics); - virtual void drawBorder(Graphics* graphics); + virtual void drawFrame(Graphics* graphics); // Inherited from MouseListener diff --git a/src/basiccontainer.cpp b/src/basiccontainer.cpp index 08bd85a..a0c1cec 100644 --- a/src/basiccontainer.cpp +++ b/src/basiccontainer.cpp @@ -296,17 +296,17 @@ namespace gcn { if ((*iter)->isVisible()) { - // If the widget has a border, + // If the widget has a frame, // draw it before drawing the widget - if ((*iter)->getBorderSize() > 0) + if ((*iter)->getFrameSize() > 0) { Rectangle rec = (*iter)->getDimension(); - rec.x -= (*iter)->getBorderSize(); - rec.y -= (*iter)->getBorderSize(); - rec.width += 2 * (*iter)->getBorderSize(); - rec.height += 2 * (*iter)->getBorderSize(); + rec.x -= (*iter)->getFrameSize(); + rec.y -= (*iter)->getFrameSize(); + rec.width += 2 * (*iter)->getFrameSize(); + rec.height += 2 * (*iter)->getFrameSize(); graphics->pushClipArea(rec); - (*iter)->drawBorder(graphics); + (*iter)->drawFrame(graphics); graphics->popClipArea(); } diff --git a/src/gui.cpp b/src/gui.cpp index cd7bdc2..b3403b8 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -181,17 +181,17 @@ namespace gcn mGraphics->_beginDraw(); - // If top has a border, + // If top has a frame, // draw it before drawing top - if (mTop->getBorderSize() > 0) + if (mTop->getFrameSize() > 0) { Rectangle rec = mTop->getDimension(); - rec.x -= mTop->getBorderSize(); - rec.y -= mTop->getBorderSize(); - rec.width += 2 * mTop->getBorderSize(); - rec.height += 2 * mTop->getBorderSize(); + rec.x -= mTop->getFrameSize(); + rec.y -= mTop->getFrameSize(); + rec.width += 2 * mTop->getFrameSize(); + rec.height += 2 * mTop->getFrameSize(); mGraphics->pushClipArea(rec); - mTop->drawBorder(mGraphics); + mTop->drawFrame(mGraphics); mGraphics->popClipArea(); } diff --git a/src/widget.cpp b/src/widget.cpp index 43baca6..ff7e496 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -203,12 +203,12 @@ namespace gcn } } - void Widget::setBorderSize(unsigned int borderSize) + void Widget::setFrameSize(unsigned int borderSize) { mBorderSize = borderSize; } - unsigned int Widget::getBorderSize() const + unsigned int Widget::getFrameSize() const { return mBorderSize; } diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 77be28e..4b8b4e0 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -78,7 +78,7 @@ namespace gcn { setFocusable(true); adjustSize(); - setBorderSize(1); + setFrameSize(1); addMouseListener(this); addKeyListener(this); @@ -95,7 +95,7 @@ namespace gcn { setFocusable(true); adjustSize(); - setBorderSize(1); + setFrameSize(1); addMouseListener(this); addKeyListener(this); @@ -207,20 +207,20 @@ namespace gcn } } - void Button::drawBorder(Graphics* graphics) + void Button::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/checkbox.cpp b/src/widgets/checkbox.cpp index 1fd4bfb..7520d7a 100644 --- a/src/widgets/checkbox.cpp +++ b/src/widgets/checkbox.cpp @@ -104,20 +104,20 @@ namespace gcn graphics->drawText(getCaption(), h - 2, 0); } - void CheckBox::drawBorder(Graphics* graphics) + void CheckBox::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/container.cpp b/src/widgets/container.cpp index 5cc51a9..649e6f4 100644 --- a/src/widgets/container.cpp +++ b/src/widgets/container.cpp @@ -87,20 +87,20 @@ namespace gcn drawChildren(graphics); } - void Container::drawBorder(Graphics* graphics) + void Container::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 7384087..700f77f 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -118,7 +118,7 @@ namespace gcn addFocusListener(this); adjustHeight(); - setBorderSize(1); + setFrameSize(1); } DropDown::~DropDown() @@ -194,20 +194,20 @@ namespace gcn } } - void DropDown::drawBorder(Graphics* graphics) + void DropDown::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 3091983..5759116 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -95,20 +95,20 @@ namespace gcn graphics->drawImage(mImage, 0, 0); } - void Icon::drawBorder(Graphics* graphics) + void Icon::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/inputbox.cpp b/src/widgets/inputbox.cpp index 6cadb3a..31a140a 100644 --- a/src/widgets/inputbox.cpp +++ b/src/widgets/inputbox.cpp @@ -101,19 +101,19 @@ namespace gcn mButtonCancel->setWidth(mButtonOK->getWidth()); } - setHeight((int)getTitleBarHeight() + mLabel->getHeight() + mText->getHeight() + 6 * mPadding + mButtonOK->getHeight() + 2 * getBorderSize()); - setWidth(mLabel->getWidth() + 2 * mPadding + 2 * getBorderSize()); - if(2 * mButtonOK->getWidth() + 4 * mPadding + 2 * getBorderSize() > getWidth()) + setHeight((int)getTitleBarHeight() + mLabel->getHeight() + mText->getHeight() + 6 * mPadding + mButtonOK->getHeight() + 2 * getFrameSize()); + setWidth(mLabel->getWidth() + 2 * mPadding + 2 * getFrameSize()); + if(2 * mButtonOK->getWidth() + 4 * mPadding + 2 * getFrameSize() > getWidth()) { - setWidth(2 * mButtonOK->getWidth() + 4*mPadding + 2 * getBorderSize()); + setWidth(2 * mButtonOK->getWidth() + 4*mPadding + 2 * getFrameSize()); } - mText->setWidth(getWidth() - 2 * getBorderSize() - 5 * mPadding); + mText->setWidth(getWidth() - 2 * getFrameSize() - 5 * mPadding); this->add(mLabel, (getWidth() - mLabel->getWidth())/2 - mPadding, mPadding); this->add(mText, 2*mPadding, 2 * mPadding + mLabel->getHeight()); - int yButtons = getHeight() - (int)getTitleBarHeight() - getBorderSize() - 2*mPadding - mButtonOK->getHeight(); + int yButtons = getHeight() - (int)getTitleBarHeight() - getFrameSize() - 2*mPadding - mButtonOK->getHeight(); this->add(mButtonOK, (getWidth() - 2 * mButtonOK->getWidth())/4, yButtons); - this->add(mButtonCancel, getWidth() - 2*getBorderSize() - mButtonOK->getWidth() - mPadding, yButtons); + this->add(mButtonCancel, getWidth() - 2*getFrameSize() - mButtonOK->getWidth() - mPadding, yButtons); try { @@ -140,8 +140,8 @@ namespace gcn Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - //int width = getWidth() + getBorderSize() * 2 - 1; - //int height = getHeight() + getBorderSize() * 2 - 1; + //int width = getWidth() + getFrameSize() * 2 - 1; + //int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; @@ -232,20 +232,20 @@ namespace gcn graphics->popClipArea(); } - void InputBox::drawBorder(Graphics* graphics) + void InputBox::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(highlightColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/label.cpp b/src/widgets/label.cpp index a558499..16311eb 100644 --- a/src/widgets/label.cpp +++ b/src/widgets/label.cpp @@ -128,20 +128,20 @@ namespace gcn graphics->drawText(getCaption(), textX, textY, getAlignment()); } - void Label::drawBorder(Graphics* graphics) + void Label::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i, i, width - i, i); diff --git a/src/widgets/listbox.cpp b/src/widgets/listbox.cpp index 5d8adc5..ebd15da 100644 --- a/src/widgets/listbox.cpp +++ b/src/widgets/listbox.cpp @@ -171,20 +171,20 @@ namespace gcn } } - void ListBox::drawBorder(Graphics* graphics) + void ListBox::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/messagebox.cpp b/src/widgets/messagebox.cpp index e29490e..c4fd096 100644 --- a/src/widgets/messagebox.cpp +++ b/src/widgets/messagebox.cpp @@ -247,8 +247,8 @@ namespace gcn Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - //int width = getWidth() + getBorderSize() * 2 - 1; - //int height = getHeight() + getBorderSize() * 2 - 1; + //int width = getWidth() + getFrameSize() * 2 - 1; + //int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; @@ -339,20 +339,20 @@ namespace gcn graphics->popClipArea(); } - void MessageBox::drawBorder(Graphics* graphics) + void MessageBox::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(highlightColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/progressbar.cpp b/src/widgets/progressbar.cpp index e2226be..c238469 100644 --- a/src/widgets/progressbar.cpp +++ b/src/widgets/progressbar.cpp @@ -74,7 +74,7 @@ namespace gcn mEnd = 100; setHeight(getFont()->getHeight()); - setBorderSize(1); + setFrameSize(1); } ProgressBar::ProgressBar(const unsigned int start, @@ -103,7 +103,7 @@ namespace gcn } setHeight(getFont()->getHeight()); - setBorderSize(1); + setFrameSize(1); } ProgressBar::ProgressBar(const std::string& caption) : Label(caption) @@ -112,7 +112,7 @@ namespace gcn mAlignment = Graphics::CENTER; setHeight(getFont()->getHeight()); - setBorderSize(1); + setFrameSize(1); } const std::string &ProgressBar::getCaption() const @@ -191,20 +191,20 @@ namespace gcn graphics->drawText(getCaption(), textX, textY, getAlignment()); } - void ProgressBar::drawBorder(Graphics* graphics) + void ProgressBar::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i, i, width - i, i); diff --git a/src/widgets/radiobutton.cpp b/src/widgets/radiobutton.cpp index 1b51313..996c511 100644 --- a/src/widgets/radiobutton.cpp +++ b/src/widgets/radiobutton.cpp @@ -122,20 +122,20 @@ namespace gcn graphics->drawText(getCaption(), h - 2, 0); } - void RadioButton::drawBorder(Graphics* graphics) + void RadioButton::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i, i, width - i, i); diff --git a/src/widgets/scrollarea.cpp b/src/widgets/scrollarea.cpp index dbd0f41..dc116ec 100644 --- a/src/widgets/scrollarea.cpp +++ b/src/widgets/scrollarea.cpp @@ -249,7 +249,7 @@ namespace gcn } int value = getContent()->getWidth() - getChildrenArea().width + - 2 * getContent()->getBorderSize(); + 2 * getContent()->getFrameSize(); if (value < 0) { @@ -271,7 +271,7 @@ namespace gcn int value; value = getContent()->getHeight() - getChildrenArea().height + - 2 * getContent()->getBorderSize(); + 2 * getContent()->getFrameSize(); if (value < 0) { @@ -454,20 +454,20 @@ namespace gcn drawChildren(graphics); } - void ScrollArea::drawBorder(Graphics* graphics) + void ScrollArea::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i,i, width - i, i); @@ -833,8 +833,8 @@ namespace gcn if (getContent() != NULL) { - getContent()->setPosition(-mHScroll + getContent()->getBorderSize(), - -mVScroll + getContent()->getBorderSize()); + getContent()->setPosition(-mHScroll + getContent()->getFrameSize(), + -mVScroll + getContent()->getFrameSize()); getContent()->logic(); } } @@ -1170,8 +1170,8 @@ namespace gcn BasicContainer::showWidgetPart(widget, area); - setHorizontalScrollAmount(getContent()->getBorderSize() - getContent()->getX()); - setVerticalScrollAmount(getContent()->getBorderSize() - getContent()->getY()); + setHorizontalScrollAmount(getContent()->getFrameSize() - getContent()->getX()); + setVerticalScrollAmount(getContent()->getFrameSize() - getContent()->getY()); } Widget *ScrollArea::getWidgetAt(int x, int y) diff --git a/src/widgets/slider.cpp b/src/widgets/slider.cpp index 9546f3e..ce0575c 100644 --- a/src/widgets/slider.cpp +++ b/src/widgets/slider.cpp @@ -74,7 +74,7 @@ namespace gcn mScaleEnd = scaleEnd; setFocusable(true); - setBorderSize(1); + setFrameSize(1); setOrientation(HORIZONTAL); setValue(0); setStepLength(scaleEnd / 10); @@ -92,7 +92,7 @@ namespace gcn mScaleEnd = scaleEnd; setFocusable(true); - setBorderSize(1); + setFrameSize(1); setOrientation(HORIZONTAL); setValue(scaleStart); setStepLength((scaleEnd - scaleStart) / 10); @@ -146,20 +146,20 @@ namespace gcn drawMarker(graphics); } - void Slider::drawBorder(gcn::Graphics* graphics) + void Slider::drawFrame(gcn::Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i, i, width - i, i); diff --git a/src/widgets/tab.cpp b/src/widgets/tab.cpp index dde493b..4a92d9d 100644 --- a/src/widgets/tab.cpp +++ b/src/widgets/tab.cpp @@ -74,7 +74,7 @@ namespace gcn mLabel = new Label(); mLabel->setPosition(4, 4); add(mLabel); - setBorderSize(1); + setFrameSize(1); addMouseListener(this); } @@ -134,20 +134,20 @@ namespace gcn } } - void Tab::drawBorder(Graphics* graphics) + void Tab::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(highlightColor); graphics->drawLine(i,i, width - i, i); diff --git a/src/widgets/tabbedarea.cpp b/src/widgets/tabbedarea.cpp index dd29942..06821c3 100644 --- a/src/widgets/tabbedarea.cpp +++ b/src/widgets/tabbedarea.cpp @@ -75,7 +75,7 @@ namespace gcn TabbedArea::TabbedArea() :mSelectedTab(NULL) { - setBorderSize(1); + setFrameSize(1); setFocusable(true); addKeyListener(this); addMouseListener(this); @@ -288,20 +288,20 @@ namespace gcn drawChildren(graphics); } - void TabbedArea::drawBorder(Graphics* graphics) + void TabbedArea::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(highlightColor); graphics->drawLine(i,i + mWidgetContainer->getY(), i, height - i - 1); @@ -363,7 +363,7 @@ namespace gcn if (x == 0) { - x = tab->getBorderSize() + 2; + x = tab->getFrameSize() + 2; } tab->setX(x); @@ -372,14 +372,14 @@ namespace gcn { tab->setY(maxTabHeight - tab->getHeight() - + tab->getBorderSize()); + + tab->getFrameSize()); } else { - tab->setY(mTabs[i].first->getBorderSize()); + tab->setY(mTabs[i].first->getFrameSize()); } - x += tab->getWidth() + tab->getBorderSize() * 2; + x += tab->getWidth() + tab->getFrameSize() * 2; } } diff --git a/src/widgets/textbox.cpp b/src/widgets/textbox.cpp index 47d7066..05b08bf 100644 --- a/src/widgets/textbox.cpp +++ b/src/widgets/textbox.cpp @@ -80,7 +80,7 @@ namespace gcn addMouseListener(this); addKeyListener(this); adjustSize(); - setBorderSize(1); + setFrameSize(1); setText(""); } @@ -98,7 +98,7 @@ namespace gcn addMouseListener(this); addKeyListener(this); adjustSize(); - setBorderSize(1); + setFrameSize(1); } void TextBox::setText(const std::string& text) @@ -156,15 +156,15 @@ namespace gcn } } - void TextBox::drawBorder(Graphics* graphics) + void TextBox::drawFrame(Graphics* graphics) { - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; graphics->setColor(getBackgroundColor()); unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->drawLine(i,i, width - i, i); graphics->drawLine(i,i + 1, i, height - i - 1); diff --git a/src/widgets/textfield.cpp b/src/widgets/textfield.cpp index 8737d37..3e10f10 100644 --- a/src/widgets/textfield.cpp +++ b/src/widgets/textfield.cpp @@ -77,7 +77,7 @@ namespace gcn addMouseListener(this); addKeyListener(this); adjustHeight(); - setBorderSize(1); + setFrameSize(1); } TextField::TextField(const std::string& text) @@ -87,7 +87,7 @@ namespace gcn mText = text; adjustSize(); - setBorderSize(1); + setFrameSize(1); setFocusable(true); @@ -125,20 +125,20 @@ namespace gcn graphics->drawText(mText, 1 - mXScroll, 2); } - void TextField::drawBorder(Graphics* graphics) + void TextField::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(shadowColor); graphics->drawLine(i, i, width - i, i); diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index 51b2dd9..4be331b 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -70,7 +70,7 @@ namespace gcn Window::Window() :mMoved(false) { - setBorderSize(1); + setFrameSize(1); setPadding(2); setTitleBarHeight(getFont()->getHeight() + 2); setAlignment(Graphics::CENTER); @@ -83,7 +83,7 @@ namespace gcn :mMoved(false) { setCaption(caption); - setBorderSize(1); + setFrameSize(1); setPadding(2); setTitleBarHeight(16); setAlignment(Graphics::CENTER); @@ -141,8 +141,8 @@ namespace gcn Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - //int width = getWidth() + getBorderSize() * 2 - 1; - //int height = getHeight() + getBorderSize() * 2 - 1; + //int width = getWidth() + getFrameSize() * 2 - 1; + //int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; @@ -233,20 +233,20 @@ namespace gcn graphics->popClipArea(); } - void Window::drawBorder(Graphics* graphics) + void Window::drawFrame(Graphics* graphics) { Color faceColor = getBaseColor(); Color highlightColor, shadowColor; int alpha = getBaseColor().a; - int width = getWidth() + getBorderSize() * 2 - 1; - int height = getHeight() + getBorderSize() * 2 - 1; + int width = getWidth() + getFrameSize() * 2 - 1; + int height = getHeight() + getFrameSize() * 2 - 1; highlightColor = faceColor + 0x303030; highlightColor.a = alpha; shadowColor = faceColor - 0x303030; shadowColor.a = alpha; unsigned int i; - for (i = 0; i < getBorderSize(); ++i) + for (i = 0; i < getFrameSize(); ++i) { graphics->setColor(highlightColor); graphics->drawLine(i, i, width - i, i);