Skip to content

Commit

Permalink
Added option to set dataset default state of color for each new windo…
Browse files Browse the repository at this point in the history
…w. Added appropriate default flag to included amrvis.defaults. false is no color.
  • Loading branch information
kngott committed Mar 8, 2018
1 parent fa2b465 commit d6741c3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Dataset.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class Dataset {

AmrPicture *GetAmrPicturePtr() { return amrPicturePtr; }

static bool GetInitialColor();
static void SetInitialColor(const bool bColor);

private:
Widget wDatasetTopLevel, wDatasetForm;
Widget wDatasetTools, wScrollArea, wPixArea;
Expand Down Expand Up @@ -87,6 +90,7 @@ class Dataset {
Atom WM_DELETE_WINDOW;
bool bTimeline, bRegions;

static bool initialColor;

Pixel blackIndex, whiteIndex;

Expand Down
8 changes: 7 additions & 1 deletion Dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Dataset::Dataset(const Box &alignedRegion, AmrPicture *apptr,
XtAddCallback(wColorButton, XmNvalueChangedCallback,
(XtCallbackProc) &Dataset::CBColorButton,
(XtPointer) this);
XmToggleButtonSetState(wColorButton, true, false);
XmToggleButtonSetState(wColorButton, Dataset::GetInitialColor(), false);
Dimension bHeight;
XtVaGetValues(wColorButton, XmNheight, &bHeight, NULL);

Expand Down Expand Up @@ -1310,4 +1310,10 @@ void Dataset::CBEndScrolling(Widget, XtPointer client_data, XtPointer) {
dset->DoExpose(false);
}
// -------------------------------------------------------------------
bool Dataset::initialColor = true;

bool Dataset::GetInitialColor() { return initialColor; }
void Dataset::SetInitialColor( const bool bColor ) {
Dataset::initialColor = bColor;
}
// -------------------------------------------------------------------
12 changes: 11 additions & 1 deletion GlobalUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ void AVGlobals::GetDefaults(const string &defaultsFile) {
PltApp::SetInitialWindowHeight(500);
PltApp::SetInitialWindowWidth(850);
PltApp::SetReserveSystemColors(24);
Dataset::SetInitialColor(true);
maxPictureSize = DEFAULTMAXPICTURESIZE;
boundaryWidth = 0;
skipPltLines = 0;
Expand Down Expand Up @@ -421,7 +422,16 @@ void AVGlobals::GetDefaults(const string &defaultsFile) {
sscanf(buffer, "%s%d", defaultString, &tempInt);
boxColor = tempInt;
}
else if(strcmp(defaultString, "filetype") == 0) {
else if(strcmp(defaultString, "datasetinitialcolor") == 0) {
sscanf(buffer, "%s%s", defaultString, tempString);
if(*tempString == 't' || *tempString == 'T') {
Dataset::SetInitialColor(true);
} else {
Dataset::SetInitialColor(false);
}
VisMF::SetUsePersistentIFStreams(usePerStreams);
}
else if(strcmp(defaultString, "filetype") == 0) {
sscanf(buffer, "%s%s", defaultString, tempString);
if(strcmp(tempString, "fab") == 0) {
fileType = Amrvis::FAB;
Expand Down
1 change: 1 addition & 0 deletions amrvis.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ windowwidth 800
windowheight 750
windowwidth 900
filetype newplt
datasetinitialcolor true
lowblack
cliptoppalette

0 comments on commit d6741c3

Please sign in to comment.