45 #include <wx/dcbuffer.h>
46 #include <wx/settings.h>
77 : TParent(parent,
wxID_ANY, wxDefaultPosition, wxDefaultSize, 0,
_("min_panel_container")),
78 m_DockManager(manager),
82 SetBackgroundStyle(wxBG_STYLE_CUSTOM);
84 m_Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
102 panel.Reparent(
this);
104 InvalidateBestSize();
107 GetParent()->Layout();
129 InvalidateBestSize();
132 GetParent()->Layout();
160 const SItem* item = *it;
172 if(item->
m_Rect.Contains(pt))
194 wxRect
bounds = GetRect();
205 for(
size_t i = 0;
i <
m_Items.size();
i++ ) {
211 if(right >
bounds.GetRight() && ! new_row) {
241 string alias =
client->GetIconAlias();
251 dc.GetTextExtent(
label, &w, &h);
274 wxRect rc = GetRect();
276 wxAutoBufferedPaintDC dc(
this);
279 wxColour back_cl = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
280 wxBrush brush(back_cl);
282 dc.SetPen(*wxTRANSPARENT_PEN);
283 dc.DrawRectangle(0, 0, rc.width, rc.height);
286 for(
size_t i = 0;
i <
m_Items.size();
i++ ) {
298 wxColor cl_text = wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW);
299 wxColor cl_line = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW);
300 wxColour back_cl = wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT);
302 wxBrush brush(back_cl);
307 dc.DrawRoundedRectangle(rc.x, rc.y, rc.width, rc.height, 3);
312 string alias =
client->GetIconAlias();
316 int pos_y = rc.y + (rc.height -
bmp.GetHeight()) / 2;
317 dc.DrawBitmap(
bmp, pos_x, pos_y);
330 dc.GetTextExtent(s, &w, &h);
331 int pos_y = rc.y + (rc.height - h) / 2;
333 dc.SetTextForeground(cl_text);
334 dc.DrawText(s, pos_x, pos_y);
340 wxPoint pt =
event.GetPosition();
352 static const size_t kMaxLabelChars = 40;
355 unique_ptr<wxMenu> menu;
359 wxPoint sc_pt =
event.GetPosition();
360 wxPoint pt = ScreenToClient(sc_pt);
370 menu.reset(
new wxMenu());
379 if(
label.size() > kMaxLabelChars) {
385 menu->Append(
cmd, wxs);
391 menu->AppendSeparator();
398 PopupMenu(menu.get());
413 int cmd =
event.GetId();
CDockManager CDockManager sends requests to Window Manager, Window Manager makes decisions about dele...
bool OnDockPanelCommand(CDockPanel &panel, TCmdID cmd)
CWindowManager & GetWindowManager()
wxMenu * GetDockPanelMenu(CDockPanel &panel)
CDockPanel - a container with a title bar (caption) hosting a single client window (IWMClient).
void OnSize(wxSizeEvent &event)
void RemoveClient(CDockPanel &panel)
bool HasClient(CDockPanel &panel) const
void OnLeftClick(wxMouseEvent &event)
CDockManager & m_DockManager
void AddClient(CDockPanel &panel)
void OnContextMenu(wxContextMenuEvent &event)
SItem * x_FindItemByPos(const wxPoint &pt)
void OnDockPanelCommand(wxCommandEvent &event)
void OnPaint(wxPaintEvent &event)
const SItem * x_FindItemByPanel(CDockPanel *panel) const
void OnRestoreWindow(wxCommandEvent &event)
wxSize x_MeasureItem(wxDC &dc, const SItem &descr)
void OnShowWindowsDlg(wxCommandEvent &event)
void OnUpdateWindowCommand(wxUpdateUIEvent &event)
virtual wxSize DoGetBestSize() const
map< int, CDockPanel * > m_CmdToPanel
panel for which context menu is shown
virtual ~CMinPanelContainer()
void x_DrawItem(wxDC &dc, SItem &descr)
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
wxMenuItem * AppendMenuItem(wxMenu &menu, TCmdID cmd_id) const
void OnShowWindowsDlg(wxCommandEvent &event)
void OnUpdateWindowCommand_Client(wxUpdateUIEvent &event, IWMClient *client)
IWClient - abstract Window Manager client.
const_iterator end() const
const_iterator find(const key_type &key) const
static const char * bounds[]
thread_local unique_ptr< FtaMsgPost > bmp
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
static const int kLabelOffsetY
static const int kRestoreWindowFirst
CMinPanelContainer.
EVT_MENU_RANGE(eCmdCloseDockPanel, eCmdWindowRestore, CMinPanelContainer::OnDockPanelCommand) EVT_MENU_RANGE(kRestoreWindowFirst
CMinPanelContainer::OnRestoreWindow EVT_UPDATE_UI_RANGE(eCmdCloseDockPanel, eCmdWindowRestore, CMinPanelContainer::OnUpdateWindowCommand) CMinPanelContainer
static const int kRestoreWindowLast
static const int kOffsetX
static const int kLabelOffsetX
static const int kIconOffX
static const int kOffsetY
static const int kIconOffY
const struct ncbi::grid::netcache::search::fields::SIZE size
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static CNamedPipeClient * client
wxString ToWxString(const string &s)
wxString TruncateText(wxDC &dc, const wxString &s, int w, Ewx_Truncate trunc=ewxTruncate_Ellipsis)
truncates given string so that its length is less or equal "w" "trunc" controls truncation,...