added theme listener
This commit is contained in:
parent
fead9f1578
commit
96c49e2d0d
2 changed files with 22 additions and 6 deletions
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: FbWinFrame.cc,v 1.5 2003/01/12 20:31:54 fluxgen Exp $
|
||||
// $Id: FbWinFrame.cc,v 1.6 2003/02/15 01:54:54 fluxgen Exp $
|
||||
|
||||
#include "FbWinFrame.hh"
|
||||
#include "ImageControl.hh"
|
||||
|
@ -63,7 +63,9 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, int
|
|||
m_bevel(1),
|
||||
m_use_titlebar(true),
|
||||
m_use_handle(true),
|
||||
m_button_pm(0) {
|
||||
m_button_pm(0),
|
||||
m_themelistener(*this) {
|
||||
theme.addListener(m_themelistener);
|
||||
init();
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: FbWinFrame.hh,v 1.3 2003/01/09 22:00:34 fluxgen Exp $
|
||||
// $Id: FbWinFrame.hh,v 1.4 2003/02/15 01:54:18 fluxgen Exp $
|
||||
|
||||
#ifndef FBWINFRAME_HH
|
||||
#define FBWINFRAME_HH
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include "FbWinFrameTheme.hh"
|
||||
#include "RefCount.hh"
|
||||
#include "Command.hh"
|
||||
#include "Observer.hh"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
@ -46,11 +47,13 @@ class FbWinFrame:public FbTk::EventHandler {
|
|||
public:
|
||||
|
||||
/// create a top level window
|
||||
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, int screen_num, int x, int y,
|
||||
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||
int screen_num, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
/// create a frame window inside another FbWindow, NOT IMPLEMENTED!
|
||||
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, const FbTk::FbWindow &parent,
|
||||
FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl,
|
||||
const FbTk::FbWindow &parent,
|
||||
int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
|
@ -236,7 +239,18 @@ private:
|
|||
FbTk::RefCount<FbTk::Command> click_pressed; ///< what to do when we press mouse button
|
||||
FbTk::RefCount<FbTk::Command> double_click; ///< what to do when we double click
|
||||
};
|
||||
MouseButtonAction m_commands[5]; ///< hardcoded to five ...TODO, change this
|
||||
MouseButtonAction m_commands[5]; ///< hardcoded to five ... //!! TODO, change this
|
||||
|
||||
class ThemeListener: public FbTk::Observer {
|
||||
public:
|
||||
ThemeListener(FbWinFrame &frame):m_frame(frame) { }
|
||||
void update(FbTk::Subject *subj) {
|
||||
m_frame.reconfigure();
|
||||
}
|
||||
private:
|
||||
FbWinFrame &m_frame;
|
||||
};
|
||||
ThemeListener m_themelistener;
|
||||
};
|
||||
|
||||
#endif // FBWINFRAME_HH
|
||||
|
|
Loading…
Reference in a new issue