Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
MyFrame Class Reference

#include <wxProfileDump.h>

+ Inheritance diagram for MyFrame:
+ Collaboration diagram for MyFrame:

Public Member Functions

void InitToolBar (wxToolBar *toolBar)
 
 MyFrame (wxWindow *parent, const wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, const long style)
 
void OnAbout (wxCommandEvent &event)
 
void OnClose (wxCloseEvent &event)
 
void OnOpenProfile (wxCommandEvent &event)
 
void OnQuit (wxCommandEvent &event)
 
void OpenFile (wxString path)
 

Detailed Description

Definition at line 97 of file wxProfileDump.h.

Constructor & Destructor Documentation

◆ MyFrame()

MyFrame::MyFrame ( wxWindow * parent,
const wxWindowID id,
const wxString & title,
const wxPoint & pos,
const wxSize & size,
const long style )

Definition at line 251 of file wxProfileDump.cpp.

257 : wxMDIParentFrame(parent, id, title, pos, size,
258 style | wxNO_FULL_REPAINT_ON_RESIZE)
259{
260#if wxUSE_TOOLBAR
261 CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
262 InitToolBar(GetToolBar());
263#endif // wxUSE_TOOLBAR
264
265 // Accelerators
266 wxAcceleratorEntry entries[3];
267 entries[0].Set(wxACCEL_CTRL, (int) 'O', MDI_OPEN_PROFILE);
268 entries[1].Set(wxACCEL_CTRL, (int) 'X', MDI_QUIT);
269 entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
270 wxAcceleratorTable accel(3, entries);
271 SetAcceleratorTable(accel);
272}
void InitToolBar(wxToolBar *toolBar)
@ MDI_ABOUT
@ MDI_QUIT
@ MDI_OPEN_PROFILE

References InitToolBar(), MDI_ABOUT, MDI_OPEN_PROFILE, and MDI_QUIT.

+ Here is the call graph for this function:

Member Function Documentation

◆ InitToolBar()

void MyFrame::InitToolBar ( wxToolBar * toolBar)

Referenced by MyFrame().

+ Here is the caller graph for this function:

◆ OnAbout()

void MyFrame::OnAbout ( wxCommandEvent & event)

Definition at line 297 of file wxProfileDump.cpp.

298{
299 (void)wxMessageBox(_T("wxProfileDump\n")
300 _T("Copyright (C) 2005-2023\n\n")
301 _T("Using ICCProflib version ") ICCPROFLIBVER _T("\n"),
302 _T("About wxProfileDump"));
303}
#define ICCPROFLIBVER

References ICCPROFLIBVER.

◆ OnClose()

void MyFrame::OnClose ( wxCloseEvent & event)

Definition at line 274 of file wxProfileDump.cpp.

275{
276 if ( event.CanVeto() && (gs_nFrames > 0) )
277 {
278 wxString msg;
279 msg.Printf(_T("%d windows still open, close anyhow?"), gs_nFrames);
280 if ( wxMessageBox(msg, _T("Please confirm"),
281 wxICON_QUESTION | wxYES_NO) != wxYES )
282 {
283 event.Veto();
284
285 return;
286 }
287 }
288
289 event.Skip();
290}
static int gs_nFrames

References gs_nFrames.

◆ OnOpenProfile()

void MyFrame::OnOpenProfile ( wxCommandEvent & event)

Definition at line 357 of file wxProfileDump.cpp.

358{
359 wxString profilePath;
360
361 if (event.GetId()==MDI_OPEN_PROFILE) {
362 wxFileDialog dialog(this, _T("Open Profile"), wxEmptyString, wxEmptyString, _T("ICC files (*.icc)|*.icc|ICM files (*.icm)|*.icm|All files|*.*"), wxOPEN |wxFILE_MUST_EXIST);
363
364 if (dialog.ShowModal()!=wxID_OK)
365 return;
366
367 profilePath = dialog.GetPath();
368 }
369 else {
370 profilePath = wxGetApp().m_history.GetHistoryFile(event.GetId() - wxID_FILE1);
371 }
372
373 OpenFile(profilePath);
374}
void OpenFile(wxString path)

References MDI_OPEN_PROFILE, and OpenFile().

+ Here is the call graph for this function:

◆ OnQuit()

void MyFrame::OnQuit ( wxCommandEvent & event)

Definition at line 292 of file wxProfileDump.cpp.

293{
294 Close();
295}

◆ OpenFile()

void MyFrame::OpenFile ( wxString path)

Definition at line 305 of file wxProfileDump.cpp.

306{
307 wxFileName filepath(profilePath);
308 wxString profileTitle = filepath.GetName();
309
310 char * pPath = strdup( profilePath.mb_str() );
311 CIccProfile *pIcc = OpenIccProfile(pPath);
312
313 if (!pIcc) {
314 (void)wxMessageBox(wxString(_T("Unable to open profile '")) + profilePath + _T("'"),
315 _T("Open Error!"));
316 return;
317 }
318
319 wxGetApp().m_history.AddFileToHistory(profilePath);
320
321 // Make another frame, containing a canvas
322 MyChild *subframe = new MyChild(my_frame, profileTitle, pIcc, profilePath);
323
324 subframe->SetTitle(profileTitle);
325
326 // Give it an icon
327#ifdef __WXMSW__
328 subframe->SetIcon(wxIcon(_T("ProfileDumpDoc_icn")));
329#else
330// subframe->SetIcon(wxIcon( mondrian_xpm ));
331#endif
332
333 // Make a menubar
334 wxMenu *file_menu = new wxMenu;
335 subframe->SetFileMenu(file_menu);
336
337 file_menu->Append(MDI_OPEN_PROFILE, _T("&Open Profile"));
338 file_menu->Append(MDI_CHILD_QUIT, _T("&Close"), _T("Close this window"));
339 file_menu->Append(MDI_QUIT, _T("&Exit"));
340
341 wxGetApp().m_history.UseMenu(file_menu);
342 wxGetApp().m_history.AddFilesToMenu(file_menu);
343
344 wxMenu *help_menu = new wxMenu;
345 help_menu->Append(MDI_ABOUT, _T("&About"));
346
347 wxMenuBar *menu_bar = new wxMenuBar;
348
349 menu_bar->Append(file_menu, _T("&File"));
350 menu_bar->Append(help_menu, _T("&Help"));
351
352 // Associate the menu bar with the frame
353 subframe->SetMenuBar(menu_bar);
354 subframe->Show(true);
355}
CIccProfile * OpenIccProfile(const icChar *szFilename, bool bUseSubProfile)
Name: OpenIccProfile.
void SetFileMenu(wxMenu *menu)
MyFrame * my_frame
@ MDI_CHILD_QUIT

References MDI_ABOUT, MDI_CHILD_QUIT, MDI_OPEN_PROFILE, MDI_QUIT, my_frame, OpenIccProfile(), and MyChild::SetFileMenu().

Referenced by MyDnDFile::OnDropFiles(), MyApp::OnInit(), and OnOpenProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: