NCBI C++ ToolKit
style_dialog.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: style_dialog.cpp 98993 2023-02-01 14:57:24Z dzhang $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Authors: Paul Thiessen
27 *
28 * File Description:
29 * dialog for setting styles
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
35 #include <corelib/ncbistd.hpp>
36 
38 
39 #include "style_dialog.hpp"
40 #include "style_manager.hpp"
41 #include "cn3d_tools.hpp"
42 #include "structure_set.hpp"
43 #include "messenger.hpp"
45 
46 #include <wx/colordlg.h>
47 
48 
49 ////////////////////////////////////////////////////////////////////////////////////////////////
50 // The following is taken unmodified from wxDesigner's C++ header from render_settings.wdr
51 ////////////////////////////////////////////////////////////////////////////////////////////////
52 
53 #include <wx/image.h>
54 #include <wx/statline.h>
55 #include <wx/spinbutt.h>
56 #include <wx/spinctrl.h>
57 #include <wx/splitter.h>
58 #include <wx/listctrl.h>
59 #include <wx/treectrl.h>
60 #include <wx/notebook.h>
61 
62 // Declare window functions
63 
64 #define ID_NOTEBOOK 10000
65 #define ID_DONE 10001
66 #define ID_CANCEL 10002
67 #define ID_TEXT 10003
68 #define ID_ALWAYS_APPLY 10004
69 #define ID_APPLY 10005
70 wxSizer *LayoutNotebook( wxPanel *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
71 
72 #define ID_PBB_SHOW 10006
73 #define ID_PBB_RENDER 10007
74 #define ID_PBB_COLOR 10008
75 #define ID_PBB_USER 10009
76 #define ID_PSIDE_SHOW 10010
77 #define ID_PSIDE_RENDER 10011
78 #define ID_PSIDE_COLOR 10012
79 #define ID_PSIDE_USER 10013
80 #define ID_NUC_SHOW 10014
81 #define ID_NUC_RENDER 10015
82 #define ID_NUC_COLOR 10016
83 #define ID_NUC_USER 10017
84 #define ID_NSIDE_SHOW 10018
85 #define ID_NSIDE_RENDER 10019
86 #define ID_NSIDE_COLOR 10020
87 #define ID_NSIDE_USER 10021
88 #define ID_HET_SHOW 10022
89 #define ID_HET_RENDER 10023
90 #define ID_HET_COLOR 10024
91 #define ID_HET_USER 10025
92 #define ID_SOLV_SHOW 10026
93 #define ID_SOLV_RENDER 10027
94 #define ID_SOLV_COLOR 10028
95 #define ID_SOLV_USER 10029
96 #define ID_CONN_SHOW 10030
97 #define ID_CONN_RENDER 10031
98 #define ID_CONN_COLOR 10032
99 #define ID_CONN_USER 10033
100 #define ID_HELX_SHOW 10034
101 #define ID_HELX_RENDER 10035
102 #define ID_HELX_COLOR 10036
103 #define ID_HELX_USER 10037
104 #define ID_STRN_SHOW 10038
105 #define ID_STRN_RENDER 10039
106 #define ID_STRN_COLOR 10040
107 #define ID_STRN_USER 10041
108 #define ID_VSS_SHOW 10042
109 #define ID_VSS_USER 10043
110 #define ID_HYD_SHOW 10044
111 #define ID_BG_USER 10045
112 wxSizer *LayoutSettingsPage( wxPanel *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
113 
114 #define ID_TEXTCTRL 10046
115 #define ID_SPINBUTTON 10047
116 wxSizer *LayoutDetailsPage( wxPanel *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
117 
118 #define ID_S_PROT 10048
119 #define ID_S_NUC 10049
120 #define ID_C_PROT_TYPE 10050
121 #define ID_C_NUC_TYPE 10051
122 #define ID_C_PROT_NUM 10052
123 #define ID_C_NUC_NUM 10053
124 #define ID_K_PROT_CONTRAST 10054
125 #define ID_K_NUC_CONTRAST 10055
126 #define ID_K_PROT_TERM 10056
127 #define ID_K_NUC_TERM 10057
128 #define ID_LINE 10058
129 #define ID_K_ION 10059
130 wxSizer *LayoutLabelsPage( wxPanel *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
131 
132 ////////////////////////////////////////////////////////////////////////////////////////////////
133 
135 
136 // a bit of a kludge - but necessary to be able to use most of the wxDesigner code as is
139 
140 
141 BEGIN_SCOPE(Cn3D)
142 
148 
149 BEGIN_EVENT_TABLE(StyleDialog, wxDialog)
150  EVT_CLOSE ( StyleDialog::OnCloseWindow)
151  EVT_CHOICE (-1, StyleDialog::OnChange)
153  EVT_SPINCTRL (-1, StyleDialog::OnSpin)
154  EVT_BUTTON (-1, StyleDialog::OnButton)
155  // generated when {Integer,FloatingPoint}SpinCtrl changes
158 
159 StyleDialog::StyleDialog(wxWindow* parent, StyleSettings *settingsToEdit, const StructureSet *set) :
160  wxDialog(parent, -1, "Style Options", wxPoint(400, 100), wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
161  editedSettings(settingsToEdit), originalSettings(*settingsToEdit),
162  structureSet(set), changedSinceApply(false), changedEver(false), initialized(false)
163 {
164  // setup maps for associating style types with strings
165  SetupStyleStrings();
166 
167  // construct the panel
168  wxPanel *panel = new wxPanel(this, -1);
169  wxSizer *topSizer = LayoutNotebook(panel, false);
170 
171  // hook in the stuff that the wxDesigner-based code (LayoutPage2()) created
172  fpSpaceFill = gfpSpaceFill;
173  fpBallRadius = gfpBallRadius;
174  fpStickRadius = gfpStickRadius;
175  fpTubeRadius = gfpTubeRadius;
176  fpTubeWormRadius = gfpTubeWormRadius;
177  fpHelixRadius = gfpHelixRadius;
178  fpStrandWidth = gfpStrandWidth;
179  fpStrandThickness = gfpStrandThickness;
180 
181  // set defaults
182  SetControls(*editedSettings);
183 
184  // call sizer stuff
185  topSizer->Fit(this);
186  topSizer->Fit(panel);
187  topSizer->SetSizeHints(this);
188 
189  initialized = true;
190 }
191 
193 {
194  delete fpSpaceFill;
195  delete fpBallRadius;
196  delete fpStickRadius;
197  delete fpTubeRadius;
198  delete fpTubeWormRadius;
199  delete fpHelixRadius;
200  delete fpStrandWidth;
201  delete fpStrandThickness;
202 }
203 
205 {
206  if (BackboneTypeStrings.Size() == 0) {
207 
212 
221 
236  ColorSchemeStrings.Associate(StyleSettings::eBlockZFit, "Normalized Block Fit");
242 
245 
249  }
250 }
251 
252 static bool ConvertColor(const wxColour& wxcol, Vector *vec)
253 {
254  vec->Set(((double) wxcol.Red())/255.0, ((double) wxcol.Green())/255.0, ((double) wxcol.Blue())/255.0);
255  return true;
256 }
257 
259  int showID, int renderID, int colorID, int userID)
260 {
261  wxChoice *choice;
262  wxButton *button;
263  return (
264  (choice = wxDynamicCast(FindWindow(showID), wxChoice)) != NULL &&
265  BackboneTypeStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(bbStyle->type)) &&
266  (choice = wxDynamicCast(FindWindow(renderID), wxChoice)) != NULL &&
267  DrawingStyleStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(bbStyle->style)) &&
268  (choice = wxDynamicCast(FindWindow(colorID), wxChoice)) != NULL &&
269  ColorSchemeStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(bbStyle->colorScheme)) &&
270  (button = wxDynamicCast(FindWindow(userID), wxButton)) != NULL &&
271  ConvertColor(button->GetBackgroundColour(), &(bbStyle->userColor))
272  );
273 }
274 
275 static bool GetChecked(wxCheckBox *checkbox, bool *isChecked)
276 {
277  if (!checkbox) return false;
278  *isChecked = checkbox->GetValue();
279  return true;
280 }
281 
283  int showID, int renderID, int colorID, int userID)
284 {
285  wxCheckBox *checkbox;
286  wxChoice *choice;
287  wxButton *button;
288  return (
289  (checkbox = wxDynamicCast(FindWindow(showID), wxCheckBox)) != NULL &&
290  GetChecked(checkbox, &(gStyle->isOn)) &&
291  (choice = wxDynamicCast(FindWindow(renderID), wxChoice)) != NULL &&
292  DrawingStyleStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(gStyle->style)) &&
293  (choice = wxDynamicCast(FindWindow(colorID), wxChoice)) != NULL &&
294  ColorSchemeStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(gStyle->colorScheme)) &&
295  (button = wxDynamicCast(FindWindow(userID), wxButton)) != NULL &&
296  ConvertColor(button->GetBackgroundColour(), &(gStyle->userColor))
297  );
298 }
299 
300 static bool GetInteger(wxSpinCtrl *spinctrl, int *value)
301 {
302  if (!spinctrl) return false;
303  *value = spinctrl->GetValue();
304  return true;
305 }
306 
308  int spacingID, int typeID, int numberingID, int terminiID, int whiteID)
309 {
310  wxSpinCtrl *spinctrl;
311  wxChoice *choice;
312  wxCheckBox *checkbox;
313  return (
314  (spinctrl = wxDynamicCast(FindWindow(spacingID), wxSpinCtrl)) != NULL &&
315  GetInteger(spinctrl, &(lStyle->spacing)) &&
316  (choice = wxDynamicCast(FindWindow(typeID), wxChoice)) != NULL &&
317  LabelTypeStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(lStyle->type)) &&
318  (choice = wxDynamicCast(FindWindow(numberingID), wxChoice)) != NULL &&
319  NumberTypeStrings.Get(WX_TO_STD(choice->GetStringSelection()), &(lStyle->numbering)) &&
320  (checkbox = wxDynamicCast(FindWindow(terminiID), wxCheckBox)) != NULL &&
321  GetChecked(checkbox, &(lStyle->terminiOn)) &&
322  (checkbox = wxDynamicCast(FindWindow(whiteID), wxCheckBox)) != NULL &&
323  GetChecked(checkbox, &(lStyle->white))
324  );
325 }
326 
328 {
329  wxCheckBox *checkbox;
330  wxButton *button;
331  bool okay = (
332  settings != NULL &&
333  GetBackboneStyle(&(settings->proteinBackbone),
335  GetGeneralStyle(&(settings->proteinSidechains),
341  GetGeneralStyle(&(settings->heterogens),
343  GetGeneralStyle(&(settings->solvents),
345  GetGeneralStyle(&(settings->connections),
347  GetGeneralStyle(&(settings->helixObjects),
349  GetGeneralStyle(&(settings->strandObjects),
351  (checkbox = wxDynamicCast(FindWindow(ID_VSS_SHOW), wxCheckBox)) != NULL &&
352  GetChecked(checkbox, &(settings->virtualDisulfidesOn)) &&
353  (button = wxDynamicCast(FindWindow(ID_VSS_USER), wxButton)) != NULL &&
354  ConvertColor(button->GetBackgroundColour(), &(settings->virtualDisulfideColor)) &&
355  (checkbox = wxDynamicCast(FindWindow(ID_HYD_SHOW), wxCheckBox)) != NULL &&
356  GetChecked(checkbox, &(settings->hydrogensOn)) &&
357  (button = wxDynamicCast(FindWindow(ID_BG_USER), wxButton)) != NULL &&
358  ConvertColor(button->GetBackgroundColour(), &(settings->backgroundColor)) &&
359  fpSpaceFill->GetDouble(&(settings->spaceFillProportion)) &&
360  fpBallRadius->GetDouble(&(settings->ballRadius)) &&
361  fpStickRadius->GetDouble(&(settings->stickRadius)) &&
362  fpTubeRadius->GetDouble(&(settings->tubeRadius)) &&
363  fpTubeWormRadius->GetDouble(&(settings->tubeWormRadius)) &&
364  fpHelixRadius->GetDouble(&(settings->helixRadius)) &&
365  fpStrandWidth->GetDouble(&(settings->strandWidth)) &&
366  fpStrandThickness->GetDouble(&(settings->strandThickness)) &&
367  GetLabelStyle(&(settings->proteinLabels),
369  GetLabelStyle(&(settings->nucleotideLabels),
371  (checkbox = wxDynamicCast(FindWindow(ID_K_ION), wxCheckBox)) != NULL &&
372  GetChecked(checkbox, &(settings->ionLabelsOn))
373  );
374  if (!okay) ERRORMSG("StyleDialog::GetValues() - control/parameter mismatch: invalid style?");
375  return okay;
376 }
377 
378 static bool SetChoiceToString(wxChoice *choice, const string& name)
379 {
380  int field = choice->FindString(name.c_str());
381  if (field < 0) return false;
382  choice->SetSelection(field);
383  return true;
384 }
385 
386 static bool SetButtonColor(wxButton *button, const Vector& color)
387 {
388  if (!button) return false;
389  wxColour wxcol(
390  static_cast<unsigned char>((color[0] + 0.000001) * 255),
391  static_cast<unsigned char>((color[1] + 0.000001) * 255),
392  static_cast<unsigned char>((color[2] + 0.000001) * 255)
393  );
394  // set both foreground and background colors, so that if e.g. on wxGTK themes are
395  // used (and thus backgrounds are not user-selectable), at least the text (foreground)
396  // color will indicate the user's color choice
397  button->SetForegroundColour(wxcol);
398  button->SetBackgroundColour(wxcol);
399  return true;
400 }
401 
403  int showID, int renderID, int colorID, int userID)
404 {
405  string name;
406  wxChoice *choice;
407  wxButton *button;
408  return (
409  BackboneTypeStrings.Get(bbStyle.type, &name) &&
410  (choice = wxDynamicCast(FindWindow(showID), wxChoice)) != NULL &&
411  SetChoiceToString(choice, name) &&
412  DrawingStyleStrings.Get(bbStyle.style, &name) &&
413  (choice = wxDynamicCast(FindWindow(renderID), wxChoice)) != NULL &&
414  SetChoiceToString(choice, name) &&
415  ColorSchemeStrings.Get(bbStyle.colorScheme, &name) &&
416  (choice = wxDynamicCast(FindWindow(colorID), wxChoice)) != NULL &&
417  SetChoiceToString(choice, name) &&
418  (button = wxDynamicCast(FindWindow(userID), wxButton)) != NULL &&
419  SetButtonColor(button, bbStyle.userColor)
420  );
421 }
422 
423 static bool SetChecked(wxCheckBox *checkbox, bool isChecked)
424 {
425  if (!checkbox) return false;
426  checkbox->SetValue(isChecked);
427  return true;
428 }
429 
431  int showID, int renderID, int colorID, int userID)
432 {
433  string name;
434  wxCheckBox *checkbox;
435  wxChoice *choice;
436  wxButton *button;
437  return (
438  (checkbox = wxDynamicCast(FindWindow(showID), wxCheckBox)) != NULL &&
439  SetChecked(checkbox, gStyle.isOn) &&
440  DrawingStyleStrings.Get(gStyle.style, &name) &&
441  (choice = wxDynamicCast(FindWindow(renderID), wxChoice)) != NULL &&
442  SetChoiceToString(choice, name) &&
443  ColorSchemeStrings.Get(gStyle.colorScheme, &name) &&
444  (choice = wxDynamicCast(FindWindow(colorID), wxChoice)) != NULL &&
445  SetChoiceToString(choice, name) &&
446  (button = wxDynamicCast(FindWindow(userID), wxButton)) != NULL &&
447  SetButtonColor(button, gStyle.userColor)
448  );
449 }
450 
451 static bool SetInteger(wxSpinCtrl *spinctrl, int value)
452 {
453  if (!spinctrl) return false;
454  spinctrl->SetValue(value);
455  return true;
456 }
457 
459  int spacingID, int typeID, int numberingID, int terminiID, int whiteID)
460 {
461  string name;
462  wxSpinCtrl *spinctrl;
463  wxCheckBox *checkbox;
464  wxChoice *choice;
465  return (
466  (spinctrl = wxDynamicCast(FindWindow(spacingID), wxSpinCtrl)) != NULL &&
467  SetInteger(spinctrl, lStyle.spacing) &&
468  LabelTypeStrings.Get(lStyle.type, &name) &&
469  (choice = wxDynamicCast(FindWindow(typeID), wxChoice)) != NULL &&
470  SetChoiceToString(choice, name) &&
471  NumberTypeStrings.Get(lStyle.numbering, &name) &&
472  (choice = wxDynamicCast(FindWindow(numberingID), wxChoice)) != NULL &&
473  SetChoiceToString(choice, name) &&
474  (checkbox = wxDynamicCast(FindWindow(terminiID), wxCheckBox)) != NULL &&
475  SetChecked(checkbox, lStyle.terminiOn) &&
476  (checkbox = wxDynamicCast(FindWindow(whiteID), wxCheckBox)) != NULL &&
477  SetChecked(checkbox, lStyle.white)
478  );
479 }
480 
482 {
483  wxCheckBox *checkbox;
484  wxButton *button;
485  bool okay = (
494  SetGeneralStyle(settings.heterogens,
496  SetGeneralStyle(settings.solvents,
498  SetGeneralStyle(settings.connections,
500  SetGeneralStyle(settings.helixObjects,
504  (checkbox = wxDynamicCast(FindWindow(ID_VSS_SHOW), wxCheckBox)) != NULL &&
505  SetChecked(checkbox, settings.virtualDisulfidesOn) &&
506  (button = wxDynamicCast(FindWindow(ID_VSS_USER), wxButton)) != NULL &&
507  SetButtonColor(button, settings.virtualDisulfideColor) &&
508  (checkbox = wxDynamicCast(FindWindow(ID_HYD_SHOW), wxCheckBox)) != NULL &&
509  SetChecked(checkbox, settings.hydrogensOn) &&
510  (button = wxDynamicCast(FindWindow(ID_BG_USER), wxButton)) != NULL &&
511  SetButtonColor(button, settings.backgroundColor) &&
512  fpSpaceFill->SetDouble(settings.spaceFillProportion) &&
513  fpBallRadius->SetDouble(settings.ballRadius) &&
514  fpStickRadius->SetDouble(settings.stickRadius) &&
515  fpTubeRadius->SetDouble(settings.tubeRadius) &&
516  fpTubeWormRadius->SetDouble(settings.tubeWormRadius) &&
517  fpHelixRadius->SetDouble(settings.helixRadius) &&
518  fpStrandWidth->SetDouble(settings.strandWidth) &&
519  fpStrandThickness->SetDouble(settings.strandThickness) &&
520  SetLabelStyle(settings.proteinLabels,
524  (checkbox = wxDynamicCast(FindWindow(ID_K_ION), wxCheckBox)) != NULL &&
525  SetChecked(checkbox, settings.ionLabelsOn)
526  );
527  if (!okay) ERRORMSG("StyleDialog::SetControls() - control/parameter mismatch: invalid style?");
528  return okay;
529 }
530 
531 // same as hitting done button
532 void StyleDialog::OnCloseWindow(wxCloseEvent& event)
533 {
535  if (GetValues(&dummy)) {
536  if (changedSinceApply) {
540 // structureSet->SetDataChanged(StructureSet::eStyleData);
541  }
542  } else
543  wxBell();
544  EndModal(wxOK);
545 }
546 
547 void StyleDialog::OnButton(wxCommandEvent& event)
548 {
549  switch (event.GetId()) {
550  case ID_DONE: {
552  if (GetValues(&dummy)) {
553  if (changedSinceApply) {
557  }
558 // if (changedEver)
559 // structureSet->SetDataChanged(StructureSet::eStyleData);
560  EndModal(wxOK);
561  } else
562  wxBell();
563  break;
564  }
565  case ID_APPLY: {
567  if (GetValues(&dummy)) {
571  changedSinceApply = false;
572 // structureSet->SetDataChanged(StructureSet::eStyleData);
573  } else
574  wxBell();
575  break;
576  }
577  case ID_CANCEL:
578  if (changedEver) {
582  }
583  EndModal(wxCANCEL);
584  break;
585  default:
586  if (!HandleColorButton(event.GetId()))
587  event.Skip();
588  }
589 }
590 
591 // return true if bID does actually correspond to a valid color button
593 {
594  // just a filter to make sure the button pushed is really a user color button
595  switch (bID) {
596  case ID_PBB_USER: case ID_PSIDE_USER: case ID_NUC_USER: case ID_NSIDE_USER:
597  case ID_HET_USER: case ID_SOLV_USER: case ID_CONN_USER: case ID_HELX_USER:
598  case ID_STRN_USER: case ID_VSS_USER: case ID_BG_USER:
599  break;
600  default:
601  return false;
602  }
603 
604  wxButton *button = wxDynamicCast(FindWindow(bID), wxButton);
605  if (!button) {
606  ERRORMSG("StyleDialog::HandleColorButton() - can't find button of given ID");
607  return false;
608  }
609 
610  wxColour userColor = wxGetColourFromUser(this, button->GetBackgroundColour());
611  if (userColor.Ok()) {
612  button->SetBackgroundColour(userColor);
613  wxCommandEvent fake;
614  OnChange(fake);
615  }
616  return true;
617 }
618 
619 void StyleDialog::OnChange(wxCommandEvent& event)
620 {
621  TRACEMSG("control changed");
622  StyleSettings tmpSettings;
623  if (!GetValues(&tmpSettings) ||
624  !structureSet->styleManager->CheckStyleSettings(&tmpSettings) ||
625  !SetControls(tmpSettings)) {
626  ERRORMSG("StyleDialog::OnChange() - error adjusting settings/controls");
627  return;
628  }
630  if ((wxDynamicCast(FindWindow(ID_ALWAYS_APPLY), wxCheckBox))->GetValue()) {
631  *editedSettings = tmpSettings;
634  changedSinceApply = false;
635  }
636 }
637 
638 void StyleDialog::OnSpin(wxSpinEvent& event)
639 {
640  if (!initialized) {
641  event.Skip();
642  return;
643  }
644  wxCommandEvent fake;
645  OnChange(fake);
646 }
647 
648 END_SCOPE(Cn3D)
649 
650 
651 //////////////////////////////////////////////////////////////////////////////////////////////////
652 // Three of four of these following functions are taken *without* modification
653 // from wxDesigner C++ code generated from render_settings.wdr. The function LayoutDetailsPage()
654 // is modified from wxDesigner output in order to use custom FloatingPointSpinCtrl's
655 //////////////////////////////////////////////////////////////////////////////////////////////////
656 
657 wxSizer *LayoutNotebook( wxPanel *parent, bool call_fit, bool set_sizer )
658 {
659  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
660 
661  wxNotebook *item2 = new wxNotebook( parent, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, 0 );
662 // wxNotebookSizer *item1 = new wxNotebookSizer( item2 );
663 
664  wxPanel *item3 = new wxPanel( item2, -1 );
665  LayoutSettingsPage( item3, FALSE );
666  item2->AddPage( item3, "Settings" );
667 
668  wxPanel *item4 = new wxPanel( item2, -1 );
669  LayoutLabelsPage( item4, FALSE );
670  item2->AddPage( item4, "Labels" );
671 
672  wxPanel *item5 = new wxPanel( item2, -1 );
673  LayoutDetailsPage( item5, FALSE );
674  item2->AddPage( item5, "Details" );
675 
676  item0->Add( item2, 0, wxALIGN_CENTRE|wxALL, 5 );
677 
678  wxBoxSizer *item6 = new wxBoxSizer( wxHORIZONTAL );
679 
680  wxButton *item7 = new wxButton( parent, ID_DONE, "Done", wxDefaultPosition, wxDefaultSize, 0 );
681  item7->SetDefault();
682  item6->Add( item7, 0, wxALIGN_CENTRE|wxALL, 5 );
683 
684  wxButton *item8 = new wxButton( parent, ID_CANCEL, "Cancel", wxDefaultPosition, wxDefaultSize, 0 );
685  item6->Add( item8, 0, wxALIGN_CENTRE|wxALL, 5 );
686 
687  item6->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 );
688 
689  wxStaticText *item9 = new wxStaticText( parent, ID_TEXT, "Apply after each change?", wxDefaultPosition, wxDefaultSize, 0 );
690  item6->Add( item9, 0, wxALIGN_CENTRE|wxALL, 5 );
691 
692  wxCheckBox *item10 = new wxCheckBox( parent, ID_ALWAYS_APPLY, "", wxDefaultPosition, wxDefaultSize, 0 );
693  item10->SetValue( TRUE );
694  item6->Add( item10, 0, wxALIGN_CENTRE|wxALL, 5 );
695 
696  wxButton *item11 = new wxButton( parent, ID_APPLY, "Apply", wxDefaultPosition, wxDefaultSize, 0 );
697  item6->Add( item11, 0, wxALIGN_CENTRE|wxALL, 5 );
698 
699  item0->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );
700 
701  if (set_sizer)
702  {
703  parent->SetAutoLayout( TRUE );
704  parent->SetSizer( item0 );
705  if (call_fit)
706  {
707  item0->Fit( parent );
708  item0->SetSizeHints( parent );
709  }
710  }
711 
712  return item0;
713 }
714 
715 wxSizer *LayoutSettingsPage( wxPanel *parent, bool call_fit, bool set_sizer )
716 {
717  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
718 
719  wxStaticBox *item2 = new wxStaticBox( parent, -1, "Rendering Settings" );
720  wxStaticBoxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL );
721 
722  wxFlexGridSizer *item3 = new wxFlexGridSizer( 5, 0, 0 );
723 
724  wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, "Group", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
725  item3->Add( item4, 0, wxALIGN_CENTRE|wxALL, 5 );
726 
727  wxStaticText *item5 = new wxStaticText( parent, ID_TEXT, "Show", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
728  item3->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
729 
730  wxStaticText *item6 = new wxStaticText( parent, ID_TEXT, "Rendering", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
731  item3->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );
732 
733  wxStaticText *item7 = new wxStaticText( parent, ID_TEXT, "Color Scheme", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
734  item3->Add( item7, 0, wxALIGN_CENTRE|wxALL, 5 );
735 
736  wxStaticText *item8 = new wxStaticText( parent, ID_TEXT, "User Color", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
737  item3->Add( item8, 0, wxALIGN_CENTRE|wxALL, 5 );
738 
739  wxStaticText *item9 = new wxStaticText( parent, ID_TEXT, "Protein backbone:", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
740  item3->Add( item9, 0, wxALIGN_CENTRE|wxALL, 5 );
741 
742  wxString strs10[] =
743  {
744  "None",
745  "Trace",
746  "Partial",
747  "Complete"
748  };
749  wxChoice *item10 = new wxChoice( parent, ID_PBB_SHOW, wxDefaultPosition, wxDefaultSize, 4, strs10, 0 );
750  item3->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
751 
752  wxString strs11[] =
753  {
754  "Wire Worm",
755  "Tube Worm",
756  "Wire",
757  "Tubes",
758  "Ball and Stick",
759  "Space Fill"
760  };
761  wxChoice *item11 = new wxChoice( parent, ID_PBB_RENDER, wxDefaultPosition, wxDefaultSize, 6, strs11, 0 );
762  item3->Add( item11, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
763 
764  wxString strs12[] =
765  {
766  "Element",
767  "Object",
768  "Molecule",
769  "Residue",
770  "Domain",
771  "Secondary Structure",
772  "Temperature",
773  "Rainbow",
774  "Charge",
775  "Hydrophobicity",
776  "User Selection",
777  "Aligned",
778  "Identity",
779  "Variety",
780  "Weighted Variety",
781  "Information Content",
782  "Fit",
783  "Block Fit",
784  "Normalized Block Fit",
785  "Block Row Fit"
786  };
787  wxChoice *item12 = new wxChoice( parent, ID_PBB_COLOR, wxDefaultPosition, wxDefaultSize, 20, strs12, 0 );
788  item3->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
789 
790  wxButton *item13 = new wxButton( parent, ID_PBB_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
791  item3->Add( item13, 0, wxALIGN_CENTRE|wxALL, 5 );
792 
793  wxStaticText *item14 = new wxStaticText( parent, ID_TEXT, "Protein sidechains:", wxDefaultPosition, wxDefaultSize, 0 );
794  item3->Add( item14, 0, wxALIGN_CENTRE|wxALL, 5 );
795 
796  wxCheckBox *item15 = new wxCheckBox( parent, ID_PSIDE_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
797  item3->Add( item15, 0, wxALIGN_CENTRE|wxALL, 5 );
798 
799  wxString strs16[] =
800  {
801  "Wire",
802  "Tubes",
803  "Ball and Stick",
804  "Space Fill"
805  };
806  wxChoice *item16 = new wxChoice( parent, ID_PSIDE_RENDER, wxDefaultPosition, wxDefaultSize, 4, strs16, 0 );
807  item3->Add( item16, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
808 
809  wxString strs17[] =
810  {
811  "Element",
812  "Object",
813  "Molecule",
814  "Residue",
815  "Domain",
816  "Temperature",
817  "Rainbow",
818  "Charge",
819  "Hydrophobicity",
820  "User Selection",
821  "Aligned",
822  "Identity",
823  "Variety",
824  "Weighted Variety",
825  "Information Content",
826  "Fit",
827  "Block Fit",
828  "Normalized Block Fit",
829  "Block Row Fit"
830  };
831  wxChoice *item17 = new wxChoice( parent, ID_PSIDE_COLOR, wxDefaultPosition, wxDefaultSize, 19, strs17, 0 );
832  item3->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
833 
834  wxButton *item18 = new wxButton( parent, ID_PSIDE_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
835  item3->Add( item18, 0, wxALIGN_CENTRE|wxALL, 5 );
836 
837  wxStaticText *item19 = new wxStaticText( parent, ID_TEXT, "Nucleotide backbone:", wxDefaultPosition, wxDefaultSize, 0 );
838  item3->Add( item19, 0, wxALIGN_CENTRE|wxALL, 5 );
839 
840  wxString strs20[] =
841  {
842  "None",
843  "Trace",
844  "Partial",
845  "Complete"
846  };
847  wxChoice *item20 = new wxChoice( parent, ID_NUC_SHOW, wxDefaultPosition, wxDefaultSize, 4, strs20, 0 );
848  item3->Add( item20, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
849 
850  wxString strs21[] =
851  {
852  "Wire Worm",
853  "Tube Worm",
854  "Wire",
855  "Tubes",
856  "Ball and Stick",
857  "Space Fill"
858  };
859  wxChoice *item21 = new wxChoice( parent, ID_NUC_RENDER, wxDefaultPosition, wxDefaultSize, 6, strs21, 0 );
860  item3->Add( item21, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
861 
862  wxString strs22[] =
863  {
864  "Element",
865  "Object",
866  "Molecule",
867  "Residue",
868  "Domain",
869  "Temperature",
870  "Rainbow",
871  "User Selection"
872  };
873  wxChoice *item22 = new wxChoice( parent, ID_NUC_COLOR, wxDefaultPosition, wxDefaultSize, 8, strs22, 0 );
874  item3->Add( item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
875 
876  wxButton *item23 = new wxButton( parent, ID_NUC_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
877  item3->Add( item23, 0, wxALIGN_CENTRE|wxALL, 5 );
878 
879  wxStaticText *item24 = new wxStaticText( parent, ID_TEXT, "Nucleotide sidechains:", wxDefaultPosition, wxDefaultSize, 0 );
880  item3->Add( item24, 0, wxALIGN_CENTRE|wxALL, 5 );
881 
882  wxCheckBox *item25 = new wxCheckBox( parent, ID_NSIDE_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
883  item3->Add( item25, 0, wxALIGN_CENTRE|wxALL, 5 );
884 
885  wxString strs26[] =
886  {
887  "Wire",
888  "Tubes",
889  "Ball and Stick",
890  "Space Fill"
891  };
892  wxChoice *item26 = new wxChoice( parent, ID_NSIDE_RENDER, wxDefaultPosition, wxDefaultSize, 4, strs26, 0 );
893  item3->Add( item26, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
894 
895  wxString strs27[] =
896  {
897  "Element",
898  "Object",
899  "Molecule",
900  "Residue",
901  "Domain",
902  "Temperature",
903  "Rainbow",
904  "User Selection"
905  };
906  wxChoice *item27 = new wxChoice( parent, ID_NSIDE_COLOR, wxDefaultPosition, wxDefaultSize, 8, strs27, 0 );
907  item3->Add( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
908 
909  wxButton *item28 = new wxButton( parent, ID_NSIDE_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
910  item3->Add( item28, 0, wxALIGN_CENTRE|wxALL, 5 );
911 
912  wxStaticText *item29 = new wxStaticText( parent, ID_TEXT, "Heterogens:", wxDefaultPosition, wxDefaultSize, 0 );
913  item3->Add( item29, 0, wxALIGN_CENTRE|wxALL, 5 );
914 
915  wxCheckBox *item30 = new wxCheckBox( parent, ID_HET_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
916  item3->Add( item30, 0, wxALIGN_CENTRE|wxALL, 5 );
917 
918  wxString strs31[] =
919  {
920  "Wire",
921  "Tubes",
922  "Ball and Stick",
923  "Space Fill"
924  };
925  wxChoice *item31 = new wxChoice( parent, ID_HET_RENDER, wxDefaultPosition, wxDefaultSize, 4, strs31, 0 );
926  item3->Add( item31, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
927 
928  wxString strs32[] =
929  {
930  "Element",
931  "Object",
932  "Molecule",
933  "Temperature",
934  "User Selection"
935  };
936  wxChoice *item32 = new wxChoice( parent, ID_HET_COLOR, wxDefaultPosition, wxDefaultSize, 5, strs32, 0 );
937  item3->Add( item32, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
938 
939  wxButton *item33 = new wxButton( parent, ID_HET_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
940  item3->Add( item33, 0, wxALIGN_CENTRE|wxALL, 5 );
941 
942  wxStaticText *item34 = new wxStaticText( parent, ID_TEXT, "Solvents:", wxDefaultPosition, wxDefaultSize, 0 );
943  item3->Add( item34, 0, wxALIGN_CENTRE|wxALL, 5 );
944 
945  wxCheckBox *item35 = new wxCheckBox( parent, ID_SOLV_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
946  item3->Add( item35, 0, wxALIGN_CENTRE|wxALL, 5 );
947 
948  wxString strs36[] =
949  {
950  "Wire",
951  "Tubes",
952  "Ball and Stick",
953  "Space Fill"
954  };
955  wxChoice *item36 = new wxChoice( parent, ID_SOLV_RENDER, wxDefaultPosition, wxDefaultSize, 4, strs36, 0 );
956  item3->Add( item36, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
957 
958  wxString strs37[] =
959  {
960  "Element",
961  "Object",
962  "Molecule",
963  "Temperature",
964  "User Selection"
965  };
966  wxChoice *item37 = new wxChoice( parent, ID_SOLV_COLOR, wxDefaultPosition, wxDefaultSize, 5, strs37, 0 );
967  item3->Add( item37, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
968 
969  wxButton *item38 = new wxButton( parent, ID_SOLV_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
970  item3->Add( item38, 0, wxALIGN_CENTRE|wxALL, 5 );
971 
972  wxStaticText *item39 = new wxStaticText( parent, ID_TEXT, "Connections:", wxDefaultPosition, wxDefaultSize, 0 );
973  item3->Add( item39, 0, wxALIGN_CENTRE|wxALL, 5 );
974 
975  wxCheckBox *item40 = new wxCheckBox( parent, ID_CONN_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
976  item3->Add( item40, 0, wxALIGN_CENTRE|wxALL, 5 );
977 
978  wxString strs41[] =
979  {
980  "Wire",
981  "Tubes"
982  };
983  wxChoice *item41 = new wxChoice( parent, ID_CONN_RENDER, wxDefaultPosition, wxDefaultSize, 2, strs41, 0 );
984  item3->Add( item41, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
985 
986  wxString strs42[] =
987  {
988  "User Selection"
989  };
990  wxChoice *item42 = new wxChoice( parent, ID_CONN_COLOR, wxDefaultPosition, wxDefaultSize, 1, strs42, 0 );
991  item3->Add( item42, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
992 
993  wxButton *item43 = new wxButton( parent, ID_CONN_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
994  item3->Add( item43, 0, wxALIGN_CENTRE|wxALL, 5 );
995 
996  wxStaticText *item44 = new wxStaticText( parent, ID_TEXT, "Helix objects:", wxDefaultPosition, wxDefaultSize, 0 );
997  item3->Add( item44, 0, wxALIGN_CENTRE|wxALL, 5 );
998 
999  wxCheckBox *item45 = new wxCheckBox( parent, ID_HELX_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
1000  item3->Add( item45, 0, wxALIGN_CENTRE|wxALL, 5 );
1001 
1002  wxString strs46[] =
1003  {
1004  "With Arrows",
1005  "Without Arrows"
1006  };
1007  wxChoice *item46 = new wxChoice( parent, ID_HELX_RENDER, wxDefaultPosition, wxDefaultSize, 2, strs46, 0 );
1008  item3->Add( item46, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1009 
1010  wxString strs47[] =
1011  {
1012  "Object",
1013  "Molecule",
1014  "Domain",
1015  "Secondary Structure",
1016  "User Selection"
1017  };
1018  wxChoice *item47 = new wxChoice( parent, ID_HELX_COLOR, wxDefaultPosition, wxDefaultSize, 5, strs47, 0 );
1019  item3->Add( item47, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1020 
1021  wxButton *item48 = new wxButton( parent, ID_HELX_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
1022  item3->Add( item48, 0, wxALIGN_CENTRE|wxALL, 5 );
1023 
1024  wxStaticText *item49 = new wxStaticText( parent, ID_TEXT, "Strand objects:", wxDefaultPosition, wxDefaultSize, 0 );
1025  item3->Add( item49, 0, wxALIGN_CENTRE|wxALL, 5 );
1026 
1027  wxCheckBox *item50 = new wxCheckBox( parent, ID_STRN_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
1028  item3->Add( item50, 0, wxALIGN_CENTRE|wxALL, 5 );
1029 
1030  wxString strs51[] =
1031  {
1032  "With Arrows",
1033  "Without Arrows"
1034  };
1035  wxChoice *item51 = new wxChoice( parent, ID_STRN_RENDER, wxDefaultPosition, wxDefaultSize, 2, strs51, 0 );
1036  item3->Add( item51, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1037 
1038  wxString strs52[] =
1039  {
1040  "Object",
1041  "Molecule",
1042  "Domain",
1043  "Secondary Structure",
1044  "User Selection"
1045  };
1046  wxChoice *item52 = new wxChoice( parent, ID_STRN_COLOR, wxDefaultPosition, wxDefaultSize, 5, strs52, 0 );
1047  item3->Add( item52, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1048 
1049  wxButton *item53 = new wxButton( parent, ID_STRN_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
1050  item3->Add( item53, 0, wxALIGN_CENTRE|wxALL, 5 );
1051 
1052  wxStaticText *item54 = new wxStaticText( parent, ID_TEXT, "Virtual disulfides:", wxDefaultPosition, wxDefaultSize, 0 );
1053  item3->Add( item54, 0, wxALIGN_CENTRE|wxALL, 5 );
1054 
1055  wxCheckBox *item55 = new wxCheckBox( parent, ID_VSS_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
1056  item3->Add( item55, 0, wxALIGN_CENTRE|wxALL, 5 );
1057 
1058  item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
1059 
1060  item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
1061 
1062  wxButton *item56 = new wxButton( parent, ID_VSS_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
1063  item3->Add( item56, 0, wxALIGN_CENTRE|wxALL, 5 );
1064 
1065  wxStaticText *item57 = new wxStaticText( parent, ID_TEXT, "Hydrogens:", wxDefaultPosition, wxDefaultSize, 0 );
1066  item3->Add( item57, 0, wxALIGN_CENTRE|wxALL, 5 );
1067 
1068  wxCheckBox *item58 = new wxCheckBox( parent, ID_HYD_SHOW, "", wxDefaultPosition, wxDefaultSize, 0 );
1069  item3->Add( item58, 0, wxALIGN_CENTRE|wxALL, 5 );
1070 
1071  item3->Add( 5, 5, 0, wxALIGN_CENTRE|wxALL, 5 );
1072 
1073  wxStaticText *item59 = new wxStaticText( parent, ID_TEXT, "Background:", wxDefaultPosition, wxDefaultSize, 0 );
1074  item3->Add( item59, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1075 
1076  wxButton *item60 = new wxButton( parent, ID_BG_USER, "Set Color", wxDefaultPosition, wxDefaultSize, 0 );
1077  item3->Add( item60, 0, wxALIGN_CENTRE|wxALL, 5 );
1078 
1079  item1->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 );
1080 
1081  item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
1082 
1083  if (set_sizer)
1084  {
1085  parent->SetAutoLayout( TRUE );
1086  parent->SetSizer( item0 );
1087  if (call_fit)
1088  {
1089  item0->Fit( parent );
1090  item0->SetSizeHints( parent );
1091  }
1092  }
1093 
1094  return item0;
1095 }
1096 
1097 wxSizer *LayoutLabelsPage( wxPanel *parent, bool call_fit, bool set_sizer )
1098 {
1099  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
1100 
1101  wxStaticBox *item2 = new wxStaticBox( parent, -1, "Labeling Settings" );
1102  wxStaticBoxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL );
1103 
1104  wxBoxSizer *item3 = new wxBoxSizer( wxVERTICAL );
1105 
1106  wxGridSizer *item4 = new wxGridSizer( 3, 5, 0 );
1107 
1108  item4->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 );
1109 
1110  wxStaticText *item5 = new wxStaticText( parent, ID_TEXT, "Protein backbone:", wxDefaultPosition, wxDefaultSize, 0 );
1111  item4->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
1112 
1113  wxStaticText *item6 = new wxStaticText( parent, ID_TEXT, "Nucleotide backbone:", wxDefaultPosition, wxDefaultSize, 0 );
1114  item4->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );
1115 
1116  wxStaticText *item7 = new wxStaticText( parent, ID_TEXT, "Spacing (0 = none):", wxDefaultPosition, wxDefaultSize, 0 );
1117  item4->Add( item7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1118 
1119  wxSpinCtrl *item8 = new wxSpinCtrl( parent, ID_S_PROT, "0", wxDefaultPosition, wxDefaultSize, 0, 0, 100, 0 );
1120  item4->Add( item8, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1121 
1122  wxSpinCtrl *item9 = new wxSpinCtrl( parent, ID_S_NUC, "0", wxDefaultPosition, wxDefaultSize, 0, 0, 100, 0 );
1123  item4->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1124 
1125  wxStaticText *item10 = new wxStaticText( parent, ID_TEXT, "Type:", wxDefaultPosition, wxDefaultSize, 0 );
1126  item4->Add( item10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1127 
1128  wxString strs11[] =
1129  {
1130  "One Letter",
1131  "Three Letter"
1132  };
1133  wxChoice *item11 = new wxChoice( parent, ID_C_PROT_TYPE, wxDefaultPosition, wxDefaultSize, 2, strs11, 0 );
1134  item4->Add( item11, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1135 
1136  wxString strs12[] =
1137  {
1138  "One Letter",
1139  "Three Letter"
1140  };
1141  wxChoice *item12 = new wxChoice( parent, ID_C_NUC_TYPE, wxDefaultPosition, wxDefaultSize, 2, strs12, 0 );
1142  item4->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1143 
1144  wxStaticText *item13 = new wxStaticText( parent, ID_TEXT, "Numbering:", wxDefaultPosition, wxDefaultSize, 0 );
1145  item4->Add( item13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1146 
1147  wxString strs14[] =
1148  {
1149  "None",
1150  "Sequential",
1151  "From PDB"
1152  };
1153  wxChoice *item14 = new wxChoice( parent, ID_C_PROT_NUM, wxDefaultPosition, wxDefaultSize, 3, strs14, 0 );
1154  item4->Add( item14, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1155 
1156  wxString strs15[] =
1157  {
1158  "None",
1159  "Sequential",
1160  "From PDB"
1161  };
1162  wxChoice *item15 = new wxChoice( parent, ID_C_NUC_NUM, wxDefaultPosition, wxDefaultSize, 3, strs15, 0 );
1163  item4->Add( item15, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1164 
1165  wxStaticText *item16 = new wxStaticText( parent, ID_TEXT, "Contrast with background:", wxDefaultPosition, wxDefaultSize, 0 );
1166  item4->Add( item16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1167 
1168  wxCheckBox *item17 = new wxCheckBox( parent, ID_K_PROT_CONTRAST, "", wxDefaultPosition, wxDefaultSize, 0 );
1169  item4->Add( item17, 0, wxALIGN_CENTRE|wxALL, 5 );
1170 
1171  wxCheckBox *item18 = new wxCheckBox( parent, ID_K_NUC_CONTRAST, "", wxDefaultPosition, wxDefaultSize, 0 );
1172  item4->Add( item18, 0, wxALIGN_CENTRE|wxALL, 5 );
1173 
1174  wxStaticText *item19 = new wxStaticText( parent, ID_TEXT, "Termini:", wxDefaultPosition, wxDefaultSize, 0 );
1175  item4->Add( item19, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1176 
1177  wxCheckBox *item20 = new wxCheckBox( parent, ID_K_PROT_TERM, "", wxDefaultPosition, wxDefaultSize, 0 );
1178  item4->Add( item20, 0, wxALIGN_CENTRE|wxALL, 5 );
1179 
1180  wxCheckBox *item21 = new wxCheckBox( parent, ID_K_NUC_TERM, "", wxDefaultPosition, wxDefaultSize, 0 );
1181  item4->Add( item21, 0, wxALIGN_CENTRE|wxALL, 5 );
1182 
1183  item3->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
1184  //item3->Add(item4, 0, wxGROW, 5);
1185 
1186  wxStaticLine *item22 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
1187  item3->Add(item22, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
1188  //item3->Add( item22, 0, wxGROW|wxALL, 5 );
1189 
1190  wxBoxSizer *item23 = new wxBoxSizer( wxHORIZONTAL );
1191 
1192  wxStaticText *item24 = new wxStaticText( parent, ID_TEXT, "Metal ion labels:", wxDefaultPosition, wxDefaultSize, 0 );
1193  item23->Add( item24, 0, wxALIGN_CENTRE|wxALL, 5 );
1194 
1195  item23->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 5 );
1196 
1197  wxCheckBox *item25 = new wxCheckBox( parent, ID_K_ION, "", wxDefaultPosition, wxDefaultSize, 0 );
1198  item23->Add( item25, 0, wxALIGN_CENTRE|wxALL, 5 );
1199 
1200  item3->Add( item23, 0, wxALIGN_CENTRE|wxALL, 5 );
1201 
1202  item1->Add( item3, 0, wxALIGN_CENTRE|wxALL, 5 );
1203 
1204  item0->Add( item1, 0, wxALIGN_CENTRE|wxALL, 5 );
1205 
1206  if (set_sizer)
1207  {
1208  parent->SetAutoLayout( TRUE );
1209  parent->SetSizer( item0 );
1210  if (call_fit)
1211  {
1212  item0->Fit( parent );
1213  item0->SetSizeHints( parent );
1214  }
1215  }
1216 
1217  return item0;
1218 }
1219 
1220 
1221 /////
1222 // this is modified from wxDesigner output in order to use custom SpinCtrl's
1223 /////
1224 
1225 wxSizer *LayoutDetailsPage(wxPanel *parent, bool call_fit, bool set_sizer)
1226 {
1227  wxBoxSizer *item0 = new wxBoxSizer(wxVERTICAL);
1228  wxStaticBox *item2 = new wxStaticBox(parent, -1, "Rendering Details");
1229  wxStaticBoxSizer *item1 = new wxStaticBoxSizer(item2, wxVERTICAL);
1230  wxFlexGridSizer *grid = new wxFlexGridSizer(2, 0, 0);
1231 
1232  // space fill proportion
1233  wxStaticText *item4 = new wxStaticText(parent, ID_TEXT, "Space fill size:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1234  grid->Add(item4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1235  gfpSpaceFill = new FloatingPointSpinCtrl(parent,
1236  0.0, 10.0, 0.1, 1.0,
1237  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1238  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1239  grid->Add(gfpSpaceFill->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1240 // grid->Add(gfpSpaceFill->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1241 
1242  // tube radius
1243  wxStaticText *item7 = new wxStaticText(parent, ID_TEXT, "Tube radius:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1244  grid->Add(item7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1245  gfpTubeRadius = new FloatingPointSpinCtrl(parent,
1246  0.0, 5.0, 0.02, 0.3,
1247  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1248  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1249  grid->Add(gfpTubeRadius->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1250 // grid->Add(gfpTubeRadius->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1251 
1252  // worm tube
1253  wxStaticText *item10 = new wxStaticText(parent, ID_TEXT, "Worm tube radius:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1254  grid->Add(item10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1256  0.0, 5.0, 0.02, 0.3,
1257  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1258  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1259  grid->Add(gfpTubeWormRadius->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1260 // grid->Add(gfpTubeWormRadius->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1261 
1262  // ball radius
1263  wxStaticText *item13 = new wxStaticText(parent, ID_TEXT, "Ball radius:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1264  grid->Add(item13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1265  gfpBallRadius = new FloatingPointSpinCtrl(parent,
1266  0.0, 10.0, 0.05, 0.4,
1267  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1268  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1269  grid->Add(gfpBallRadius->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1270 // grid->Add(gfpBallRadius->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1271 
1272  // stick radius
1273  wxStaticText *item16 = new wxStaticText(parent, ID_TEXT, "Stick radius:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1274  grid->Add(item16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1276  0.0, 5.0, 0.01, 0.2,
1277  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1278  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1279  grid->Add(gfpStickRadius->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1280  // grid->Add(gfpStickRadius->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1281 
1282  // spacer
1283  grid->Add(1, 1, 0, wxALIGN_CENTRE|wxALL, 5);
1284  grid->Add(1, 1, 0, wxALIGN_CENTRE|wxALL, 5);
1285  //grid->Add(1, 1, 0, wxALIGN_CENTRE|wxALL, 5);
1286 
1287  // helix radius
1288  wxStaticText *item19 = new wxStaticText(parent, ID_TEXT, "Helix radius:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1289  grid->Add(item19, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1291  0.0, 10.0, 0.1, 1.8,
1292  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1293  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1294  grid->Add(gfpHelixRadius->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1295 // grid->Add(gfpHelixRadius->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1296 
1297  // strand width
1298  wxStaticText *item22 = new wxStaticText(parent, ID_TEXT, "Strand width:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1299  grid->Add(item22, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1301  0.0, 10.0, 0.1, 2.0,
1302  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1303  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1304  grid->Add(gfpStrandWidth->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1305 // grid->Add(gfpStrandWidth->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1306 
1307  // strand thickness
1308  wxStaticText *item25 = new wxStaticText(parent, ID_TEXT, "Strand thickness:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
1309  grid->Add(item25, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
1311  0.0, 5.0, 0.05, 0.5,
1312  wxDefaultPosition, wxSize(80, SPIN_CTRL_HEIGHT), 0,
1313  wxDefaultPosition, wxSize(-1, SPIN_CTRL_HEIGHT));
1314  grid->Add(gfpStrandThickness->GetTextCtrl(), 0, wxALIGN_CENTRE|wxLEFT|wxTOP|wxBOTTOM, 5);
1315 // grid->Add(gfpStrandThickness->GetSpinButton(), 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5);
1316 
1317  item1->Add(grid, 0, wxALIGN_CENTRE|wxALL, 5);
1318  item0->Add(item1, 0, wxALIGN_CENTRE|wxALL, 5);
1319  if (set_sizer)
1320  {
1321  parent->SetAutoLayout(TRUE);
1322  parent->SetSizer(item0);
1323  if (call_fit)
1324  {
1325  item0->Fit(parent);
1326  item0->SetSizeHints(parent);
1327  }
1328  }
1329 
1330  return item0;
1331 }
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
static CBioSource dummy
wxTextCtrl * GetTextCtrl(void) const
Definition: wx_tools.hpp:206
void PostRedrawAllStructures(void)
Definition: messenger.cpp:79
void PostRedrawAllSequenceViewers(void)
Definition: messenger.cpp:90
StyleManager * styleManager
ncbi::FloatingPointSpinCtrl * fpStrandWidth
void OnButton(wxCommandEvent &event)
static TypeStringAssociator< StyleSettings::eLabelType > LabelTypeStrings
~StyleDialog(void)
ncbi::FloatingPointSpinCtrl * fpHelixRadius
bool GetValues(StyleSettings *settings)
bool changedSinceApply
bool GetBackboneStyle(StyleSettings::BackboneStyle *bbStyle, int showID, int renderID, int colorID, int userID)
bool HandleColorButton(int bID)
ncbi::FloatingPointSpinCtrl * fpStickRadius
ncbi::FloatingPointSpinCtrl * fpBallRadius
bool GetGeneralStyle(StyleSettings::GeneralStyle *gStyle, int showID, int renderID, int colorID, int userID)
bool SetLabelStyle(const StyleSettings::LabelStyle &lStyle, int spacingID, int typeID, int numberingID, int terminiID, int whiteID)
bool SetControls(const StyleSettings &settings)
const StructureSet * structureSet
static TypeStringAssociator< StyleSettings::eColorScheme > ColorSchemeStrings
static TypeStringAssociator< StyleSettings::eNumberType > NumberTypeStrings
bool GetLabelStyle(StyleSettings::LabelStyle *lStyle, int spacingID, int typeID, int numberingID, int terminiID, int whiteID)
const StyleSettings originalSettings
StyleSettings * editedSettings
void OnCloseWindow(wxCloseEvent &event)
ncbi::FloatingPointSpinCtrl * fpTubeWormRadius
ncbi::FloatingPointSpinCtrl * fpTubeRadius
static void SetupStyleStrings(void)
bool SetGeneralStyle(const StyleSettings::GeneralStyle &gStyle, int showID, int renderID, int colorID, int userID)
static TypeStringAssociator< StyleSettings::eBackboneType > BackboneTypeStrings
void OnSpin(wxSpinEvent &event)
ncbi::FloatingPointSpinCtrl * fpSpaceFill
static TypeStringAssociator< StyleSettings::eDrawingStyle > DrawingStyleStrings
ncbi::FloatingPointSpinCtrl * fpStrandThickness
void OnChange(wxCommandEvent &event)
bool SetBackboneStyle(const StyleSettings::BackboneStyle &bbStyle, int showID, int renderID, int colorID, int userID)
bool CheckStyleSettings(StyleSettings *settings)
LabelStyle nucleotideLabels
GeneralStyle helixObjects
Vector backgroundColor
GeneralStyle connections
GeneralStyle heterogens
GeneralStyle proteinSidechains
BackboneStyle nucleotideBackbone
GeneralStyle solvents
GeneralStyle nucleotideSidechains
double spaceFillProportion
GeneralStyle strandObjects
LabelStyle proteinLabels
double strandThickness
BackboneStyle proteinBackbone
Vector virtualDisulfideColor
Definition: svg.hpp:543
int Size(void) const
Definition: cn3d_tools.hpp:278
bool Get(const std::string &name, T *type) const
Definition: cn3d_tools.hpp:261
void Associate(const T &type, const std::string &name)
Definition: cn3d_tools.hpp:251
void Set(double xs, double ys, double zs)
Definition: vector_math.hpp:62
Definition: set.hpp:45
#define TRACEMSG(stream)
Definition: cn3d_tools.hpp:83
#define WX_TO_STD(wxstring)
Definition: cn3d_tools.hpp:285
#define ERRORMSG(stream)
Definition: cn3d_tools.hpp:86
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define false
Definition: bool.h:36
#define NULL
Definition: ncbistd.hpp:225
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
n background color
END_EVENT_TABLE()
Messenger * GlobalMessenger(void)
Definition: messenger.cpp:73
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define TRUE
bool replacment for C indicating true.
Definition: ncbi_std.h:97
#define FALSE
bool replacment for C indicating false.
Definition: ncbi_std.h:101
#define ID_CONN_USER
#define ID_HET_RENDER
#define ID_SOLV_RENDER
#define ID_LINE
#define ID_HELX_USER
#define ID_PSIDE_USER
#define ID_CONN_RENDER
#define ID_PSIDE_SHOW
#define ID_HET_USER
#define ID_DONE
#define ID_K_NUC_TERM
#define ID_NSIDE_SHOW
#define ID_SOLV_COLOR
#define ID_SOLV_SHOW
#define ID_HELX_SHOW
static FloatingPointSpinCtrl * gfpSpaceFill
static FloatingPointSpinCtrl * gfpTubeRadius
#define ID_S_PROT
#define ID_C_PROT_TYPE
#define ID_NUC_RENDER
#define ID_HELX_RENDER
#define ID_BG_USER
#define ID_SOLV_USER
#define ID_PSIDE_RENDER
static bool SetButtonColor(wxButton *button, const Vector &color)
static bool SetChoiceToString(wxChoice *choice, const string &name)
#define ID_NUC_COLOR
static FloatingPointSpinCtrl * gfpHelixRadius
static FloatingPointSpinCtrl * gfpStickRadius
#define ID_NSIDE_USER
#define ID_CONN_SHOW
#define ID_STRN_USER
#define ID_K_PROT_TERM
#define ID_PBB_SHOW
#define ID_C_NUC_TYPE
#define ID_S_NUC
#define ID_VSS_SHOW
#define ID_NUC_USER
#define ID_TEXT
static bool SetInteger(wxSpinCtrl *spinctrl, int value)
#define ID_HYD_SHOW
#define ID_STRN_COLOR
static FloatingPointSpinCtrl * gfpTubeWormRadius
#define ID_NSIDE_COLOR
#define ID_NOTEBOOK
#define ID_CANCEL
wxSizer * LayoutSettingsPage(wxPanel *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
#define ID_ALWAYS_APPLY
#define ID_C_NUC_NUM
#define ID_NUC_SHOW
#define ID_K_ION
wxSizer * LayoutDetailsPage(wxPanel *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
static FloatingPointSpinCtrl * gfpStrandThickness
#define ID_PBB_RENDER
#define ID_HELX_COLOR
#define ID_K_PROT_CONTRAST
#define ID_NSIDE_RENDER
static bool SetChecked(wxCheckBox *checkbox, bool isChecked)
#define ID_STRN_RENDER
#define ID_PBB_COLOR
#define ID_STRN_SHOW
#define ID_CONN_COLOR
static bool GetInteger(wxSpinCtrl *spinctrl, int *value)
USING_NCBI_SCOPE
static bool GetChecked(wxCheckBox *checkbox, bool *isChecked)
static bool ConvertColor(const wxColour &wxcol, Vector *vec)
#define ID_VSS_USER
wxSizer * LayoutNotebook(wxPanel *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
#define ID_K_NUC_CONTRAST
#define ID_HET_SHOW
#define ID_PBB_USER
#define ID_APPLY
#define ID_HET_COLOR
#define ID_PSIDE_COLOR
static FloatingPointSpinCtrl * gfpStrandWidth
wxSizer * LayoutLabelsPage(wxPanel *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
#define ID_C_PROT_NUM
static FloatingPointSpinCtrl * gfpBallRadius
const int WX_TOOLS_NOTIFY_CHANGED
Definition: wx_tools.cpp:43
#define const
Definition: zconf.h:232
Modified on Sat Apr 13 11:48:18 2024 by modify_doxy.py rev. 669887