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

Go to the SVN repository for this file.

1 /* $Id: wx_ncbi_app_demo.cpp 34640 2016-02-01 20:53:32Z katargir $
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: Andrey Yazhuk
27  *
28  * File Description:
29  * A simple wxWidgets GUI demo application.
30  */
31 
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbifile.hpp>
35 
38 
40 
41 
43 
44 
45 ///////////////////////////////////////////////////////////////////////////////
46 /// Derive our application class from CwxNCBIApp and use it together with
47 /// standard CNCBIwxApplication.
48 
49 class CDemoApp: public CwxNCBIApp
50 {
51 protected:
52  // we are overriding this function to create our main frame window
53  virtual bool x_CreateGUI();
54 
55  virtual wxString x_GetGuiRegistryPath();
56 };
57 
58 
59 // Declare wxWidgets application class
60 // this will allow CNCBIwxApplication to instantiate our class
61 DECLARE_APP(ncbi::CDemoApp)
62 IMPLEMENT_APP_NO_MAIN(ncbi::CDemoApp)
63 IMPLEMENT_WX_THEME_SUPPORT
64 
65 
67 {
69  frame->Show(true);
70  return true;
71 }
72 
74 {
75  return CSysPath::ResolvePath(wxT("<std>/wxdemo.asn"));
76 }
77 
79 
80 /////////////////////////////////////////////////////////////////////////////
81 // main entry point
82 
83 int NcbiSys_main(int argc, ncbi::TXChar* argv[])
84 {
85  // create standard NCBI wxWidgets application
86  ncbi::CNCBIwxApplication ncbi_app("wxWidgets demo App");
87 
88  // Execute main application function
89  return ncbi_app.AppMain(argc, argv);
90 }
Derive our application class from CwxNCBIApp and use it together with standard CNCBIwxApplication.
virtual bool x_CreateGUI()
create main application window and initialize associated objects return true if successful
virtual wxString x_GetGuiRegistryPath()
virtual bool x_CreateGUI()
create main application window and initialize associated objects return true if successful
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
Definition: sys_path.cpp:106
CwxNCBIApp - this class should be used in NCBI applications instead of wxApp it provides polling supp...
Definition: wx_app.hpp:80
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
char TXChar
Definition: ncbistr.hpp:172
#define ID_CWXMAINFRAME
Definition: gui.hpp:47
#define wxT(x)
Definition: muParser.cpp:41
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
int NcbiSys_main(int argc, ncbi::TXChar *argv[])
Modified on Wed Jul 24 17:20:46 2024 by modify_doxy.py rev. 669887