wxFont s_DesktopFont(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
false,
wxT(
"Consolas"));
46: m_Pos(wxPoint(0, 0)), m_TextHeight(0), m_Origin(wxPoint(20, 20)),
47m_Item(item), m_Show(
false), m_ExpandLevel(0), m_Indent(33), m_Selected(
false)
67wxRect rect(
m_Pos, wxSize(
m_Size.GetWidth(), height));
69dc.DrawRectangle(rect);
71dc.DrawLabel(
m_CurrentText, rect, wxALIGN_TOP | wxALIGN_LEFT);
74dc.SetPen(*wxWHITE_PEN);
75dc.SetBrush(*wxTRANSPARENT_BRUSH);
79dc.SetPen(wxPen(*wxBLACK, 2));
80dc.SetBrush(*wxTRANSPARENT_BRUSH);
87wxRect(rect.GetPosition(),
88wxSize(rect.GetSize().GetWidth(), rect.GetSize().GetHeight() + 1)));
106 for(
auto& it :
m_Text) {
120 m_Size= textSize + wxSize(20, 5);
125wxCoord width, height;
126dc.GetMultiLineTextExtent(
text, &width, &height,
NULL, &s_DesktopFont);
127 returnwxSize(width, height);
170 for(
const auto& it :
m_Text) {
172 text.append(
"\n");
178 text.append(
"\n");
215 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
216|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
236 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
237|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
263 m_Size.y += it->GetSize().GetHeight();
264 intnew_width = it->GetSize().GetWidth() + (it->GetPosition().x -
m_Pos.x);
265 if(new_width >=
m_Size.x) {
266new_width = new_width + 2;
281 if(!it->Traverse(traverser))
307 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
308|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
310it->ShowTillBioseq(
value);
325 for(
const auto& it :
m_Text) {
327 text.append(
"\n");
333 text.append(
"\n");
351it->UpdatePositions(cumY,
depth+ 1);
382 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
383|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
385it->ShowTillBioseq(
true);
392 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
393|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
415it->ShowTillBioseq(
false);
420 if(it->GetType() == objects::CBioseq::GetTypeInfo()->GetName()
421|| it->GetType() == objects::CBioseq_set::GetTypeInfo()->GetName()) {
445 m_Size.y += it->GetSize().GetHeight();
459 if(it->GetType() == objects::CContact_info::GetTypeInfo()->GetName()
460|| it->GetType() == objects::CCit_sub::GetTypeInfo()->GetName()) {
466it->UpdatePositions(cumY,
depth);
479 for(
const auto& it :
m_Text) {
481 text.append(
"\n");
A desktop item with children.
virtual wxSize x_GetVisibleTextSize(wxDC &dc)
Determines the size of the text to be displayed corresponding to the current expansion level.
TDeskItemList m_ItemList
List of child items.
virtual void ShowTillBioseq(bool value)
CCompositeDesktopItem(CConstRef< IDesktopDataItem > item)
virtual void Add(IDesktopItem &)
virtual bool Traverse(IDesktopCompositeTraverser &traverser)
virtual int GetRelevantHeight() const
virtual void UpdatePositions(int *cumY, int depth=0)
virtual void UpdateSize()
virtual IDesktopItem * FindItem(const wxPoint &pt) const
void x_SetTextToDrawAndSize()
Sets the size of the rectangle based on the height and width of the displayed text.
virtual wxSize x_GetVisibleTextSize(wxDC &dc)=0
Determines the size of the text to be displayed corresponding to the current expansion level.
vector< string > m_Text
Text that appears in the rectangle.
int m_TextHeight
Height of the text within the rectangle.
wxColour m_FrameCol
Colour of rectangle's outline.
wxPoint m_Origin
Point where the drawing starts.
CConstRef< IDesktopDataItem > m_Item
Storing actual data.
virtual bool Traverse(IDesktopCompositeTraverser &traverser)
wxPoint m_Pos
Position of the item on the canvas.
virtual const string & GetType() const
virtual void Draw(wxDC &dc, bool highlight=false) const
virtual const CConstRef< CObject > GetAssociatedObject() const
wxColour m_TextCol
Foreground colour of the text.
bool m_Selected
Flag to indicate selection of this item.
CDesktopItem(CConstRef< IDesktopDataItem > item)
int m_Indent
Text indentation.
wxString m_CurrentText
Text that appears on the screen corresponding to the current level of expansion.
wxBrush m_BkgdBrush
Background colour of the rectangle.
int m_ExpandLevel
State(level) of expansion.
virtual bool FindSearchItem(const string &search, bool case_sensitive) const
wxSize m_Size
Size of the rectangle.
virtual bool Traverse(IDesktopCompositeTraverser &traverser)
wxSize m_OrigSize
Original size corresponding to 0 expansion level.
CRootDesktopItem(CConstRef< IDesktopDataItem > item)
virtual void UpdateSize()
virtual wxSize x_GetVisibleTextSize(wxDC &dc)
Determines the size of the text to be displayed corresponding to the current expansion level.
virtual void UpdatePositions(int *cumY, int depth=0)
virtual wxSize x_GetVisibleTextSize(wxDC &dc)
Determines the size of the text to be displayed corresponding to the current expansion level.
virtual IDesktopItem * FindItem(const wxPoint &pt) const
virtual void UpdateSize()
virtual int GetRelevantHeight() const
virtual void UpdatePositions(int *cumY, int depth=0)
CSimpleDesktopItem(CConstRef< IDesktopDataItem > item)
virtual const CObject * GetObject(void) const =0
virtual wxColour GetTextColor() const =0
virtual const wxBrush & GetBackgroundBrush() const =0
virtual const string & GetType() const
virtual TLines GetDescription(bool root=false) const =0
virtual wxColour GetFrameColor() const =0
virtual bool ShouldBeReduced() const
virtual IDesktopItem * FindItem(const wxPoint &pt) const =0
virtual wxRect GetRect() const
static unsigned char depth[2 *(256+1+29)+1]
static wxSize s_GetMultiLineSize(wxDC &dc, const wxString &text)
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
static bool Contains(const CSeq_loc &a, const CSeq_loc &b, CScope *scope)
wxString ToWxString(const string &s)
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