#include "application.hh"
#include "focuswidget.hh"
#include "appwidget.hh"
#include "button.hh"
Include dependency graph for otk_test.cc:

Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
|
||||||||||||
|
Definition at line 12 of file otk_test.cc. References otk::Application::getStyle(), otk::Widget::resize(), otk::Application::run(), otk::Widget::setBevelWidth(), otk::Widget::setDirection(), otk::Widget::setHeight(), otk::Widget::setStretchableHorz(), otk::Widget::setStretchableVert(), otk::FocusLabel::setText(), otk::FocusWidget::setTexture(), otk::Widget::setTexture(), otk::FocusWidget::setUnfocusTexture(), otk::Widget::setWidth(), and otk::AppWidget::show().
00012 {
00013 otk::Application app(argc, argv);
00014
00015 otk::AppWidget foo(&app);
00016
00017 foo.resize(600, 500);
00018 foo.setTexture(app.getStyle()->titlebarFocusBackground());
00019 // foo.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
00020
00021 foo.setBevelWidth(2);
00022 foo.setDirection(otk::Widget::Horizontal);
00023
00024 otk::FocusWidget left(&foo);
00025 otk::FocusWidget right(&foo);
00026
00027 left.setDirection(otk::Widget::Horizontal);
00028 left.setStretchableVert(true);
00029 left.setStretchableHorz(true);
00030 left.setTexture(app.getStyle()->titlebarFocusBackground());
00031 left.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
00032
00033 right.setDirection(otk::Widget::Vertical);
00034 right.setBevelWidth(10);
00035 right.setStretchableVert(true);
00036 right.setWidth(300);
00037 right.setTexture(app.getStyle()->titlebarFocusBackground());
00038 right.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
00039 otk::Button iconb(&left);
00040 iconb.resize(40,20);
00041
00042 /* otk::FocusWidget label(&left);
00043 otk::Button maxb(&left);
00044 otk::Button closeb(&left);
00045
00046 // fixed size
00047 iconb.setText("foo");
00048 iconb.press(Button1);
00049
00050 // fix width to 60 and let the height be calculated by its parent
00051 //label.setHeight(20);
00052 label.setStretchableVert(true);
00053 label.setStretchableHorz(true);
00054 label.setTexture(app.getStyle()->labelFocusBackground());
00055 label.setUnfocusTexture(app.getStyle()->labelUnfocusBackground());
00056
00057 // fixed size
00058 maxb.setText("bar");
00059
00060 // fixed size
00061 closeb.setText("fuubar");
00062 */
00063 otk::FocusWidget rblef(&right);
00064 otk::Button rbutt1(&right);
00065 otk::Button rbutt2(&right);
00066
00067 rblef.setStretchableHorz(true);
00068 rblef.setHeight(50);
00069 rblef.setTexture(app.getStyle()->handleFocusBackground());
00070 rblef.setUnfocusTexture(app.getStyle()->handleUnfocusBackground());
00071
00072 rbutt1.setText("this is fucking tight");
00073 rbutt2.setText("heh, WOOP");
00074
00075 // will recursively unfocus its children
00076 //foo.unfocus();
00077
00078 foo.show();
00079
00080 app.run();
00081
00082 return 0;
00083 }
|
1.3-rc2