Example #1
0
bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
{
    if ( !wxDialog::Create(GetParentForModalDialog(parent, 0), wxID_ANY,
                           _("Choose colour"),
                           wxPoint(0, 0), wxSize(900, 900)) )
        return false;

    if (data)
        m_colourData = *data;

    InitializeColours();
    CalculateMeasurements();
    CreateWidgets();

    return true;
}
Example #2
0
/*----------------------------------------------------------------------------------------------------------------------*/
void InitializePrefs(void)
{
FILE *Fp;
gchar Skip[30];

strcpy(SetupDir,"."); strcpy(ListFDir,"."); strcpy(BanDir,"."); 
strcpy(SpecDir,"."); strcpy(BatDir,"."); strcpy(CalDir,"."); 
Theme1d=Theme2d=-1;
if ((Fp=fopen(".lamps_prefs","r")))
   {
   if (fscanf(Fp,"%s %s\n",Skip,SetupDir) !=2) strcpy(SetupDir,".");
   if (fscanf(Fp,"%s %s\n",Skip,ListFDir) !=2) strcpy(ListFDir,".");
   if (fscanf(Fp,"%s %s\n",Skip,BanDir)   !=2) strcpy(BanDir,"."); 
   if (fscanf(Fp,"%s %s\n",Skip,SpecDir)  !=2) strcpy(SpecDir,".");
   if (fscanf(Fp,"%s %s\n",Skip,BatDir)   !=2) strcpy(BatDir,"."); 
   if (fscanf(Fp,"%s %s\n",Skip,CalDir)   !=2) strcpy(CalDir,".");
   if (fscanf(Fp,"%s %d\n",Skip,&Theme1d) !=2) Theme1d=-1;                   //-1 for Random theme, see InitializeColours
   if (fscanf(Fp,"%s %d\n",Skip,&Theme2d) !=2) Theme2d=-1;                   //-1 for Random theme, see InitializeColours
   fclose(Fp);
   }
InitializeColours();
ReadCalibrationFile(".lamps_cal",FALSE);             //Was saved automatically whenever user did read or edit calibration
LoadBatchFile(".lamps_bat");
}
Example #3
0
//----------------------------------------------------------------------------------------------------------------------
void InitializePrefs(void)
{
FILE *Fp;
gchar Skip[30],PrefDir[MAX_FNAME_LENGTH];

DefaultPrefs(); CreateDir();
if ((Fp=fopen(".lamps_prefs","r")))
   {
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(SetupDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(ListFDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(BanDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(SpecDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(BatDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(CalDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(LogDir,PrefDir);
   if (fscanf(Fp,"%s %s\n",Skip,PrefDir) == 2) strcpy(MacroDir,PrefDir);
   if (fscanf(Fp,"%s %d\n",Skip,&Theme1d) != 2) Theme1d=-1;                 //-1 for Random theme, see InitializeColours
   if (fscanf(Fp,"%s %d\n",Skip,&Theme2d) != 2) Theme2d=-1;                 //-1 for Random theme, see InitializeColours
   fclose(Fp);
   }
else Prefs(NULL,NULL);
CreateDir();                                                                                        //Create directories
InitializeColours();
}