コード例 #1
0
ファイル: seldraw.cpp プロジェクト: cyclefusion/szarp
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
0
void coreImageContrastWidgetUI::set_properties()
{
    // begin wxGlade: coreImageContrastWidgetUI::set_properties
    SetSize(wxSize(368, 134));
    SetScrollRate(10, 10);
    // end wxGlade
}
コード例 #3
0
ファイル: bmpviewer.cpp プロジェクト: FrodeMMeling/diff-pdf
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
0
ファイル: sg_TaskPanel.cpp プロジェクト: Murph9000/boinc-v2
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("&lt;"), 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
0
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
0
void coreWorkingAreaManagerWidgetUI::set_properties()
{
    // begin wxGlade: coreWorkingAreaManagerWidgetUI::set_properties
    SetSize(wxSize(273, 279));
    SetScrollRate(10, 10);
    // end wxGlade
}
コード例 #7
0
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
0
ファイル: visualeditor.cpp プロジェクト: noriter/wxfb
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
0
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
0
ファイル: PrefPage.cpp プロジェクト: codereader/DarkRadiant
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
0
ファイル: sg_TaskPanel.cpp プロジェクト: WilliamStilte/boinc
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("&lt;"), 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
0
ファイル: EnvLaser.cpp プロジェクト: AluminumKen/hl2sb-src
//-----------------------------------------------------------------------------
// 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
0
ファイル: OOPLyric.cpp プロジェクト: vanxining/M4Player
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
0
ファイル: MapWidget.cpp プロジェクト: johanberntsson/kazam
void MapWidget::set_properties()
{
    // begin wxGlade: MapWidget::set_properties
    SetSize(wxSize(-1, -1));
    SetScrollRate(10, 10);
    // end wxGlade
}
コード例 #15
0
void coreSurfaceSelectorWidgetUI::set_properties()
{
    // begin wxGlade: coreSurfaceSelectorWidgetUI::set_properties
    SetScrollRate(10, 10);
    checkbox_1->SetValue(1);
    radio_btn_1->SetValue(1);
    // end wxGlade
}
コード例 #16
0
ファイル: ImageBox.cpp プロジェクト: aszlig/wx-Youtube
wxPaintBox::wxPaintBox(wxWindow *parent, wxWindowID id):
    wxScrolledWindow(parent, id)
{
  SetScrollRate(1,1);
  m_buffer = new wxBitmap;
  m_bufferX = m_bufferY = 0;
  m_imageWidth = m_imageHeight = 0;
  SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
}
コード例 #17
0
ファイル: TileMapPanel.cpp プロジェクト: Slulego/GD
void TileMapPanel::Update()
{
    if (!m_tilemap || !m_tileset)
        return;
    SetScrollRate(1, 1);
    SetVirtualSize(m_tilemap->GetColumnsCount() * m_tileset->tileSize.x, m_tilemap->GetRowsCount() * m_tileset->tileSize.y);

    Refresh();
}
コード例 #18
0
	void CalcSize()
	{
		if (m_sizeInitialized)
			return;
		m_sizeInitialized = true;

		wxSize size = GetClientSize();

		if (!m_icons.empty())
		{
			int icons_per_line = wxMax(1, (size.GetWidth() - BORDER) / (m_iconSize.GetWidth() + BORDER));

			// Number of lines and line height
			int lines = (m_icons.size() - 1) / icons_per_line + 1;
			int vheight = lines * (m_iconSize.GetHeight() + BORDER) + BORDER;
			if (vheight > size.GetHeight())
			{
				// Scroll bar would appear, need to adjust width
				size.SetHeight(vheight);
				SetVirtualSize(size);
				SetVirtualSizeHints(size, size);
				SetScrollRate(0, m_iconSize.GetHeight() + BORDER);

				wxSize size2 = GetClientSize();
				size.SetWidth(size2.GetWidth());

				icons_per_line = wxMax(1, (size.GetWidth() - BORDER) / (m_iconSize.GetWidth() + BORDER));
				lines = (m_icons.size() - 1) / icons_per_line + 1;
				vheight = lines * (m_iconSize.GetHeight() + BORDER) + BORDER;
				if (vheight > size.GetHeight())
					size.SetHeight(vheight);
			}

			// Calculate extra padding
			if (icons_per_line > 1)
			{
				int extra = size.GetWidth() - BORDER - icons_per_line * (m_iconSize.GetWidth() + BORDER);
				m_extra_padding = extra / (icons_per_line - 1);
			}
		}
		SetVirtualSize(size);
		SetVirtualSizeHints(size, size);
		SetScrollRate(0, m_iconSize.GetHeight() + BORDER);
	}
コード例 #19
0
ファイル: packageview.cpp プロジェクト: BhushanRB/usbpicprog
UppPackageViewWindow::UppPackageViewWindow(wxWindow* parent, wxWindowID id)
    : wxScrolledCanvas( parent, id, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL|wxFULL_REPAINT_ON_RESIZE, _("packageview") )
{
    //SetBackgroundStyle(wxBG_STYLE_COLOUR);
    SetBackgroundColour(*wxWHITE);
    SetScrollRate(20,20);
    Connect(wxEVT_PAINT, wxPaintEventHandler(UppPackageViewWindow::OnPaint), NULL, this);
    Connect(wxEVT_SIZE, wxSizeEventHandler(UppPackageViewWindow::OnSize), NULL, this);
    m_fitting = false;
}
コード例 #20
0
ファイル: print_cont_ui.cpp プロジェクト: calband/calchart
FancyTextPanel::FancyTextPanel(wxWindow* parent)
    : wxScrolled<wxWindow>(parent, wxID_ANY)
    , m_landscape(false)
{
    static const double kSizeX = 576, kSizeY = 734 - 606;
    SetVirtualSize(wxSize(kSizeX, kSizeY));
    SetScrollRate(10, 10);
    SetBackgroundColour(*wxWHITE);
    Connect(wxEVT_PAINT, wxPaintEventHandler(FancyTextPanel::OnPaint));
}
コード例 #21
0
ファイル: VariationControl.cpp プロジェクト: Marlinc/0ad
VariationControl::VariationControl(wxWindow* parent, Observable<ObjectSettings>& objectSettings)
: wxScrolledWindow(parent, -1),
m_ObjectSettings(objectSettings)
{
	m_Conn = m_ObjectSettings.RegisterObserver(1, &VariationControl::OnObjectSettingsChange, this);

	SetScrollRate(0, 5);

	m_Sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(m_Sizer);
}
コード例 #22
0
	void CalcSize()
	{
		unsigned int rowCount = m_view->m_dataSize / m_view->m_rowsize;
		wxSize fntSize = m_view->GetFont().GetPixelSize();
		m_rowHeight = fntSize.GetHeight() + 2;
		m_charWidth = fntSize.GetWidth();

		SetScrollRate(m_charWidth * 4, m_rowHeight * 20);
		SetScrollbars(m_charWidth, m_rowHeight, m_view->m_rowsize * 3, rowCount + 2);

		Refresh();
	}
コード例 #23
0
ファイル: nkToolBar.cpp プロジェクト: animecomico/Nukak3D
nkToolBar::nkToolBar(wxWindow* parent, 
                    wxWindowID id, 
                    const wxPoint& pos, 
					const wxSize& size, 
					long style, 
					const wxString& name):
		wxScrolledWindow(parent, id, pos, size, style, name)
{
	SetScrollRate(10,10 );
	SetScrollbars(10,10,100,100);
	SetBackgroundColour(wxColour(255,255,255));
}
コード例 #24
0
ファイル: TTYScroll.cpp プロジェクト: AluOne/OpenCPN
TTYScroll::TTYScroll(wxWindow *parent, int n_lines)
    : wxScrolledWindow(parent), m_nLines( n_lines )
{
    bpause = false;
    wxClientDC dc(this);
    dc.GetTextExtent(_T("Line Height"), NULL, &m_hLine);

    SetScrollRate( 0, m_hLine );
    SetVirtualSize( -1, ( m_nLines + 1 ) * m_hLine );
    m_plineArray = new wxArrayString;
    for(unsigned int i=0 ; i < m_nLines ; i++)
        m_plineArray->Add(_T(""));
}
コード例 #25
0
ファイル: StateEvaluationTree.cpp プロジェクト: mheinsen/seec
bool StateEvaluationTreePanel::Create(wxWindow *Parent,
                                      OpenTrace &WithTrace,
                                      ContextNotifier &WithNotifier,
                                      ActionRecord &WithRecording,
                                      ActionReplayFrame &WithReplay,
                                      wxWindowID ID,
                                      wxPoint const &Position,
                                      wxSize const &Size)
{
  if (!wxScrolled<wxPanel>::Create(Parent, ID, Position, Size))
    return false;
  
  Trace = &WithTrace;
  Notifier = &WithNotifier;
  Recording = &WithRecording;
  
  SetBackgroundStyle(wxBG_STYLE_PAINT);
  SetScrollRate(10, 10);

  // Setup the current ColourScheme.
  auto &SchemeSettings = wxGetApp().getColourSchemeSettings();
  setupColourScheme(*SchemeSettings.getColourScheme());

  // Handle ColourScheme updates.
  SchemeSettings.addListener(
    [this] (ColourSchemeSettings const &Settings) {
      setupColourScheme(*Settings.getColourScheme());
      recalculateNodePositions();
      redraw();
    });

  HoverTimer.Bind(wxEVT_TIMER, &StateEvaluationTreePanel::OnHover, this);
  
  // Receive notifications of context events.
  Notifier->callbackAdd(seec::make_function([this] (ContextEvent const &Ev) {
                                              this->notifyContextEvent(Ev); }));

  WithReplay.RegisterHandler("StateEvaluationTree.NodeMouseOver",
                             {{"node", "stmt"}},
    seec::make_function(this, &StateEvaluationTreePanel::ReplayNodeMouseOver));
  
  WithReplay.RegisterHandler("StateEvaluationTree.NodeRightClick",
                             {{"node", "stmt"}},
    seec::make_function(this, &StateEvaluationTreePanel::ReplayNodeRightClick));
  
  WithReplay.RegisterHandler("StateEvaluationTree.NodeHover",
                             {{"node", "stmt"}},
    seec::make_function(this, &StateEvaluationTreePanel::ReplayNodeHover));
  
  return true;
}
コード例 #26
0
ファイル: chartpanel.cpp プロジェクト: lukecian/wxfreechart
wxChartPanel::wxChartPanel(wxWindow *parent, wxWindowID id, Chart *chart, const wxPoint &pos, const wxSize &size)
    : wxScrolledWindow(parent, id, pos, size, wxHSCROLL | wxVSCROLL | wxFULL_REPAINT_ON_RESIZE)
{
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
    EnableScrolling(false, false);

    m_chart = NULL;
    m_antialias = false;

    ResizeBackBitmap(size);

    SetScrollRate(1, 1);
    SetChart(chart);
}
コード例 #27
0
GraphCanvas::GraphCanvas(wxWindow* parent, int border) :
	wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxALWAYS_SHOW_SB | wxHSCROLL | wxVSCROLL),
	m_BorderSize(border),
	m_HandCursor(wxCURSOR_SIZING),
	m_Zoom(1.0f),
	m_OldZoom(0.0f),
	m_Width(0),
	m_Height(0),
	m_Zooming(false)
{
	SetVirtualSize(0, 0);
	SetScrollRate(1, 1);
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);
}
コード例 #28
0
/** \brief A container for the various option panels
 * Contains a notebook holding the real option panels as pages. Handles "apply" and "restore" events for those pages,
 * rather then those having to implement (and duplicate) this functionality. \n
 * See SpringOptionsTab, TorrentOptionsPanel, ChatOptionsTab
 */
MainOptionsTab::MainOptionsTab(wxWindow* parent)
    : wxScrolledWindow(parent, -1)
{
	frame = parent;
	GetAui().manager->AddPane(this, wxLEFT, _T("mainoptionstab"));
	m_tabs = new SLNotebook(this, _T("mainoptionstab"), OPTIONS_TABS, 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(spring_xpm) );
    m_imagelist->Add( charArr2wxBitmap( torrentoptionspanel_icon_png, sizeof(torrentoptionspanel_icon_png) )  );
    m_imagelist->Add( wxIcon(userchat_xpm) );
    m_imagelist->Add( wxIcon(userchat_xpm) );
    m_imagelist->Add( wxIcon(springlobby12x12_xpm) );
*/
	m_spring_opts = new SpringOptionsTab(m_tabs);
	m_tabs->AddPage(m_spring_opts, _("Spring"), true, wxIcon(spring_xpm));

	m_torrent_opts = new TorrentOptionsPanel(m_tabs);
	m_tabs->AddPage(m_torrent_opts, _("Downloads"), true, charArr2wxBitmap(torrentoptionspanel_icon_png, sizeof(torrentoptionspanel_icon_png)));

	m_chat_opts = new ChatOptionsTab(m_tabs);
	m_tabs->AddPage(m_chat_opts, _("Chat"), true, wxIcon(userchat_xpm));

	m_lobby_opts = new LobbyOptionsTab(m_tabs);
	m_tabs->AddPage(m_lobby_opts, _("General"), true, wxIcon(springlobby12x12_xpm));

	m_groups_opts = new GroupOptionsPanel(m_tabs);
	m_tabs->AddPage(m_groups_opts, _("Groups"), true, wxIcon(userchat_xpm));

	m_apply_btn = new wxButton(this, wxID_APPLY, _("Apply"));
	m_cancel_btn = new wxButton(this, wxID_CANCEL, _("Cancel"));
	m_ok_btn = new wxButton(this, wxID_OK, _("Ok"));

	m_button_sizer = new wxBoxSizer(wxHORIZONTAL);
	m_button_sizer->AddStretchSpacer();
	m_button_sizer->Add(m_apply_btn, 0, wxALL, 2);
	m_button_sizer->Add(m_cancel_btn, 0, wxALL, 2);
	m_button_sizer->Add(m_ok_btn, 0, wxALL, 2);

	m_main_sizer = new wxBoxSizer(wxVERTICAL);
	m_main_sizer->Add(m_tabs, 1, wxEXPAND);
	m_main_sizer->Add(m_button_sizer, 0, wxEXPAND);

	SetSizer(m_main_sizer);
	SetScrollRate(SCROLL_RATE, SCROLL_RATE);
	SetSelection(0); //activate first tab
	Layout();
	Refresh();
}
コード例 #29
0
// Define a constructor for my canvas
MyCanvas::MyCanvas(wxView *view, wxWindow *parent)
    : wxScrolledWindow(parent ? parent : view->GetFrame())
{
    m_view = view;
    m_currentSegment = NULL;
    m_lastMousePos = wxDefaultPosition;

    SetCursor(wxCursor(wxCURSOR_PENCIL));

    // this is completely arbitrary and is done just for illustration purposes
    SetVirtualSize(1000, 1000);
    SetScrollRate(20, 20);

    SetBackgroundColour(*wxWHITE);
}
コード例 #30
0
ファイル: CBeam.cpp プロジェクト: CryoKeen/HLEnhanced
void CBeam::BeamInit( const char *pSpriteName, int width )
{
	pev->flags |= FL_CUSTOMENTITY;
	SetColor( 255, 255, 255 );
	SetBrightness( 255 );
	SetNoise( 0 );
	SetFrame( 0 );
	SetScrollRate( 0 );
	pev->model = MAKE_STRING( pSpriteName );
	SetTexture( PRECACHE_MODEL( ( char * ) pSpriteName ) );
	SetWidth( width );
	pev->skin = 0;
	pev->sequence = 0;
	pev->rendermode = 0;
}