本文整理汇总了C++中SetScrollRate函数的典型用法代码示例。如果您正苦于以下问题:C++ SetScrollRate函数的具体用法?C++ SetScrollRate怎么用?C++ SetScrollRate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetScrollRate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSizer
void SelectDrawWidget::InsertSomeDraws(size_t start, size_t count) {
wxSizer *sizer = GetSizer();
int width = GetCheckBoxWidth();
ConfigNameHash& cnm = const_cast<ConfigNameHash&>(m_cfg->GetConfigTitles());
for (size_t i = start; count; count--, i++) {
if (i >= m_cb_l.size()) {
i = m_cb_l.size();
m_cb_l.push_back(new wxCheckBox());
m_cb_l[i]->Create(this, drawID_SELDRAWCB,
wxString::Format(_T("%d."), i + 1),
wxDefaultPosition, wxSize(width, -1), 0,
SelectDrawValidator(m_draws_wdg, i, m_cb_l[i]));
m_cb_l[i]->Enable(FALSE);
m_cb_l[i]->SetToolTip(wxEmptyString);
m_cb_l[i]->SetBackgroundColour(DRAW3_BG_COLOR);
sizer->Add(m_cb_l[i], 0, wxTOP | wxLEFT | wxRIGHT, 1);
}
Draw* draw = m_dc->GetDraw(i);
DrawInfo* draw_info = draw->GetDrawInfo();
wxString label;
if (draw_info->IsValid()) {
m_cb_l[i]->Enable(TRUE);
m_cb_l[i]->SetValue(draw->GetEnable());
m_cb_l[i]->SetToolTip(cnm[draw_info->GetBasePrefix()] + _T(":") + draw_info->GetParamName());
label = wxString::Format(_T("%d."), draw->GetInitialDrawNo() + 1) + draw_info->GetName();
if (draw_info->GetParam()->GetIPKParam()->GetPSC())
label += _T("*");
if (draw->GetBlocked())
label.Replace(wxString::Format(_T("%d."), draw->GetInitialDrawNo() + 1), wxString::Format(_("%d.[B]"), i + 1), false);
} else {
label = _T("***");
}
m_cb_l[i]->SetLabel(label);
wxValidator* validator = m_cb_l[i]->GetValidator();
if (validator)
dynamic_cast<SelectDrawValidator*>(validator)->Set(m_draws_wdg, i, m_cb_l[i]);
else
m_cb_l[i]->SetValidator(SelectDrawValidator(m_draws_wdg, i, m_cb_l[i]));
m_cb_l[i]->SetBackgroundColour(draw_info->GetDrawColor());
#ifdef MINGW32
m_cb_l[i]->Refresh();
#endif
}
if (m_cb_l.size() > MIN_DRAWS_COUNT)
SetScrollRate(10, 10);
else
SetScrollRate(0, 0);
sizer->Layout();
}
示例2: SetSize
void coreImageContrastWidgetUI::set_properties()
{
// begin wxGlade: coreImageContrastWidgetUI::set_properties
SetSize(wxSize(368, 134));
SetScrollRate(10, 10);
// end wxGlade
}
示例3: wxScrolledWindow
BitmapViewer::BitmapViewer(wxWindow *parent)
: wxScrolledWindow(parent,
wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxFULL_REPAINT_ON_RESIZE)
{
m_gutter = NULL;
m_zoom_factor = 1.0;
SetScrollRate(1, 1);
wxBitmap dummyBitmap(16, 16);
m_content = new wxStaticBitmap(this, wxID_ANY, dummyBitmap);
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(m_content, wxSizerFlags(1).Expand());
SetSizer(sizer);
// we need to bind mouse-down event to m_content, as this scrolled window
// will never see mouse events otherwise
m_content->Connect
(
wxEVT_LEFT_DOWN,
wxMouseEventHandler(BitmapViewer::OnMouseDown),
NULL,
this
);
}
示例4: wxT
void CScrolledTextBox::SetValue(const wxString& s) {
int lineHeight, totalLines, totalWidth, usableWidth;
wxString t = s;
// Delete sizer & its children (CTransparentStaticText objects)
m_TextSizer->Clear(true);
// Change all occurrences of "<sup>n</sup>" to "^n"
t.Replace(wxT("<sup>"), wxT("^"), true);
t.Replace(wxT("</sup>"), wxT(""), true);
t.Replace(wxT("<"), wxT("<"), true);
// First see if it fits without vertical scroll bar
totalWidth = GetSize().GetWidth();
totalLines = Wrap(t, totalWidth, &lineHeight);
m_TextSizer->FitInside(this);
usableWidth = GetClientSize().GetWidth();
if (usableWidth < totalWidth) {
// It has a vertical scroll bar, so wrap again for reduced width
m_TextSizer->Clear(true);
totalLines = Wrap(t, usableWidth - SCROLLBARSPACER, &lineHeight);
m_TextSizer->FitInside(this);
}
SetScrollRate(1, lineHeight);
}
示例5: SizeOfOneCell
void FieldBrowser::OnUpdate()
{
auto size_of_one = SizeOfOneCell();
SetVirtualSize(size_of_one.x, size_of_one.y * mDoc->GetNumSheets());
SetScrollRate(0, size_of_one.y / 5);
auto get_size = GetSize();
auto scrolled_top = CalcUnscrolledPosition({ 0, 0 });
auto scrolled_bottom = CalcUnscrolledPosition({ 0, get_size.y });
// figure out what the view of cells would be.
// let's print out where the current cell would be.
//
// if the upper part is above the view, move the view to contain it.
if (size_of_one.y * mDoc->GetCurrentSheetNum() < scrolled_top.y) {
Scroll(0, size_of_one.y * mDoc->GetCurrentSheetNum());
}
// if the lower part is below the view, move the view to contain it.
if ((size_of_one.y * (mDoc->GetCurrentSheetNum() + 1)) > scrolled_bottom.y) {
// we want to move to a place where the top amount we are over is the current top.
auto how_much_we_are_over = (size_of_one.y * (mDoc->GetCurrentSheetNum() + 1)) - scrolled_bottom.y;
Scroll(0, scrolled_top.y + how_much_we_are_over);
}
}
示例6: SetSize
void coreWorkingAreaManagerWidgetUI::set_properties()
{
// begin wxGlade: coreWorkingAreaManagerWidgetUI::set_properties
SetSize(wxSize(273, 279));
SetScrollRate(10, 10);
// end wxGlade
}
示例7: wxScrolledWindow
MainSinglePlayerTab::MainSinglePlayerTab( wxWindow* parent )
: wxScrolledWindow( parent, -1 )
{
m_main_sizer = new wxBoxSizer( wxVERTICAL );
GetAui().manager->AddPane( this, wxLEFT, _T( "mainsingleplayertab" ) );
m_tabs = new SLNotebook( this, _T( "mainsingleplayertab" ), -1, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TOP | wxAUI_NB_TAB_EXTERNAL_MOVE );
m_tabs->SetArtProvider( new wxAuiDefaultTabArt );
m_imagelist = new wxImageList( 12, 12 );
m_imagelist->Add( wxIcon( battle_xpm ) );
m_imagelist->Add( wxIcon( battle_settings_xpm ) );
m_sp_tab = new SinglePlayerTab( m_tabs, *this );
m_tabs->AddPage( m_sp_tab, _( "Game" ), true, wxNullBitmap );
m_mm_opts_tab = new BattleroomMMOptionsTab<SinglePlayerBattle>( &m_sp_tab->GetBattle(), m_tabs );
m_tabs->InsertPage( 1, m_mm_opts_tab, _( "Options" ), false, wxIcon( battle_settings_xpm ) );
m_opts_tab = new BattleOptionsTab( m_tabs, &m_sp_tab->GetBattle() );
m_tabs->InsertPage( 2, m_opts_tab, _( "Unit Restrictions" ), false, wxIcon( battle_settings_xpm ) );
m_main_sizer->Add( m_tabs, 1, wxEXPAND );
SetScrollRate( SCROLL_RATE, SCROLL_RATE );
SetSizer( m_main_sizer );
Layout();
}
示例8: wxScrolledWindow
VisualEditor::VisualEditor(wxWindow *parent)
:
wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxSUNKEN_BORDER),
m_stopSelectedEvent( false ),
m_stopModifiedEvent( false )
{
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
AppData()->AddHandler( this->GetEventHandler() );
#ifdef __WXMSW__
SetOwnBackgroundColour(wxColour(150,150,150));
#else
SetOwnBackgroundColour(wxColour(192,192,192));
#endif
SetScrollRate(5, 5);
m_back = new DesignerWindow( this, wxID_ANY, wxPoint(10,10) );
m_back->GetEventHandler()->Connect( wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler( VisualEditor::OnClickBackPanel ), NULL, this );
m_auimgr = NULL;
m_auipanel = NULL;
// scan aui panes in run-time
m_AuiScaner.SetOwner( this, ID_TIMER_SCAN );
m_AuiScaner.Start( 200 );
m_wizard = NULL;
}
示例9: SetColor
void CE_CBeam::BeamInit( const char *pSpriteName, float width )
{
SetColor( 255, 255, 255 );
SetBrightness( 255 );
SetNoise( 0 );
SetFrame( 0 );
SetScrollRate( 0 );
SetModelName( MAKE_STRING( pSpriteName ) );
SetRenderMode( kRenderTransTexture );
SetTexture( engine->PrecacheModel( pSpriteName ) );
SetWidth( width );
SetEndWidth( width );
SetFadeLength( 0 ); // No fade
for (int i=0;i<MAX_BEAM_ENTS;i++)
{
Set_m_hAttachEntity(i,NULL);
Set_m_nAttachIndex(i, 0);
}
m_nHaloIndex = 0;
m_fHaloScale = BEAM_DEFAULT_HALO_SCALE;
m_nBeamType = 0;
m_nBeamFlags = 0;
}
示例10: wxScrolledWindow
PrefPage::PrefPage(wxWindow* parent, const settings::PreferencePage& settingsPage) :
wxScrolledWindow(parent, wxID_ANY),
_settingsPage(settingsPage)
{
// Create the overall panel
SetScrollRate(0, 3);
SetSizer(new wxBoxSizer(wxVERTICAL));
// 12 pixel border
wxBoxSizer* overallVBox = new wxBoxSizer(wxVERTICAL);
GetSizer()->Add(overallVBox, 1, wxEXPAND | wxALL, 12);
// Create the label, unless the page is empty
if (!settingsPage.isEmpty())
{
wxStaticText* titleLabel = new wxStaticText(this, wxID_ANY, _settingsPage.getTitle());
titleLabel->SetFont(titleLabel->GetFont().Bold());
overallVBox->Add(titleLabel, 0, wxBOTTOM, 12);
}
_table = new wxFlexGridSizer(1, 2, 6, 12);
overallVBox->Add(_table, 1, wxEXPAND | wxLEFT, 6); // another 12 pixels to the left
settingsPage.foreachItem([&](const settings::PreferenceItemBasePtr& item)
{
createItemWidgets(item);
});
}
示例11: wxT
void CScrolledTextBox::SetValue(const wxString& s) {
int lineHeight, totalLines, totalWidth;
wxString t = s;
// Delete sizer & its children (CTransparentStaticText objects)
m_TextSizer->Clear(true);
// Change all occurrences of "<sup>n</sup>" to "^n"
t.Replace(wxT("<sup>"), wxT("^"), true);
t.Replace(wxT("</sup>"), wxT(""), true);
t.Replace(wxT("<"), wxT("<"), true);
// First see if it fits without vertical scroll bar
totalWidth = GetSize().GetWidth();
totalLines = Wrap(t, totalWidth, &lineHeight);
m_TextSizer->FitInside(this);
SetScrollRate(1, lineHeight);
int scrollLines = GetScrollLines(wxVERTICAL); // Returns 0 if no scrollbar
if (scrollLines > 0) {
int sbwidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
// It has a vertical scroll bar, so wrap again for reduced width
m_TextSizer->Clear(true);
totalLines = Wrap(t, totalWidth - sbwidth - SCROLLBARSPACER, &lineHeight);
m_TextSizer->FitInside(this);
}
}
示例12: SetWidth
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CEnvLaser::KeyValue( const char *szKeyName, const char *szValue )
{
if (FStrEq(szKeyName, "width"))
{
SetWidth( atof(szValue) );
}
else if (FStrEq(szKeyName, "NoiseAmplitude"))
{
SetNoise( atoi(szValue) );
}
else if (FStrEq(szKeyName, "TextureScroll"))
{
SetScrollRate( atoi(szValue) );
}
else if (FStrEq(szKeyName, "texture"))
{
SetModelName( AllocPooledString(szValue) );
}
else
{
BaseClass::KeyValue( szKeyName, szValue );
}
return true;
}
示例13: SetRowHeight
void OOPLyric::Create(const wxArrayString &colorArray) {
m_strName.assign(L"OOPLyric");
m_align = ALIGN_SYNC_X_Y;
SetRowHeight(15); // 行高
SetLinesUpDown(0); // 滚轮失去了作用
SetScrollRate(1, 1); // 每行高 1px
SetShownItemsAddIn(1); // 每屏多显示1行
CalcShownItems();
SetAddinStyle(VSWS_NO_SCROLLBAR | VLCS_NO_SELECT);
//======================================================
m_TextColor.Set(colorArray[0]);
m_HilightColor.Set(colorArray[1]);
m_BgColor.Set(colorArray[2]);
m_crossBrush1 = m_crossBrush2 = wxBrush(m_BgColor, wxSOLID);
InsertColumn(VdkLcColumnInitializer(this).
percentage(100).
width(m_Rect.width).
textAlign(TEXT_ALIGN_CENTER_X_Y).
textColor(m_TextColor));
//======================================================
m_WindowImpl->Bind(wxEVT_SHOW, &OOPLyric::OnParentShow, this);
wxTheApp->Bind(wxEVT_TIMER, &OOPLyric::OnTimerNotify, this, m_timerId);
}
示例14: SetSize
void MapWidget::set_properties()
{
// begin wxGlade: MapWidget::set_properties
SetSize(wxSize(-1, -1));
SetScrollRate(10, 10);
// end wxGlade
}
示例15: SetScrollRate
void coreSurfaceSelectorWidgetUI::set_properties()
{
// begin wxGlade: coreSurfaceSelectorWidgetUI::set_properties
SetScrollRate(10, 10);
checkbox_1->SetValue(1);
radio_btn_1->SetValue(1);
// end wxGlade
}