cwidget  0.5.18
frame.h
1 // frame.h -*-c++-*-
2 //
3 // A container that draws a frame around the widget it contains.
4 // (needs a lot more work to gracefully handle layout issues :) )
5 
6 #ifndef FRAME_H
7 #define FRAME_H
8 
9 #include "bin.h"
10 
11 namespace cwidget
12 {
13  namespace widgets
14  {
15  class frame : public bin
16  {
17  void layout_me();
18 
19  protected:
20  frame(const widget_ref &w);
21 
22  public:
23  static util::ref_ptr<frame> create(const widget_ref &w)
24  {
25  util::ref_ptr<frame> rval(new frame(w));
26  rval->decref();
27  return rval;
28  }
29 
33  int width_request();
34 
41  int height_request(int width);
42 
43  virtual void paint(const style &st);
44  };
45 
47  }
48 }
49 
50 #endif
cwidget::util::ref_ptr< widget >
cwidget::widgets::frame::width_request
int width_request()
Definition: frame.cc:21
cwidget::widgets::widget::alloc_size
void alloc_size(int x, int y, int w, int h)
Set the size and location in the parent of this widget.
Definition: widget.cc:100
cwidget::widgets::widget::width_request
virtual int width_request()=0
cwidget::style
A "style" is a setting to be applied to a display element (widget, text, etc).
Definition: style.h:51
cwidget::widgets::bin
Definition: bin.h:16
cwidget::widgets::frame::height_request
int height_request(int width)
Calculate the desired height of the frame.
Definition: frame.cc:33
colors.h
Routines to support independently changing foreground and background colors.
cwidget::widgets::widget::height_request
virtual int height_request(int width)=0
Calculate the desired height of the widget, given its width.
cwidget
The namespace containing everything defined by cwidget.
Definition: columnify.cc:27
cwidget::widgets::frame
Definition: frame.h:15
cwidget::widgets::frame::paint
virtual void paint(const style &st)
Display this widget.
Definition: frame.cc:65
cwidget::widgets::widget::display
void display(const style &st)
Display this widget in the given style environment.
Definition: widget.cc:198