summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Wissler2008-07-18 19:07:00 +0200
committerBastian Wissler2008-07-18 19:07:00 +0200
commit47669193e5ba54010dd0f71dcd29ad869925bf19 (patch)
tree827cbe972bdfb775f7374cae658c3ef56a01488c
parentvmchooser: (diff)
downloadvmchooser-47669193e5ba54010dd0f71dcd29ad869925bf19.tar.gz
vmchooser-47669193e5ba54010dd0f71dcd29ad869925bf19.tar.xz
vmchooser-47669193e5ba54010dd0f71dcd29ad869925bf19.zip
vmchooser changes:
+ 10 px bottom space now + international buttons - start, exit as label + removed scrollbar - no more space for + reserved in selectbrowser + fixed bug: does not crash any more with click on selectbrowser without selecting anything + fixed resize feature: error parsing command line now fixed TODO: gdm and vmchooser bug?!? git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/trunk/os-plugins/plugins/vmchooser@1935 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--vmchooser/SWindow.cxx61
-rw-r--r--vmchooser/inc/SWindow.h4
-rw-r--r--vmchooser/main.cxx6
3 files changed, 22 insertions, 49 deletions
diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx
index 6cfb12d..8179146 100644
--- a/vmchooser/SWindow.cxx
+++ b/vmchooser/SWindow.cxx
@@ -18,54 +18,21 @@ using namespace std;
/********************************************************
* default constructur for the main window
* ----------------------------------------------------
- * if you want to set the size, call second ctor
- ********************************************************/
-// SWindow::SWindow(char* p):
-// fltk::Window(fltk::USEDEFAULT,fltk::USEDEFAULT,500,550,p, true),
-// go(160, 520, 320, 20, "Ausführen"),
-// exit_btn(10, 520, 140, 20, "Abbrechen"),
-// sel(10,10, 480, 500)
-// {
-// border(false);
-// go.callback(cb_return,this);
-// sel.callback(cb_select, this);
-// exit_btn.callback(cb_exit, this);
-//
-// // Array for width of Select-Columns
-// // (one Column for a lock-symbol)
-// int widths[] = { 450, 20 };
-// sel.column_widths(widths);
-// resizable(sel);
-// end();
-// //sel.style(fltk::Browser::default_style);
-// sel.indented(1);
-// };
-
-
-/********************************************************
- * second constructur for the main window
- * ----------------------------------------------------
* if you want to use default sizes, call first ctor
********************************************************/
SWindow::SWindow(int w, int h, char* p):
fltk::Window(fltk::USEDEFAULT,fltk::USEDEFAULT,w,h,p, true),
- go(w/3 + 10, h-30, (2*w)/3 - 10 , 30, "Ausführen"),
- exit_btn(10, h-30, w/3 -10, 30, "Abbrechen"),
- sel(10,10, w-20, h-40)
+ go(w/3 + 10, h-40, (2*w)/3 - 20 , 30, "START"),
+ exit_btn(10, h-40, w/3 -10, 30, "EXIT"),
+ sel(10,10, w-20, h-50)
{
+ width = w;
+ height = h;
+
border(false);
go.callback(cb_return,this);
sel.callback(cb_select, this);
exit_btn.callback(cb_exit, this);
-
- // Array for width of Select-Columns
- // (one Column for a lock-symbol)
-
-// int v = w-20;
-// int widths[] = { (7*v)/8, v/8 };
-// sel.column_widths(widths);
-// resizable(sel);
- end();
Style* btn_style = new Style(*fltk::ReturnButton::default_style);
Style* sel_style = new Style(*fltk::Browser::default_style);
@@ -87,6 +54,11 @@ SWindow::SWindow(int w, int h, char* p):
exit_btn.style(btn_style);
go.style(btn_style);
sel.style(sel_style);
+
+ const int widths[] = { 2*((w-30)/3), (w-30)/3, -1, 0 };
+ sel.column_widths(widths);
+
+ end();
};
@@ -116,7 +88,7 @@ void SWindow::cb_select()
{
sel.set_item_opened(true);
}
- if( curr == sel.item() ) {
+ if( curr == sel.item() && curr != NULL ) {
//Doubleclick
cout << ((DataEntry*)curr->user_data())->short_description << endl;
if(curr->user_data()) {
@@ -147,12 +119,10 @@ void SWindow::set_lin_entries(DataEntry** ent, char* slxgroup)
xpmImage* xpm = new xpmImage(get_symbol(ent[i]));
((Widget*) w)->image(xpm);
- xpm->setsize(100,100);
w->tooltip(ent[i]->description.c_str());
w->callback(&runImage, (void*)ent[i]);
}
}
-
lin_entgroup->end();
}
@@ -175,12 +145,10 @@ void SWindow::set_entries(DataEntry** ent, char* slxgroup)
((Widget*) w)->image(xpm);
w->tooltip(ent[i]->description.c_str());
w->callback(&runImage, (void*)ent[i]);
-
- xpm->setsize(100,100);
}
}
-
entgroup->end();
+
}
/**************************************************************
@@ -209,7 +177,8 @@ void SWindow::unfold_entries() {
if(sel.item_is_parent() ) {
sel.set_item_opened(true);
}
- sel.deselect();
+ sel.next_visible();
+ sel.select_only_this();
}
diff --git a/vmchooser/inc/SWindow.h b/vmchooser/inc/SWindow.h
index f4121a7..4a8a9f4 100644
--- a/vmchooser/inc/SWindow.h
+++ b/vmchooser/inc/SWindow.h
@@ -44,6 +44,10 @@ private:
DataEntry** lin_ent;
+ int width;
+ int height;
+
+
/**
diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx
index 8fff48b..97a1502 100644
--- a/vmchooser/main.cxx
+++ b/vmchooser/main.cxx
@@ -111,7 +111,7 @@ int main(int argc, char** argv) {
return 1;
}
height = atoi(size.substr(i+1).c_str());
- width = atoi(size.substr(0, size.size()-i-1).c_str());
+ width = atoi(size.substr(0, size.size()-i).c_str());
}
delete opt;
@@ -129,10 +129,10 @@ int main(int argc, char** argv) {
SWindow& win = *SWindow::getInstance(width, height);
- if(lsessions != NULL) {
+ if(lsessions[0] != NULL) {
win.set_lin_entries(lsessions, slxgroup);
}
- if (sessions != NULL) {
+ if (sessions[0] != NULL) {
win.set_entries(sessions, slxgroup);
}