A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/map__item_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/wx/map_item.cpp Source File

42 #if defined(NCBI_OS_DARWIN) 66

m_Separator(separator),

116

i_width =

m_Icon

.GetWidth();

117

i_height =

m_Icon

.GetHeight();

120  catch

(std::exception&)

122  _TRACE

(

"CMapItem::Layout - unable to determine icon size (platform has no support)"

);

143  int

icon_off_y = center ? ((h1 - i_height) / 2) : 0;

150  int

label_off_y = center ? ((h1 -

m_LabelPrefH

) / 2) : 0;

151

wxRect rc_text(x, y + label_off_y, 0, rc_back.height);

152

rc_text.SetRight(rc_back.GetRight());

200

pref_h =

max

(icon_h, text_h);

221

dc.SetFont(props.

m_Font

);

223

vector<int> line_lens;

226

label_h = (

int

)(line_lens.size() *

abs

(props.

m_Font

.GetPixelSize().y));

242  int

text_bottom = rc.GetBottom() - props.

m_VertMargin

;;

244  int

d_h =

abs

(dc.GetFont().GetPixelSize().y);

248

vector<int> line_lens;

251  int

max_lines =

max

(0, rc.GetHeight() / d_h);

252

max_lines =

min

(max_lines, (

int

) line_lens.size());

255  bool

text_truncated = (max_lines < (

int

) line_lens.size());

257  for

(

int i

= 0;

i

< max_lines && y + d_h < text_bottom;

i

++ ) {

258  int len

= line_lens[

i

];

259  const char

* line_s =

text

.c_str() + pos;

261  bool

last_line = (y + 2 * d_h > text_bottom);

263  if

(text_truncated && last_line) {

269

wxSize

size

= dc.GetTextExtent(wx_text);

313

wxRect rc_sep(rc_back);

329

dc.SetPen(*wxTRANSPARENT_PEN);

333

dc.DrawRectangle(rc_sel.x, rc_sel.y, rc_sel.width, rc_sel.height);

336

dc.SetFont(props.

m_Font

);

345  const

wxBrush& old_brush = dc.GetBrush();

346

wxBrush brush(props.

m_TextColor

, wxBRUSHSTYLE_STIPPLE);

349

dc.SetBrush(old_brush);

356 #if defined(NCBI_OS_DARWIN) & 0 367

dc.DrawRectangle( rc.x, rc.y, rc.width, rc.height );

375

wxPen pen(sep_color);

383

dc.DrawLine(left, y_line, right, y_line);

385

dc.DrawLine(left, y_line, right, y_line);

387

dc.DrawLine(left, y_line, right, y_line);

395  int

x = rc.GetLeft() + x_off;

397  int

text_bottom = rc.GetBottom() - props.

m_VertMargin

;

399  int

d_h =

abs

(dc.GetFont().GetPixelSize().y);

401  int

w = rc.GetWidth()- 2 * x_off;

404

vector<int> line_lens;

407  int

max_lines =

max

(0, rc.GetHeight() / d_h);

408

max_lines =

min

(max_lines, (

int

) line_lens.size());

412  if

(selected && focused)

414  else if

(highlighted) {

419

dc.SetTextForeground(color_text);

422  bool

text_truncated = (max_lines < (

int

) line_lens.size());

424  for

(

int i

= 0;

i

< max_lines && y + d_h < text_bottom;

i

++ ) {

425  int len

= line_lens[

i

];

426  const char

* line_s =

text

.c_str() + pos;

428  bool

last_line = (y + 2 * d_h > text_bottom);

430  if

(text_truncated && last_line) {

433

dc.DrawText(wx_s, x, y);

437

dc.GetTextExtent(wx_s, &w, &h);

438

dc.DrawLine(x, y + h - 1, x + w - 1, y + h - 1);

446

dc.SetPen(*wxTRANSPARENT_PEN);

virtual void SetCommand(TCmdID cmd, wxEvtHandler *target)

enables sending commands on default action; set target to NULL to disable

void SetIcon(wxBitmap &image)

virtual void Layout(wxDC &dc, SwxMapItemProperties &props)

virtual bool IsGroupSeparator() const

virtual int x_PreferredSeparatorHeight(wxDC &dc) const

virtual int PreferredHeight(wxDC &dc, SwxMapItemProperties &props, int width)

virtual void x_DrawFocusRect(wxDC &dc, const wxRect &rc, int state, SwxMapItemProperties &props)

virtual void x_DrawText(wxDC &dc, const string &text, const wxRect &rc, bool selected, bool focused, bool highlighted, SwxMapItemProperties &props)

virtual void GetRect(wxRect &rc) const

virtual void x_DrawBackground(wxDC &dc, const wxRect &rc, int state, SwxMapItemProperties &props)

virtual int x_PreferredLabelHeight(wxDC &dc, SwxMapItemProperties &props, int text_w) const

virtual void Draw(wxDC &dc, int state, SwxMapItemProperties &props)

Draws item in the given rectangle, state is a combination of EItemState flags.

virtual void OnDefaultAction()

a callback to perform a default action associated with the item

wxEvtHandler * m_CmdTarget

virtual int x_GetItemShift() const

virtual void x_UpdatePreferredHeights(wxDC &dc, SwxMapItemProperties &props, int width)

virtual void SetRect(const wxRect &rc)

virtual int x_CalculateRealTextWidth(wxDC &dc, SwxMapItemProperties &props)

virtual void x_DrawSeparator(wxDC &dc, const wxRect &rc, SwxMapItemProperties &props)

virtual int x_GetTextAreaWidth(SwxMapItemProperties &props, int width) const

GUI command routing and handling framework.

Include a standard set of the NCBI C++ Toolkit most basic headers.

@ eCmdInvalid

marks menu end in array initializers

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static const char label[]

unsigned int

A callback function used to compare two keys in a database.

static const int kSepHorzOffset

static const int kDefIconWidth

static const int kSeparatorH

static const int kSepVertOffset

static const int kDefIconHeight

static void text(MDB_val *v)

const struct ncbi::grid::netcache::search::fields::SIZE size

SwxMapItemProperties - properties of the IwxMapItem.

bool m_CenterLabelAndIcon

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,...

@ ewxTruncate_EllipsisAlways

truncate text if needed, add "..." if truncated

void WrapText(wxDC &dc, const string &text, int w, vector< int > &line_lens)

divides given "text" into lines, so that every line has width less or equal to "w".

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