Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3161 in orxonox.OLD for orxonox/trunk/gui/orxonox_gui_gtk.cc


Ignore:
Timestamp:
Dec 13, 2004, 2:10:38 AM (21 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: OptionLabel now has a member cValue for saving its state beside its name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/gui/orxonox_gui_gtk.cc

    r3160 r3161  
    188188{
    189189  down = NULL;
    190   this->setGroupName ("");
     190  groupName = NULL;
    191191
    192192
     
    201201void Packer::setGroupName (char* name)
    202202{
    203   groupName = name;
     203  if (groupName)
     204    delete groupName;
     205  groupName = new char [strlen(name)+1];
     206  strcpy(groupName, name);
    204207}
    205208
     
    398401{
    399402  if (exec->shouldsave())
    400     exec->writeToFile (orxonoxGUI);
     403    exec->writeToFile (Window::mainWindow);
    401404
    402405  gtk_main_quit();
     
    902905}
    903906
    904 OptionLabel::OptionLabel(char* text)
     907OptionLabel::OptionLabel(char* label, char* value)
    905908{
    906909  init();
    907   setTitle(text);
     910  setTitle(label);
     911  setValue(value);
    908912}
    909913
    910914void OptionLabel::init(void)
    911915{
    912   isOption = 4;
    913 
    914916  static_cast<Option*>(this)->init();
     917  isOption = 5;
     918  cValue = NULL;
    915919
    916920  widget = gtk_label_new ("");
    917921}
     922void OptionLabel::setValue(char* newValue)
     923{
     924  if (cValue)
     925    delete cValue;
     926  cValue = new char [strlen(newValue)+1];
     927  strcpy(cValue, newValue);
     928  gtk_label_set_text (GTK_LABEL (widget), cValue);
     929}
    918930
    919931void OptionLabel::setTitle(char* title)
    920932{
     933  if (label)
     934    delete label;
     935  label = new char [strlen(title)+1];
     936  strcpy(label, title);
    921937  gtk_label_set_text (GTK_LABEL (widget), title);
    922938}
Note: See TracChangeset for help on using the changeset viewer.