Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / utils / wxNamingViewer / wxNamingViewer.cpp
blobc53dc78a6716be9190ae01ace415bff3f048cfbe
1 // @file wxNamingViewer.cpp
2 // A wxWindows-based CORBA naming viewer.
3 // Based on NamingViewer Version 1.0 by Chris Hafey (chris@stentorsoft.com)
4 //
5 // @author: Charlie Frasch (cfrasch@atdesk.com)
6 #include "ace/Init_ACE.h"
7 #include "pch.h"
8 #include "wx/resource.h"
9 #include "wxNamingViewerFrame.h"
10 #include "wxNamingViewer.wxr"
12 #if defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
13 #include "wxNamingViewer.wxr"
14 #endif // defined(wxUSE_RESOURCES)
16 // Stuff for the C++Builder IDE
17 #define USEUNIT(x)
18 #define USERC(x)
19 #define USEFILE(x)
20 USEFILE("Readme");
21 USEUNIT("wxNamingViewerFrame.cpp");
22 USEUNIT("wxNamingTree.cpp");
23 USEUNIT("wxNamingObject.cpp");
24 USEFILE("wxNamingViewer.wxr");
25 USEUNIT("wxSelectNSDialog.cpp");
26 USEUNIT("wxBindNewContext.cpp");
27 USEUNIT("wxAddNameServerDlg.cpp");
28 USEUNIT("wxBindDialog.cpp");
29 USEUNIT("wxViewIORDialog.cpp");
30 USERC("wxNamingViewer.rc");
32 //---------------------------------------------------------------------------
34 class WxNamingViewer:
35 public wxApp
37 public:
38 virtual bool OnInit();
39 virtual int OnExit();
42 IMPLEMENT_APP(WxNamingViewer)
44 // Need this to keep C++Builder 4 happy
45 #ifdef __BORLANDC__
46 extern WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int);
47 #endif
49 int WxNamingViewer::OnExit()
51 ACE::fini();
52 return 0;
56 bool WxNamingViewer::OnInit()
58 ACE::init();
59 CORBA::ORB_var orb = CORBA::ORB_init(
60 argc,
61 argv);
63 #if defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
64 wxResourceParseData( bindObject);
65 wxResourceParseData( selectNS);
66 wxResourceParseData( addNameServer);
67 wxResourceParseData( bindNewContext);
68 wxResourceParseData( viewIOR);
69 #endif // defined(wxUSE_WX_RESOURCES)
71 WxNamingViewerFrame* frame = new WxNamingViewerFrame(
72 "wxNamingViewer",
73 wxDefaultPosition,
74 wxSize( 248, 198),
75 orb.in ());
76 frame->Show( TRUE);
77 return TRUE;