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

Go to the SVN repository for this file.

1 /* $Id: exclusive_edit_dlg.cpp 34313 2015-12-11 19:02:20Z 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:
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
34 ////@begin includes
35 ////@end includes
36 
37 #include "exclusive_edit_dlg.hpp"
38 
39 #include <wx/sizer.h>
40 #include <wx/stattext.h>
41 #include <wx/button.h>
42 
44 
45 IMPLEMENT_DYNAMIC_CLASS( CExclusiveEditDlg, wxDialog )
46 
47 BEGIN_EVENT_TABLE( CExclusiveEditDlg, wxDialog )
48 
49 ////@begin CExclusiveEditDlg event table entries
50  EVT_BUTTON( ID_ACTIVATE_WINDOW, CExclusiveEditDlg::OnActivateWindowClick )
51 
52 ////@end CExclusiveEditDlg event table entries
53 
55 
57 {
58  Init();
59 }
60 
61 CExclusiveEditDlg::CExclusiveEditDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
62 {
63  Init();
64  Create(parent, id, caption, pos, size, style);
65 }
66 
67 bool CExclusiveEditDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
68 {
69 ////@begin CExclusiveEditDlg creation
70  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
71  wxDialog::Create( parent, id, caption, pos, size, style );
72 
74  if (GetSizer())
75  {
76  GetSizer()->SetSizeHints(this);
77  }
78  Centre();
79 ////@end CExclusiveEditDlg creation
80  return true;
81 }
82 
84 {
85 ////@begin CExclusiveEditDlg destruction
86 ////@end CExclusiveEditDlg destruction
87 }
88 
90 {
91 ////@begin CExclusiveEditDlg member initialisation
92  m_TextCtrl = NULL;
93 ////@end CExclusiveEditDlg member initialisation
94 }
95 
97 {
98 ////@begin CExclusiveEditDlg content construction
99  CExclusiveEditDlg* itemDialog1 = this;
100 
101  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
102  itemDialog1->SetSizer(itemBoxSizer2);
103 
104  m_TextCtrl = new wxStaticText( itemDialog1, wxID_WINDOW_DESCRIPTION, _("Window \"%s\" has aquired exclusive edit access to the project:\n%s."), wxDefaultPosition, wxDefaultSize, 0 );
105  itemBoxSizer2->Add(m_TextCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
106 
107  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
108  itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
109 
110  wxButton* itemButton5 = new wxButton( itemDialog1, ID_ACTIVATE_WINDOW, _("Bring window to top"), wxDefaultPosition, wxDefaultSize, 0 );
111  itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
112 
113  wxButton* itemButton6 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
114  itemBoxSizer4->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
115 
116 ////@end CExclusiveEditDlg content construction
117 
118  if (m_ExclusiveEdit) {
119  wxString title = m_ExclusiveEdit->GetLabel();
120  wxString format = m_TextCtrl->GetLabel();
122  }
123 }
124 
126 {
127  return true;
128 }
129 wxBitmap CExclusiveEditDlg::GetBitmapResource( const wxString& name )
130 {
131  // Bitmap retrieval
132 ////@begin CExclusiveEditDlg bitmap retrieval
133  wxUnusedVar(name);
134  return wxNullBitmap;
135 ////@end CExclusiveEditDlg bitmap retrieval
136 }
137 wxIcon CExclusiveEditDlg::GetIconResource( const wxString& name )
138 {
139  // Icon retrieval
140 ////@begin CExclusiveEditDlg icon retrieval
141  wxUnusedVar(name);
142  return wxNullIcon;
143 ////@end CExclusiveEditDlg icon retrieval
144 }
145 
146 void CExclusiveEditDlg::OnActivateWindowClick( wxCommandEvent& event )
147 {
148  if (m_ExclusiveEdit) {
149  m_ExclusiveEdit->Raise();
150  }
151  EndDialog(wxID_CANCEL);
152 }
153 
static bool ShowToolTips()
bool Create(wxWindow *parent, wxWindowID id=ID_CEXCLUSIVEEDITDLG, const wxString &caption=_("Exclusive Edit Access"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxIcon GetIconResource(const wxString &name)
void OnActivateWindowClick(wxCommandEvent &event)
wxStaticText * m_TextCtrl
wxBitmap GetBitmapResource(const wxString &name)
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#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
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
static Format format
Definition: njn_ioutil.cpp:53
Format
Definition: njn_ioutil.hpp:52
Modified on Sun Mar 03 03:12:43 2024 by modify_doxy.py rev. 669887