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/gradient__color__panel_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/aln_score/gradient_color_panel.cpp Source File

39 #include <wx/statbox.h> 40 #include <wx/dcclient.h> 41 #include <wx/slider.h> 42 #include <wx/window.h> 46 #define ID_STEPS_TXT 10000 47 #define ID_SLIDER 10001 48 #define ID_COLOR_PICK1 10002 49 #define ID_COLOR_PICK2 10003 50 #define ID_COLOR_PICK3 10004 51 #define ID_SWAP_COLORS 10005 52 #define ID_GRAD_WINDOW 10006 66

: m_Params(params), m_ItemStepsTxt(), m_GradWindow()

74

wxBoxSizer* itemBoxSizer1 =

new

wxBoxSizer(wxVERTICAL);

75

this->SetSizer(itemBoxSizer1);

77

wxStaticBox* itemStaticBox =

new

wxStaticBox(

this

, wxID_STATIC,

_

(

""

));

78

wxStaticBoxSizer* itemStaticBoxSizer =

new

wxStaticBoxSizer(itemStaticBox, wxVERTICAL);

79

itemBoxSizer1->Add(itemStaticBoxSizer, 0, wxGROW|wxALL, 0);

81

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxHORIZONTAL);

82

itemStaticBoxSizer->Add(itemBoxSizer2, 0, wxGROW|wxALL, 5);

84  m_ItemStepsTxt

=

new

wxStaticText(

this

,

ID_STEPS_TXT

,

_

(

"999"

), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL);

87

wxSlider* itemSlider =

new

wxSlider(

this

,

ID_SLIDER

, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSUNKEN_BORDER );

88

itemBoxSizer2->Add(itemSlider, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);

91

itemStaticBoxSizer->Add(

m_GradWindow

, 0, wxGROW|wxALL, 5);

93

wxBoxSizer* itemBoxSizer3 =

new

wxBoxSizer(wxHORIZONTAL);

94

itemStaticBoxSizer->Add(itemBoxSizer3, 0, wxGROW|wxALL, 0);

96

wxBoxSizer* itemBoxSizer4 =

new

wxBoxSizer(wxHORIZONTAL);

97

wxBoxSizer* itemBoxSizer5 =

new

wxBoxSizer(wxHORIZONTAL);

99

itemBoxSizer3->Add(itemBoxSizer4, 1, wxGROW|wxALL, 5);

101

wxColourPickerCtrl* itemColorPicker1 =

new

wxColourPickerCtrl(

this

,

ID_COLOR_PICK1

);

103

itemBoxSizer4->Add(itemColorPicker1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

107

itemBoxSizer4->Add(itemStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

111

wxColourPickerCtrl* itemColorPicker2 =

new

wxColourPickerCtrl(

this

,

ID_COLOR_PICK2

);

113

itemBoxSizer3->Add(itemColorPicker2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

117

itemBoxSizer5->Add(itemStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

122

wxButton* itemButton =

new

wxButton(

this

,

ID_SWAP_COLORS

,

_

(

"Swap Colors"

));

124

itemStaticBoxSizer->Add(itemButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

126

itemBoxSizer3->Add(itemButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

129

itemBoxSizer5->Add(

new

wxBoxSizer(wxHORIZONTAL), 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

133

itemBoxSizer5->Add(itemStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

136

wxColourPickerCtrl* itemColorPicker3 =

new

wxColourPickerCtrl(

this

,

ID_COLOR_PICK3

);

138

itemBoxSizer5->Add(itemColorPicker3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

140

itemBoxSizer3->Add(itemBoxSizer5, 1, wxGROW|wxALL, 5);

146  if

((steps & 0x1) == 0) {

149

<<

"number of colors in gradient is even - make it odd."

);

151

itemSlider->SetLineSize(2);

155

itemSlider->SetLineSize(1);

158

itemSlider->SetValue(steps);

161  str

.Printf(

_

(

"%d"

), steps);

185

TransferDataToWindow();

193

TransferDataFromWindow();

207

dc.SetPen(*wxTRANSPARENT_PEN);

209  int

left = 0, top = 0, width, height;

213  double

d = ((double) width) /

n

;

218  for

(

int i

= 0;

i

< n1 ;

i

++) {

219  int

x1 = (

int

) floor(d *

i

);

220  int

x2 = (

int

) ceil(d * (

i

+ 1));

221  float

k = ((float)

i

) / (n1 - 1);

225

wxBrush brush(wxColor(

color

.GetRedUC(),

228  color

.GetAlphaUC()));

230

dc.DrawRectangle(left + x1, top, x2 - x1, height);

233  for

(

int i

= n1;

i

<

n

;

i

++) {

234  int

x1 = (

int

) floor(d *

i

);

235  int

x2 = (

int

) ceil(d * (

i

+ 1));

236  float

k = ((float)

i

- n1 + 1) / (

n

- n1);

240

wxBrush brush(wxColor(

color

.GetRedUC(),

243  color

.GetAlphaUC()));

246

dc.DrawRectangle(left + x1, top, x2 - x1, height);

250  for

(

int i

= 0;

i

<

n

;

i

++) {

251  int

x1 = (

int

) floor(d *

i

);

252  int

x2 = (

int

) ceil(d * (

i

+ 1));

253  float

k = ((float)

i

) / (

n

- 1);

257

wxBrush brush(wxColor(

color

.GetRedUC(),

260  color

.GetAlphaUC()));

263

dc.DrawRectangle(left + x1, top, x2 - x1, height);

wxStaticText * m_ItemStepsTxt

void GetParams(stParams &params) const

void OnPaint(wxPaintEvent &event)

void OnSliderUpdated(wxCommandEvent &event)

void OnSwapClick(wxCommandEvent &event)

void OnColourPickChanged(wxColourPickerEvent &event)

class CRgbaColor provides a simple abstraction for managing colors.

static const char * str(char *buf, int n)

static const int kMaxGradColors

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void Warning(CExceptionArgs_Base &args)

static CRgbaColor Interpolate(const CRgbaColor &color1, const CRgbaColor &color2, float alpha)

Interpolate two colors.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

unsigned int

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

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