Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/otk/otk_test.cc

Go to the documentation of this file.
00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
00002 
00003 #ifdef HAVE_CONFIG_H
00004 # include "../config.h"
00005 #endif
00006 
00007 #include "application.hh"
00008 #include "focuswidget.hh"
00009 #include "appwidget.hh"
00010 #include "button.hh"
00011 
00012 int main(int argc, char **argv) {
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 }

Generated on Tue Feb 4 22:58:56 2003 for Openbox by doxygen1.3-rc2