icons_registered =
false;
56 if( ! icons_registered) {
59 wxT(
"arrow_open.png"));
61 wxT(
"arrow_close.png"));
62icons_registered =
true;
65 m_OpenIcon= wxArtProvider::GetBitmap(
wxT(
"map::arrow_open"));
84it_props.
m_BackColor= wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
85it_props.
m_TextColor= wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
89wxBoxSizer* sizer =
newwxBoxSizer(wxHORIZONTAL);
106 for(
size_t i= 0;
i< groups.size();
i++ ) {
111 for(
size_tj = 0; j < items.size(); j++ ) {
149 strings =
"Group \""+
label+
"\" already exist";
158 const string& icon_alias,
const string& descr,
boolshowDefault)
165wxBitmap icon = wxArtProvider::GetBitmap(
ToWxString(icon_alias));
182 strings =
"Group \""+ group_label +
"\" does not exist.";
204 strings =
"Group \""+ group +
"\" does not exist.";
252curItem.
Reset(grp_item);
298 for(
size_t i= 0;
i< v_items.size();
i++ ) {
314wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
GetId());
315 event.SetEventObject(
this);
318(void)GetEventHandler()->ProcessEvent(event);
323wxClientDC dc(
this);
327 for(
size_tj = 0; j < group.m_Items.size(); ++j) {
331 if(pitem == &item) {
361 const string& descr,
373m_ClickOnSpace(
false)
394 if(m_DefaultState == eDefaultNo) {
395descr =
"Click to make '"+
GetLabel() +
"' default view.\n";
396descr +=
"This view will be opened on double click on The Project View '"+
397m_Widget.GetInputCategory() +
"' object.";
399 else if(m_DefaultState == eDefaultYes) {
400descr =
"Click to clear default view.\n";
401descr +=
"Double click on The Project View '"+ m_Widget.GetInputCategory() +
402 "' object will open this dialog.";
421pref_h = m_Icon.GetHeight();
424 intlabel_h = x_PreferredLabelHeight(dc, props, width);
426pref_h =
max(pref_h, label_h);
427 if(IsGroupSeparator()) {
433pref_h += x_PreferredSeparatorHeight(dc);
441 returnIsGroupSeparator() ? 0 : 12;
451wxFont font = props.
m_Font;
452font.SetWeight(wxFONTWEIGHT_NORMAL);
455m_LabelRealW = x_CalculateRealTextWidth(dc, props);
457 if(m_DefaultState != eDefaultHide) {
458 const char* defText =
470wxRect rc_back(m_Rect);
477x_DrawBackground(dc, rc_back,
state, props);
483dc.DrawBitmap(m_Icon, m_IconPos.x, m_IconPos.y,
true);
486 if( ! m_Label.empty() && m_LabelRect.width > 0 && m_LabelRect.height > 0) {
489 if(IsGroupSeparator()) {
490dc.SetFont(props.
m_Font);
493wxFont font = props.
m_Font;
494font.SetWeight(wxFONTWEIGHT_NORMAL);
498x_DrawText(dc, m_Label, m_LabelRect, selected, widget_focused, m_HotLabel, props);
500 if(m_DefaultState != eDefaultHide && m_DefWidth > 0) {
501 const char* defText =
503wxRect defRect(m_LabelRect);
504defRect.SetX(defRect.GetRight() - m_DefWidth);
506wxFont font = props.
m_Font;
507font.SetWeight(wxFONTWEIGHT_NORMAL);
509x_DrawText(dc, defText, defRect, selected, widget_focused, m_HotDef, props);
537wxBrush brush(cl_back);
539dc.DrawRectangle(rc.x, rc.y, rc.width, rc.height);
545 if(IsGroupSeparator()) {
546m_Widget.x_OnToggleGroup(*
this);
548m_Widget.x_OnSelectItem(*
this);
555 if(IsGroupSeparator())
560wxRect rc(m_LabelRect);
561rc.width = m_LabelRealW;
562m_HotLabel = rc.Contains(ms_pos);
566 if(!m_HotLabel && m_DefaultState != eDefaultHide && m_DefWidth > 0) {
567wxRect defRect(m_LabelRect);
568defRect.SetX(defRect.GetRight() - m_DefWidth);
569m_HotDef = defRect.Contains(ms_pos);
572 returnm_HotLabel || m_HotDef;
577m_ClickOnSpace = !m_HotLabel && !m_HotDef;
579 if(IsGroupSeparator() || m_HotLabel) {
583m_Widget.x_OnMakeDefaultItem(*
this);
589 if(!m_HotDef && !IsGroupSeparator() && m_ClickOnSpace)
CMapControl owns all its items.
virtual void AddItem(IwxMapItem *item)
virtual void DeleteAllItems()
@ eAdjustVertSize
widget adjusts its model space so that its vertical size fits into available viewport
SProperties & GetProperties()
virtual void InsertItem(TIndex index, IwxMapItem *item)
virtual void LockUpdates(bool lock=true)
block layout and repainting until control is unlocked
virtual TIndex GetSelectedIndex() const
virtual TItemRef GetItem(TIndex index)
virtual TIndex GetItemsCount() const
TIndex GetHotIndex() const
virtual SwxMapItemProperties & GetMapItemProperties()
virtual TIndex GetItemIndex(IwxMapItem &item) const
virtual void DeleteItem(TIndex index)
CMapItem This is a base class for IwxMapItem implementations.
void SetIcon(wxBitmap &image)
virtual void Layout(wxDC &dc, SwxMapItemProperties &props)
virtual bool IsGroupSeparator() const
const string & GetLabel() const
virtual void SelectItem(TIndex index, bool select=true)
virtual void SetStyle(int style)
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
string GetLabel(const CSeq_id &id)
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
const struct ncbi::grid::netcache::search::fields::SIZE size
int m_ItemOffsetY
horz space between an item and separation line or border
int m_ItemOffsetX
vertical space between separation lines and the borders
bool m_SeparateGroups
vert space around an item
int m_SepLineWidth
max item height
SwxMapItemProperties - properties of the IwxMapItem.
wxFileArtProvider * GetDefaultFileArtProvider()
wxString ToWxString(const string &s)
wxColour GetAverage(const wxColor &c1, const wxColor &c2, double ratio)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4