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

Go to the SVN repository for this file.

1 /* $Id: unaligned_region_dlg.cpp 36270 2016-09-02 19:17:13Z evgeniev $
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: Vladislav Evgeniev
27  *
28  * File Description: Dialog, displaying unaligned regions.
29  *
30  */
31 
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbidbg.hpp>
35 
36 ////@begin includes
37 ////@end includes
38 
39 #include "unaligned_region_dlg.hpp"
40 
41 ////@begin XPM images
42 ////@end XPM images
43 
45 
46 /*!
47  * CUnalignedRegionDlg type definition
48  */
49 
50 IMPLEMENT_DYNAMIC_CLASS( CUnalignedRegionDlg, wxDialog )
51 
52 
53 /*!
54  * CUnalignedRegionDlg event table definition
55  */
56 
57 BEGIN_EVENT_TABLE( CUnalignedRegionDlg, wxDialog )
58 
59 ////@begin CUnalignedRegionDlg event table entries
60 ////@end CUnalignedRegionDlg event table entries
61 
63 
64 
65 /*!
66  * CUnalignedRegionDlg constructors
67  */
68 
70 {
71  Init();
72 }
73 
74 CUnalignedRegionDlg::CUnalignedRegionDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
75 {
76  Init();
77  Create(parent, id, caption, pos, size, style);
78 }
79 
80 
81 /*!
82  * CUnalignedRegionDlg creator
83  */
84 
85 bool CUnalignedRegionDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
86 {
87 ////@begin CUnalignedRegionDlg creation
88  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
89  wxDialog::Create( parent, id, caption, pos, size, style );
90 
92  if (GetSizer())
93  {
94  GetSizer()->SetSizeHints(this);
95  }
96  Centre();
97 ////@end CUnalignedRegionDlg creation
98  return true;
99 }
100 
101 
102 /*!
103  * CUnalignedRegionDlg destructor
104  */
105 
107 {
108 ////@begin CUnalignedRegionDlg destruction
109 ////@end CUnalignedRegionDlg destruction
110 }
111 
112 
113 /*!
114  * Member initialisation
115  */
116 
118 {
119 ////@begin CUnalignedRegionDlg member initialisation
121 ////@end CUnalignedRegionDlg member initialisation
122 }
123 
124 
125 /*!
126  * Control creation for CUnalignedRegionDlg
127  */
128 
130 {
131 ////@begin CUnalignedRegionDlg content construction
132  CUnalignedRegionDlg* itemDialog1 = this;
133 
134  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
135  itemDialog1->SetSizer(itemBoxSizer2);
136 
137  m_SequenceTextCtrl = new wxRichTextCtrl( itemDialog1, ID_SEQUENCE_RICHTEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(400, 300), wxTE_READONLY|wxWANTS_CHARS );
138  itemBoxSizer2->Add(m_SequenceTextCtrl, 1, wxGROW|wxALL, 5);
139 
140  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
141  itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
142 
143  wxButton* itemButton5 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
144  itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
145 
146 ////@end CUnalignedRegionDlg content construction
147 }
148 
150 {
152 
153  m_SequenceTextCtrl->BeginStyle(m_SequenceTextCtrl->GetDefaultStyle());
154  m_SequenceTextCtrl->WriteText(text);
155  m_SequenceTextCtrl->EndStyle();
156 }
157 
159 {
161 
162  wxTextAttr unalignedStyle (m_SequenceTextCtrl->GetDefaultStyle());
163  wxColor color(196, 135, 147); // HTML pink3
164  unalignedStyle.SetBackgroundColour(color);
165 
166  m_SequenceTextCtrl->BeginStyle(unalignedStyle);
167  m_SequenceTextCtrl->WriteText(text);
168  m_SequenceTextCtrl->EndStyle();
169 }
170 
171 /*!
172  * Should we show tooltips?
173  */
174 
176 {
177  return true;
178 }
179 
180 /*!
181  * Get bitmap resources
182  */
183 
184 wxBitmap CUnalignedRegionDlg::GetBitmapResource( const wxString& name )
185 {
186  // Bitmap retrieval
187 ////@begin CUnalignedRegionDlg bitmap retrieval
188  wxUnusedVar(name);
189  return wxNullBitmap;
190 ////@end CUnalignedRegionDlg bitmap retrieval
191 }
192 
193 /*!
194  * Get icon resources
195  */
196 
197 wxIcon CUnalignedRegionDlg::GetIconResource( const wxString& name )
198 {
199  // Icon retrieval
200 ////@begin CUnalignedRegionDlg icon retrieval
201  wxUnusedVar(name);
202  return wxNullIcon;
203 ////@end CUnalignedRegionDlg icon retrieval
204 }
205 
bool Create(wxWindow *parent, wxWindowID id=10000, const wxString &caption=_("Unaligned Region"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxBitmap GetBitmapResource(const wxString &name)
wxIcon GetIconResource(const wxString &name)
void CreateControls()
Creates the controls and sizers.
wxRichTextCtrl * m_SequenceTextCtrl
void WriteNormalText(const wxString &text)
static bool ShowToolTips()
Should we show tooltips?
void WriteRedText(const wxString &text)
CUnalignedRegionDlg()
Constructors.
void Init()
Initialises member variables.
#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
n background color
END_EVENT_TABLE()
static void text(MDB_val *v)
Definition: mdb_dump.c:62
const struct ncbi::grid::netcache::search::fields::SIZE size
NCBI C++ auxiliary debug macros.
#define _ASSERT
#define ID_SEQUENCE_RICHTEXTCTRL
Modified on Sun May 19 04:40:08 2024 by modify_doxy.py rev. 669887