/[projectaxis]/projectaxis/projectAxis/src/visual/panel/pgpanel_misnconf.cpp
ViewVC logotype

Diff of /projectaxis/projectAxis/src/visual/panel/pgpanel_misnconf.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by leiavoia, Wed Aug 20 18:27:14 2003 UTC revision 1.2 by leiavoia, Sun Sep 14 01:05:00 2003 UTC
# Line 47  void PG_Panel_MisnConf::Refresh(Pod* p, Line 47  void PG_Panel_MisnConf::Refresh(Pod* p,
47          if (m != NULL) {          if (m != NULL) {
48                  // Houston, we have a mission...                  // Houston, we have a mission...
49    
                 char b[4]; // char buffer for converting int to char  
   
50                  // set mission label (common to all mission setups)                  // set mission label (common to all mission setups)
51                  misn_name_out = new PG_Label(this, PG_Rect(0, 0, 200, LABEL_WIDTH), Mission::TranslateMission(m->GetType()).c_str());                  misn_name_out = new PG_Label(this, PG_Rect(0, 0, 200, LABEL_WIDTH), Mission::TranslateMission(m->GetType()).c_str());
52                  misn_name_out->LoadThemeStyle("Label", "MedLabel");                  misn_name_out->LoadThemeStyle("Label", "MedLabel");
# Line 57  void PG_Panel_MisnConf::Refresh(Pod* p, Line 55  void PG_Panel_MisnConf::Refresh(Pod* p,
55                  switch(m->GetType()) {                  switch(m->GetType()) {
56                          case MISSION_PATROL: {                          case MISSION_PATROL: {
57                                  // base coords                                  // base coords
58                                  char coordstr[16] = "Base:  ";                                  char coordstr[20] = "Base:  ";
59                                  strcat( coordstr,"x");                                  strcat( coordstr,"x");
60                                  strcat( coordstr, gcvt(pod->Misn(slot)->GetLocX(), 3, b) );                                  strcat( coordstr, rm->IntToChar( m->GetLocX() ).c_str() );
61                                  strcat( coordstr,", y");                                  strcat( coordstr,", y");
62                                  strcat( coordstr, gcvt(pod->Misn(slot)->GetLocY(), 3, b) );                                  strcat( coordstr, rm->IntToChar( m->GetLocY() ).c_str() );
63                                  target_tile_out = new PG_Label(this, PG_Rect(0, (LABEL_WIDTH+LABEL_SPACE)*1, COL2-COL1+30, LABEL_WIDTH), coordstr);                                  target_tile_out = new PG_Label(this, PG_Rect(0, (LABEL_WIDTH+LABEL_SPACE)*1, COL2-COL1+30, LABEL_WIDTH), coordstr);
64                                  target_tile_out->Show();                                  target_tile_out->Show();
65    
# Line 70  void PG_Panel_MisnConf::Refresh(Pod* p, Line 68  void PG_Panel_MisnConf::Refresh(Pod* p,
68                                  set_target->Show();                                  set_target->Show();
69    
70                                  // radius                                  // radius
71                                    int r = m->GetRad();
72                                  radius_lab = new PG_Label(this, PG_Rect(COL1, (LABEL_WIDTH+LABEL_SPACE)*2, COL2-COL1, LABEL_WIDTH), "Patrol Radius: ");                                  radius_lab = new PG_Label(this, PG_Rect(COL1, (LABEL_WIDTH+LABEL_SPACE)*2, COL2-COL1, LABEL_WIDTH), "Patrol Radius: ");
73                                  radius_lab->Show();                                  radius_lab->Show();
74                                  radius = new PG_ScrollBar(this, 570, PG_Rect(COL2, (LABEL_WIDTH+LABEL_SPACE)*2, COL3-COL2, LABEL_WIDTH), PG_SB_HORIZONTAL);                                  radius = new PG_ScrollBar(this, 570, PG_Rect(COL2, (LABEL_WIDTH+LABEL_SPACE)*2, COL3-COL2, LABEL_WIDTH), PG_SB_HORIZONTAL);
75                                  radius->SetRange(1, 15);                                  radius->SetRange(1, 15);
76                                  radius->SetPosition(m->GetRad());                                  radius->SetPosition(r);
77                                  radius->Show();                                  radius->Show();
78                                  radius_out = new PG_Label(this, PG_Rect(COL3+LABEL_SPACE, (LABEL_WIDTH+LABEL_SPACE)*2, COL4-COL3, LABEL_WIDTH), gcvt(m->GetRad(), 3, b));                                  radius_out = new PG_Label(this, PG_Rect(COL3+LABEL_SPACE, (LABEL_WIDTH+LABEL_SPACE)*2, COL4-COL3, LABEL_WIDTH), "");
79                                    radius_out->SetText(rm->IntToChar(r).c_str());
80                                  radius_out->LoadThemeStyle("Label", "MedLabel");                                  radius_out->LoadThemeStyle("Label", "MedLabel");
81                                  radius_out->SetAlignment(1);                                  radius_out->SetAlignment(1);
82                                  radius_out->Show();                                  radius_out->Show();
# Line 102  void PG_Panel_MisnConf::Refresh(Pod* p, Line 102  void PG_Panel_MisnConf::Refresh(Pod* p,
102                                  // base coords                                  // base coords
103                                  char coordstr[16] = "Location:  ";                                  char coordstr[16] = "Location:  ";
104                                  strcat( coordstr,"x");                                  strcat( coordstr,"x");
105                                  strcat( coordstr, gcvt(pod->Misn(slot)->GetLocX(), 3, b) );                                  strcat( coordstr, rm->IntToChar( m->GetLocX() ).c_str() );
106                                  strcat( coordstr,", y");                                  strcat( coordstr,", y");
107                                  strcat( coordstr, gcvt(pod->Misn(slot)->GetLocY(), 3, b) );                                  strcat( coordstr, rm->IntToChar( m->GetLocY() ).c_str() );
108                                  target_tile_out = new PG_Label(this, PG_Rect(0, (LABEL_WIDTH+LABEL_SPACE)*1, COL2-COL1+30, LABEL_WIDTH), coordstr);                                  target_tile_out = new PG_Label(this, PG_Rect(0, (LABEL_WIDTH+LABEL_SPACE)*1, COL2-COL1+30, LABEL_WIDTH), coordstr);
109                                  target_tile_out->Show();                                  target_tile_out->Show();
110    
# Line 131  void PG_Panel_MisnConf::Refresh(Pod* p, Line 131  void PG_Panel_MisnConf::Refresh(Pod* p,
131                          timeout->SetPosition(  (m->GetTimeout() >= UI_MAX_TIMEOUT) ? UI_MAX_TIMEOUT : m->GetTimeout() );                          timeout->SetPosition(  (m->GetTimeout() >= UI_MAX_TIMEOUT) ? UI_MAX_TIMEOUT : m->GetTimeout() );
132                          timeout->Show();                          timeout->Show();
133    
134                          timeout_out = new PG_Label(this, PG_Rect(COL3+LABEL_SPACE, (LABEL_WIDTH+LABEL_SPACE)*4, COL4-COL3, LABEL_WIDTH), (m->GetTimeout() >= UI_MAX_TIMEOUT) ? "--" : gcvt(m->GetTimeout(), 3, b));                          timeout_out = new PG_Label(this, PG_Rect(COL3+LABEL_SPACE, (LABEL_WIDTH+LABEL_SPACE)*4, COL4-COL3, LABEL_WIDTH), (m->GetTimeout() >= UI_MAX_TIMEOUT) ? "--" : (rm->IntToChar( m->GetTimeout()).c_str()));
135                          timeout_out->LoadThemeStyle("Label", "MedLabel");                          timeout_out->LoadThemeStyle("Label", "MedLabel");
136                          timeout_out->SetAlignment(0);                          timeout_out->SetAlignment(0);
137                          timeout_out->Show();                          timeout_out->Show();
# Line 174  PARAGUI_CALLBACK(PG_Panel_MisnConf::chan Line 174  PARAGUI_CALLBACK(PG_Panel_MisnConf::chan
174          }          }
175    
176  PARAGUI_CALLBACK(PG_Panel_MisnConf::slide_radius) {  PARAGUI_CALLBACK(PG_Panel_MisnConf::slide_radius) {
177          char b[4];          radius_out->SetText(  rm->IntToChar( radius->GetPosition() ).c_str()  );
         radius_out->SetText(  gcvt(radius->GetPosition(), 3, b)  );  
178          pod->Misn(slot)->SetRad(radius->GetPosition());          pod->Misn(slot)->SetRad(radius->GetPosition());
179          return true;          return true;
180          }          }
181    
182  PARAGUI_CALLBACK(PG_Panel_MisnConf::slide_timeout) {  PARAGUI_CALLBACK(PG_Panel_MisnConf::slide_timeout) {
183          char b[4];          timeout_out->SetText(  (timeout->GetPosition()==26) ? "--" : rm->IntToChar( timeout->GetPosition() ).c_str()  );
184          timeout_out->SetText(  (timeout->GetPosition()==26) ? "--" : gcvt(timeout->GetPosition(), 3, b)  );          pod->Misn(slot)->SetTimeout(  (timeout->GetPosition()==26) ? /*nothing*/-1 : timeout->GetPosition()  );
         pod->Misn(slot)->SetTimeout(  (timeout->GetPosition()==26) ? /*nothing*/ : timeout->GetPosition()  );  
185          return true;          return true;
186          }          }
187    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26