summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/src/vmchooser/SWindow.cxx
blob: d37fb01e7ae4758befbcc8765d5a36433e680db2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

#include "inc/SWindow.h"
#include <iostream>

using namespace fltk;
using namespace std;

void SWindow::cb_return()
{
  // TODO start something
  cout << " Pressed Button!" << endl;
}


void SWindow::cb_select()
{
  if (sel.item_is_parent() )
    {
      sel.set_item_opened(true);
    }
}


void SWindow::cb_info()
{
}

void SWindow::set_lin_entries(DataEntry** ent)
{
  this->lin_ent = ent;
  lin_entgroup = (ItemGroup*) sel.add_group("------- LINUX DESKTOP ------");
  for (int i=0; ent[i] != NULL; i++)
    {
      sel.add_leaf(ent[i]->short_description.c_str() , lin_entgroup, (void*)ent[i] );
    }

  lin_entgroup->end();
}

void SWindow::set_entries(DataEntry** ent)
{
  this->ent = ent;

  entgroup =  (ItemGroup*)sel.add_group("-------- VMWARE ----------");
  for (int i=0; ent[i] != NULL; i++)
    {
      sel.add_leaf(ent[i]->short_description.c_str(), lin_entgroup, (void*)ent[i] );
    }
  for (int c=0; c < 5; c++) 
    {
      sel.add_leaf("Blubber 1", entgroup);
    }
  entgroup->end();
}


void SWindow::free_entries()
{
  for (int i=0; ent[i] != NULL; i++)
    {
      free(ent[i]);
    }
  free(ent);
}