(
size_t i= 0;
i<
m_List.size();
i++) {
61 for(
size_t i= 0;
i< m_List.size();
i++) {
74 for(
size_t i= 0;
i<
m_List.size();
i++) {
82 m_All.push_back(item);
83 for(
size_t i= 0;
i< item->
m_List.size();
i++) {
92 for(
size_t i= 0;
i<
m_List.size();
i++) {
102 for(
size_t i= 0;
i< item->
m_List.size();
i++) {
111wxRendererNative&
rnd= wxRendererNative::GetDefault();
112wxSize cbSize =
rnd.GetCheckBoxSize(
this);
115 m_SB_width= wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
116wxPaintDC dc(
this);
119 m_MIN_height= wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y);
135 for(
size_t i= 0;
i< v.size();
i++) {
136 stringp = q.empty() ? v[
i] : q +
" "+ v[
i];
137 if(!q.empty() && dc.GetTextExtent(p).GetWidth() > width) {
156vector<string> v =
Split(item.
GetText(), dc, width - x);
164wxClientDC dc(
this);
165 const intheight = GetClientSize().GetY();
166 intwidth = GetClientSize().GetX();
189wxPaintDC dc(
this);
201wxRendererNative&
rnd= wxRendererNative::GetDefault();
205 const intwidth = GetClientSize().GetX();
206 const intheight = GetClientSize().GetY();
207 for(
size_t i= 0;
i<
m_Visible.size() && yy < height; yy += h,
i++) {
212vector<string> v =
Split(item.
GetText(), dc, width - x);
219dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
220wxBrush brush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
222dc.DrawRectangle(0, yy, width, h);
225dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
229 if(item.
m_List.size()) {
244 for(
auto& s : v) {
245dc.DrawText(s, x, y);
254wxPen pen(highlited ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) : wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
257 intx0 = rect.GetLeft() + 1;
258 intx1 = rect.GetRight() - 1;
259 intxm = (x0 + x1) / 2;
260 inty0 = rect.GetTop() + (rect.GetHeight() + 2) / 4;
261 inty1 = y0 + rect.GetHeight() / 2;
262dc.DrawLine(x0, y0, x1, y0);
263dc.DrawLine(x1, y0, xm, y1);
264dc.DrawLine(xm, y1, x0, y0);
267 intx0 = rect.GetLeft() + (rect.GetWidth() + 2) / 4;
268 intx1 = x0 + rect.GetWidth() / 2;
269 inty0 = rect.GetTop() + 1;
270 inty1 = rect.GetBottom() - 1;
271 intym = (y0 + y1) / 2;
272dc.DrawLine(x0, y0, x1, ym);
273dc.DrawLine(x1, ym, x0, y1);
274dc.DrawLine(x0, y1, x0, y0);
291wxClientDC dc(
this);
296 const intwidth = GetClientSize().GetX();
297 const intheight = GetClientSize().GetY();
300 for(
size_t i= 0;
i<
m_Visible.size() && yy < height; yy += h,
i++) {
303 if(y < yy || y >= yy + h) {
308 if(x >= cx && x < cx + m_CB_width && y >= cy && y < cy +
m_CB_height) {
321wxCommandEvent e(wxEVT_LISTBOX,
GetId());
322e.SetEventObject(GetParent());
330wxCommandEvent e(wxEVT_LISTBOX_DCLICK,
GetId());
331e.SetEventObject(GetParent());
358 for(
auto& it : item->
m_List) {
374 for(
auto& it : item->
m_List) {
375 if(!it->m_Checked) {
386 const intheight = GetClientSize().GetY();
388 if(fullheight <= height) {
392SetScrollbar(wxVERTICAL, 0, 0, 0);
396 if(
m_Start+ height > fullheight) {
403SetScrollbar(wxVERTICAL,
m_Start, height, fullheight);
410 constwxEventType&
type= evt.GetEventType();
411 const intheight = GetClientSize().GetY();
412 if(
type== wxEVT_SCROLLWIN_TOP) {
416 else if(
type== wxEVT_SCROLLWIN_BOTTOM) {
420 else if(
type== wxEVT_SCROLLWIN_LINEUP) {
424 else if(
type== wxEVT_SCROLLWIN_LINEDOWN) {
428 else if(
type== wxEVT_SCROLLWIN_PAGEUP) {
432 else if(
type== wxEVT_SCROLLWIN_PAGEDOWN) {
436 else if(
type== wxEVT_SCROLLWIN_THUMBTRACK ||
type== wxEVT_SCROLLWIN_THUMBRELEASE) {
437 if(evt.GetPosition() >= 0) {
447 int delta= evt.GetWheelDelta();
vector< CCustomTreeItem * > m_List
virtual string GetText() const =0
CCustomTreeItem * m_Parent
virtual ~CCustomTreeItem()
void OnSetFocus(wxFocusEvent &evt)
void PropagateCheck(CCustomTreeItem *item, bool check)
void OnKillFocus(wxFocusEvent &evt)
void OnPaint(wxPaintEvent &evt)
void SetCurrentItem(CCustomTreeItem *p)
vector< CCustomTreeItem * > m_All
void OnDblClick(wxMouseEvent &evt)
void OnClick(wxMouseEvent &evt)
void OnSize(wxSizeEvent &evt)
void DrawExpander(wxDC &dc, wxRect &rect, bool open, bool highlited)
void CheckParent(CCustomTreeItem *item, bool check)
void OnWheel(wxMouseEvent &evt)
static vector< string > Split(string str, wxDC &dc, int width)
void OnScroll(wxScrollWinEvent &evt)
void ExpandItem(CCustomTreeItem *item, bool expand)
CCustomTreeItem * m_Current
int ItemHeight(const CCustomTreeItem &item, wxDC &dc, int width)
vector< CCustomTreeItem * > m_List
vector< CCustomTreeItem * > m_Visible
void CheckItem(CCustomTreeItem *item, bool check, bool propagate=true)
static const char * str(char *buf, int n)
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,...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static size_t rnd(size_t minimal, size_t maximal)
Int4 delta(size_t dimension_, const Int4 *score_)
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