moved textbutton to fbtk

This commit is contained in:
fluxgen 2003-08-19 16:15:32 +00:00
parent 3dc7ab0599
commit 3006ba49e4
8 changed files with 49 additions and 48 deletions

View file

@ -20,15 +20,15 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: ClockTool.hh,v 1.2 2003/08/13 09:35:38 fluxgen Exp $ // $Id: ClockTool.hh,v 1.3 2003/08/19 16:12:43 fluxgen Exp $
#ifndef CLOCKTOOL_HH #ifndef CLOCKTOOL_HH
#define CLOCKTOOL_HH #define CLOCKTOOL_HH
#include "ToolbarItem.hh" #include "ToolbarItem.hh"
#include "TextButton.hh"
#include "FbTk/TextButton.hh"
#include "FbTk/Observer.hh" #include "FbTk/Observer.hh"
#include "FbTk/Resource.hh" #include "FbTk/Resource.hh"
#include "FbTk/Timer.hh" #include "FbTk/Timer.hh"
@ -63,7 +63,7 @@ private:
void update(FbTk::Subject *subj); void update(FbTk::Subject *subj);
void renderTheme(); void renderTheme();
TextButton m_button; FbTk::TextButton m_button;
const ToolTheme &m_theme; const ToolTheme &m_theme;
BScreen &m_screen; BScreen &m_screen;

View file

@ -19,13 +19,15 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: FbWinFrame.cc,v 1.36 2003/08/13 16:36:37 fluxgen Exp $ // $Id: FbWinFrame.cc,v 1.37 2003/08/19 16:13:25 fluxgen Exp $
#include "FbWinFrame.hh" #include "FbWinFrame.hh"
#include "ImageControl.hh"
#include "EventManager.hh" #include "FbTk/ImageControl.hh"
#include "TextButton.hh" #include "FbTk/EventManager.hh"
#include "App.hh" #include "FbTk/TextButton.hh"
#include "FbTk/App.hh"
#include "FbWinFrameTheme.hh" #include "FbWinFrameTheme.hh"
#ifdef SHAPE #ifdef SHAPE
#include "Shape.hh" #include "Shape.hh"
@ -271,7 +273,7 @@ void FbWinFrame::removeAllButtons() {
} }
} }
void FbWinFrame::addLabelButton(TextButton &btn) { void FbWinFrame::addLabelButton(FbTk::TextButton &btn) {
LabelList::iterator found_it = find(m_labelbuttons.begin(), LabelList::iterator found_it = find(m_labelbuttons.begin(),
m_labelbuttons.end(), m_labelbuttons.end(),
&btn); &btn);
@ -282,7 +284,7 @@ void FbWinFrame::addLabelButton(TextButton &btn) {
m_labelbuttons.push_back(&btn); m_labelbuttons.push_back(&btn);
} }
void FbWinFrame::removeLabelButton(TextButton &btn) { void FbWinFrame::removeLabelButton(FbTk::TextButton &btn) {
LabelList::iterator erase_it = remove(m_labelbuttons.begin(), LabelList::iterator erase_it = remove(m_labelbuttons.begin(),
m_labelbuttons.end(), m_labelbuttons.end(),
&btn); &btn);
@ -293,7 +295,7 @@ void FbWinFrame::removeLabelButton(TextButton &btn) {
} }
void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) { void FbWinFrame::moveLabelButtonLeft(const FbTk::TextButton &btn) {
LabelList::iterator it = find(m_labelbuttons.begin(), LabelList::iterator it = find(m_labelbuttons.begin(),
m_labelbuttons.end(), m_labelbuttons.end(),
&btn); &btn);
@ -303,7 +305,7 @@ void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) {
LabelList::iterator new_pos = it; LabelList::iterator new_pos = it;
new_pos--; new_pos--;
TextButton *item = *it; FbTk::TextButton *item = *it;
// remove from list // remove from list
m_labelbuttons.erase(it); m_labelbuttons.erase(it);
// insert on the new place // insert on the new place
@ -312,7 +314,7 @@ void FbWinFrame::moveLabelButtonLeft(const TextButton &btn) {
redrawTitle(); redrawTitle();
} }
void FbWinFrame::moveLabelButtonRight(const TextButton &btn) { void FbWinFrame::moveLabelButtonRight(const FbTk::TextButton &btn) {
LabelList::iterator it = find(m_labelbuttons.begin(), LabelList::iterator it = find(m_labelbuttons.begin(),
m_labelbuttons.end(), m_labelbuttons.end(),
&btn); &btn);
@ -320,7 +322,7 @@ void FbWinFrame::moveLabelButtonRight(const TextButton &btn) {
if (it == m_labelbuttons.end() || *it == m_labelbuttons.back()) if (it == m_labelbuttons.end() || *it == m_labelbuttons.back())
return; return;
TextButton *item = *it; FbTk::TextButton *item = *it;
// remove from list // remove from list
LabelList::iterator new_pos = m_labelbuttons.erase(it); LabelList::iterator new_pos = m_labelbuttons.erase(it);
new_pos++; new_pos++;
@ -330,7 +332,7 @@ void FbWinFrame::moveLabelButtonRight(const TextButton &btn) {
redrawTitle(); redrawTitle();
} }
void FbWinFrame::setLabelButtonFocus(TextButton &btn) { void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) {
LabelList::iterator it = find(m_labelbuttons.begin(), LabelList::iterator it = find(m_labelbuttons.begin(),
m_labelbuttons.end(), m_labelbuttons.end(),
&btn); &btn);
@ -1031,7 +1033,7 @@ void FbWinFrame::setBorderWidth(unsigned int borderW) {
resize(width(), height() + bw_changes); resize(width(), height() + bw_changes);
} }
void FbWinFrame::renderButtonFocus(TextButton &button) { void FbWinFrame::renderButtonFocus(FbTk::TextButton &button) {
button.setGC(theme().labelTextFocusGC()); button.setGC(theme().labelTextFocusGC());
button.setJustify(theme().justify()); button.setJustify(theme().justify());
@ -1046,7 +1048,7 @@ void FbWinFrame::renderButtonFocus(TextButton &button) {
button.clear(); button.clear();
} }
void FbWinFrame::renderButtonUnfocus(TextButton &button) { void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) {
button.setGC(theme().labelTextUnfocusGC()); button.setGC(theme().labelTextUnfocusGC());
button.setJustify(theme().justify()); button.setJustify(theme().justify());
button.setBorderWidth(1); button.setBorderWidth(1);

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: FbWinFrame.hh,v 1.12 2003/08/13 16:36:37 fluxgen Exp $ // $Id: FbWinFrame.hh,v 1.13 2003/08/19 16:13:25 fluxgen Exp $
#ifndef FBWINFRAME_HH #ifndef FBWINFRAME_HH
#define FBWINFRAME_HH #define FBWINFRAME_HH
@ -38,9 +38,9 @@
class Shape; class Shape;
class FbWinFrameTheme; class FbWinFrameTheme;
class TextButton;
namespace FbTk { namespace FbTk {
class TextButton;
class ImageControl; class ImageControl;
class Command; class Command;
class Button; class Button;
@ -93,15 +93,15 @@ public:
/// remove all buttons from titlebar /// remove all buttons from titlebar
void removeAllButtons(); void removeAllButtons();
/// adds a button to label window /// adds a button to label window
void addLabelButton(TextButton &btn); void addLabelButton(FbTk::TextButton &btn);
/// removes a specific button from label window /// removes a specific button from label window
void removeLabelButton(TextButton &btn); void removeLabelButton(FbTk::TextButton &btn);
/// move label button to the left /// move label button to the left
void moveLabelButtonLeft(const TextButton &btn); void moveLabelButtonLeft(const FbTk::TextButton &btn);
/// move label button to the right /// move label button to the right
void moveLabelButtonRight(const TextButton &btn); void moveLabelButtonRight(const FbTk::TextButton &btn);
/// which button is to be rendered focused /// which button is to be rendered focused
void setLabelButtonFocus(TextButton &btn); void setLabelButtonFocus(FbTk::TextButton &btn);
/// attach a client window for client area /// attach a client window for client area
void setClientWindow(Window win); void setClientWindow(Window win);
/// same as above but with FbWindow /// same as above but with FbWindow
@ -182,8 +182,8 @@ private:
void renderTitlebar(); void renderTitlebar();
void renderHandles(); void renderHandles();
void renderButtons(); void renderButtons();
void renderButtonFocus(TextButton &button); void renderButtonFocus(FbTk::TextButton &button);
void renderButtonUnfocus(TextButton &button); void renderButtonUnfocus(FbTk::TextButton &button);
void renderLabel(); void renderLabel();
/// renders to pixmap or sets color /// renders to pixmap or sets color
void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm, void render(const FbTk::Texture &tex, FbTk::Color &col, Pixmap &pm,
@ -217,9 +217,9 @@ private:
typedef std::vector<FbTk::Button *> ButtonList; typedef std::vector<FbTk::Button *> ButtonList;
ButtonList m_buttons_left, ///< buttons to the left ButtonList m_buttons_left, ///< buttons to the left
m_buttons_right; ///< buttons to the right m_buttons_right; ///< buttons to the right
typedef std::list<TextButton *> LabelList; typedef std::list<FbTk::TextButton *> LabelList;
LabelList m_labelbuttons; ///< holds label buttons inside label window LabelList m_labelbuttons; ///< holds label buttons inside label window
TextButton *m_current_label; ///< which client button is focused at the moment FbTk::TextButton *m_current_label; ///< which client button is focused at the moment
std::string m_titletext; ///< text to be displayed int m_label std::string m_titletext; ///< text to be displayed int m_label
int m_bevel; ///< bevel between titlebar items and titlebar int m_bevel; ///< bevel between titlebar items and titlebar
bool m_use_titlebar; ///< if we should use titlebar bool m_use_titlebar; ///< if we should use titlebar

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: IconButton.cc,v 1.5 2003/08/16 12:04:12 fluxgen Exp $ // $Id: IconButton.cc,v 1.6 2003/08/19 16:13:25 fluxgen Exp $
#include "IconButton.hh" #include "IconButton.hh"
@ -42,7 +42,7 @@
IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, IconButton::IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font,
FluxboxWindow &win): FluxboxWindow &win):
TextButton(parent, font, win.winClient().title()), FbTk::TextButton(parent, font, win.winClient().title()),
m_win(win), m_win(win),
m_icon_window(*this, 1, 1, 1, 1, m_icon_window(*this, 1, 1, 1, 1,
ExposureMask | ButtonPressMask | ButtonReleaseMask) { ExposureMask | ButtonPressMask | ButtonReleaseMask) {

View file

@ -20,19 +20,18 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: IconButton.hh,v 1.1 2003/08/11 15:45:50 fluxgen Exp $ // $Id: IconButton.hh,v 1.2 2003/08/19 16:13:25 fluxgen Exp $
#ifndef ICONBUTTON_HH #ifndef ICONBUTTON_HH
#define ICONBUTTON_HH #define ICONBUTTON_HH
#include "FbTk/FbPixmap.hh" #include "FbTk/FbPixmap.hh"
#include "FbTk/Observer.hh" #include "FbTk/Observer.hh"
#include "FbTk/TextButton.hh"
#include "TextButton.hh"
class FluxboxWindow; class FluxboxWindow;
class IconButton: public TextButton, public FbTk::Observer { class IconButton: public FbTk::TextButton, public FbTk::Observer {
public: public:
IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FluxboxWindow &window); IconButton(const FbTk::FbWindow &parent, const FbTk::Font &font, FluxboxWindow &window);
virtual ~IconButton(); virtual ~IconButton();

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.218 2003/08/13 16:39:24 fluxgen Exp $ // $Id: Window.cc,v 1.219 2003/08/19 16:13:25 fluxgen Exp $
#include "Window.hh" #include "Window.hh"
@ -34,7 +34,7 @@
#include "Netizen.hh" #include "Netizen.hh"
#include "FbWinFrameTheme.hh" #include "FbWinFrameTheme.hh"
#include "MenuTheme.hh" #include "MenuTheme.hh"
#include "TextButton.hh" #include "FbTk/TextButton.hh"
#include "EventManager.hh" #include "EventManager.hh"
#include "FbAtoms.hh" #include "FbAtoms.hh"
#include "RootTheme.hh" #include "RootTheme.hh"
@ -371,7 +371,7 @@ void FluxboxWindow::init() {
frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor()); frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor());
frame().resize(m_client->width(), m_client->height()); frame().resize(m_client->width(), m_client->height());
TextButton *btn = new TextButton(frame().label(), FbTk::TextButton *btn = new FbTk::TextButton(frame().label(),
frame().theme().font(), frame().theme().font(),
m_client->title()); m_client->title());
btn->setJustify(frame().theme().justify()); btn->setJustify(frame().theme().justify());
@ -611,7 +611,7 @@ void FluxboxWindow::attachClient(WinClient &client) {
(*client_it)->m_win = this; (*client_it)->m_win = this;
// create a labelbutton for this client and // create a labelbutton for this client and
// associate it with the pointer // associate it with the pointer
TextButton *btn = new TextButton(frame().label(), FbTk::TextButton *btn = new FbTk::TextButton(frame().label(),
frame().theme().font(), frame().theme().font(),
(*client_it)->title()); (*client_it)->title());
btn->setJustify(frame().theme().justify()); btn->setJustify(frame().theme().justify());
@ -642,7 +642,7 @@ void FluxboxWindow::attachClient(WinClient &client) {
} else { // client.fbwindow() == 0 } else { // client.fbwindow() == 0
// create a labelbutton for this client and associate it with the pointer // create a labelbutton for this client and associate it with the pointer
TextButton *btn = new TextButton(frame().label(), FbTk::TextButton *btn = new FbTk::TextButton(frame().label(),
frame().theme().font(), frame().theme().font(),
client.title()); client.title());
m_labelbuttons[&client] = btn; m_labelbuttons[&client] = btn;
@ -774,7 +774,7 @@ bool FluxboxWindow::removeClient(WinClient &client) {
FbTk::EventManager &evm = *FbTk::EventManager::instance(); FbTk::EventManager &evm = *FbTk::EventManager::instance();
evm.remove(client.window()); evm.remove(client.window());
TextButton *label_btn = m_labelbuttons[&client]; FbTk::TextButton *label_btn = m_labelbuttons[&client];
if (label_btn != 0) { if (label_btn != 0) {
frame().removeLabelButton(*label_btn); frame().removeLabelButton(*label_btn);
evm.remove(label_btn->window()); evm.remove(label_btn->window());

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.hh,v 1.91 2003/08/11 16:57:11 fluxgen Exp $ // $Id: Window.hh,v 1.92 2003/08/19 16:13:25 fluxgen Exp $
#ifndef WINDOW_HH #ifndef WINDOW_HH
#define WINDOW_HH #define WINDOW_HH
@ -44,10 +44,10 @@
class WinClient; class WinClient;
class FbWinFrameTheme; class FbWinFrameTheme;
class BScreen; class BScreen;
class TextButton;
class FbWinFrame; class FbWinFrame;
namespace FbTk { namespace FbTk {
class TextButton;
class MenuTheme; class MenuTheme;
class ImageControl; class ImageControl;
class XLayer; class XLayer;
@ -428,7 +428,7 @@ private:
ClientList m_clientlist; ClientList m_clientlist;
WinClient *m_client; WinClient *m_client;
typedef std::map<WinClient *, TextButton *> Client2ButtonMap; typedef std::map<WinClient *, FbTk::TextButton *> Client2ButtonMap;
Client2ButtonMap m_labelbuttons; Client2ButtonMap m_labelbuttons;
// just temporary solution // just temporary solution

View file

@ -20,14 +20,14 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: WorkspaceNameTool.hh,v 1.2 2003/08/13 10:19:57 fluxgen Exp $ // $Id: WorkspaceNameTool.hh,v 1.3 2003/08/19 16:15:32 fluxgen Exp $
#ifndef WORKSPACENAMETOOL_HH #ifndef WORKSPACENAMETOOL_HH
#define WORKSPACENAMETOOL_HH #define WORKSPACENAMETOOL_HH
#include "ToolbarItem.hh" #include "ToolbarItem.hh"
#include "TextButton.hh"
#include "FbTk/TextButton.hh"
#include "FbTk/Observer.hh" #include "FbTk/Observer.hh"
class BScreen; class BScreen;
@ -53,7 +53,7 @@ public:
private: private:
void renderTheme(); void renderTheme();
TextButton m_button; FbTk::TextButton m_button;
const ToolTheme &m_theme; const ToolTheme &m_theme;
BScreen &m_screen; BScreen &m_screen;
Pixmap m_pixmap; Pixmap m_pixmap;