当前位置: 首页>>代码示例>>C++>>正文


C++ LabelControl::AssignIdToControlAndMoveInParentChildrenList方法代码示例

本文整理汇总了C++中LabelControl::AssignIdToControlAndMoveInParentChildrenList方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelControl::AssignIdToControlAndMoveInParentChildrenList方法的具体用法?C++ LabelControl::AssignIdToControlAndMoveInParentChildrenList怎么用?C++ LabelControl::AssignIdToControlAndMoveInParentChildrenList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LabelControl的用法示例。


在下文中一共展示了LabelControl::AssignIdToControlAndMoveInParentChildrenList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VanillaTechTreeRenderer

TechTreeWindow *TechTreeWindow::Constructor(Window *underlyingWindow, int unknownGameAndPlayerData, int selectedCivId)
{
	// Needed for window management and proper cleanup in other places
	base::Constructor("One Button Tech Tree Screen");

	// Save underlying window
	_underlyingWindow = underlyingWindow;

	// Save game data
	_unknownGameAndPlayerData = unknownGameAndPlayerData;

	// Set virtual function table address
	_VTable = reinterpret_cast<ControlVTable *>(0x00645118);

	// Cast virtual function table to be able to access all functions
	PanelVTable *vTable = static_cast<PanelVTable *>(_VTable);

	// Get design data
	_designData = _staticNewTechTreeDataObject->GetDesignData();

	// Load style file
	DirectDrawBufferData *backBuffer = underlyingWindow->_VTable->GetBackBufferData(underlyingWindow);
	if(!PrepareParentWindowAndLoadStyleData(backBuffer, "scr6", 50007, 1))
		_initializationError = 1;

	// Start with top left corner
	_horizontalScrollOffset = 0;
	_verticalScrollOffset = 0;
	_lastScrollActionTime = 0;

	// Create vanilla style tech tree renderer
	// TODO: May be changed to allow various renderers using completely different layout approaches
	_renderer = new VanillaTechTreeRenderer((*_staticGameObjectPointer)->GetGameDataHandler(), Size(_width1, _height1), unknownGameAndPlayerData);

	// Get the renderer's age count
	_ageCount = _renderer->GetAgeCount();

	// Create close button and its buffer
	static_cast<PanelVTable *>(_VTable)->CreateButtonWithOneFontWithTextFromDll(this, this, &_closeButton, 20101, 0, _width1 - _designData->_closeButtonRelativeRectangle.X, _height1 - _designData->_closeButtonRelativeRectangle.Y, _designData->_closeButtonRelativeRectangle.Width, _designData->_closeButtonRelativeRectangle.Height, 9, 0, 0);
	_closeButton->_VTable->InvalidateAndRedrawControl1(_closeButton, 1);
	_closeButton->AssignIdToControlAndMoveInParentChildrenList(1, 0);
	_closeButton->SetHotKey(VK_ESCAPE, 0, 0, 0);
	_closeButtonDrawBuffer = new DirectDrawBufferData("TechTree Close Button Buffer", 1);
	_closeButtonDrawBuffer->InsertIntoBufferListAndCreateSurfaceAndDoUnknownStuff(_backBufferData->GetDirectDrawHandler(), _designData->_closeButtonRelativeRectangle.Width, _designData->_closeButtonRelativeRectangle.Height, 0, 0);
	_closeButtonDrawBuffer->sub_5A30A0(0, 0, _designData->_closeButtonRelativeRectangle.Width, _designData->_closeButtonRelativeRectangle.Height);
	UpdateSelectedSubControl(_closeButton);

	// Create scroll buttons and their buffers
	static_cast<PanelVTable *>(_VTable)->CreateButton(this, this, &_scrollLeftButton, "<-", 0, _width1 - _designData->_scrollLeftButtonRelativeRectangle.X, _height1 - _designData->_scrollLeftButtonRelativeRectangle.Y, _designData->_scrollLeftButtonRelativeRectangle.Width, _designData->_scrollLeftButtonRelativeRectangle.Height, 9, 0, 0);
	_scrollLeftButton->_VTable->InvalidateAndRedrawControl1(_scrollLeftButton, 1);
	_scrollLeftButton->AssignIdToControlAndMoveInParentChildrenList(1, 0);
	_scrollLeftButtonDrawBuffer = new DirectDrawBufferData("TechTree ScrollLeft Button Buffer", 1);
	_scrollLeftButtonDrawBuffer->InsertIntoBufferListAndCreateSurfaceAndDoUnknownStuff(_backBufferData->GetDirectDrawHandler(), _designData->_scrollLeftButtonRelativeRectangle.Width, _designData->_scrollLeftButtonRelativeRectangle.Height, 0, 0);
	_scrollLeftButtonDrawBuffer->sub_5A30A0(0, 0, _designData->_scrollLeftButtonRelativeRectangle.Width, _designData->_scrollLeftButtonRelativeRectangle.Height);
	static_cast<PanelVTable *>(_VTable)->CreateButton(this, this, &_scrollRightButton, "->", 0, _width1 - _designData->_scrollRightButtonRelativeRectangle.X, _height1 - _designData->_scrollRightButtonRelativeRectangle.Y, _designData->_scrollRightButtonRelativeRectangle.Width, _designData->_scrollRightButtonRelativeRectangle.Height, 9, 0, 0);
	_scrollRightButton->_VTable->InvalidateAndRedrawControl1(_scrollRightButton, 1);
	_scrollRightButton->AssignIdToControlAndMoveInParentChildrenList(1, 0);
	_scrollRightButtonDrawBuffer = new DirectDrawBufferData("TechTree ScrollRight Button Buffer", 1);
	_scrollRightButtonDrawBuffer->InsertIntoBufferListAndCreateSurfaceAndDoUnknownStuff(_backBufferData->GetDirectDrawHandler(), _designData->_scrollRightButtonRelativeRectangle.Width, _designData->_scrollRightButtonRelativeRectangle.Height, 0, 0);
	_scrollRightButtonDrawBuffer->sub_5A30A0(0, 0, _designData->_scrollRightButtonRelativeRectangle.Width, _designData->_scrollRightButtonRelativeRectangle.Height);

	// Load arrow SLP for scroll buttons and assign frames to them
	_arrowSlp = new SlpFileElement(_designData->_scrollSlpFileName, _designData->_scrollSlpId);
	_scrollLeftButton->SetBackgroundSlpAtIndex(0, _arrowSlp, 1);
	_scrollLeftButton->SetDisplayMode(9);
	_scrollLeftButton->AssignLabelString(0, "");
	_scrollRightButton->SetBackgroundSlpAtIndex(0, _arrowSlp, 0);
	_scrollRightButton->SetDisplayMode(9);
	_scrollRightButton->AssignLabelString(0, "");

	// Create civ bonus label
	/*static_cast<PanelVTable *>(_VTable)->CreateLabelWithOneFontWithTextFromDll(this, this, &_civBonusLabel, 0, 2, 20, 100, 20, 10, 0, 0, 1);
	_civBonusLabel->_VTable->InvalidateAndRedrawControl1(_civBonusLabel, 0);
	_civBonusLabel->AssignIdToControlAndMoveInParentChildrenList(1, 0);
	_civBonusLabel->SetStyleText2Colors(0, 0);
	_civBonusLabel->sub_545D70(0);*/
	FontData *civBonusLabelBaseFont = (*_staticGameObjectPointer)->GetFontWithIndex(10);
	HFONT civBonusLabelFonts[4];
	civBonusLabelFonts[0] = civBonusLabelBaseFont->GetFontHandle();
	civBonusLabelFonts[1] = (*_staticGameObjectPointer)->GetFontWithIndex(17)->GetFontHandle();
	civBonusLabelFonts[2] = (*_staticGameObjectPointer)->GetFontWithIndex(18)->GetFontHandle();
	civBonusLabelFonts[3] = (*_staticGameObjectPointer)->GetFontWithIndex(19)->GetFontHandle();
	_civBonusLabel = new LabelControl();
	_civBonusLabel->sub_5444B0(_backBufferData, this, 2, 20, 100, 20, civBonusLabelFonts, civBonusLabelBaseFont->GetAverageCharWidth(), civBonusLabelBaseFont->GetCharHeightWithRowSpace(), nullptr, 0, 0, 0, 0, 0, nullptr);
	_civBonusLabel->SetTextAlignment(3, 1);
	_civBonusLabel->sub_545D50(1);
	_civBonusLabel->sub_545D70(0);
	_civBonusLabel->SetStyleText2Colors(0x000000, 0x00E7E7);

	// Create civ selection combo box
	static_cast<PanelVTable *>(_VTable)->CreateComboBox(this, this, &_civSelectionComboBox, 230, 0, 2, 20, 200, 25, 10);
	_civSelectionComboBox->_VTable->InvalidateAndRedrawControl1(_civSelectionComboBox, 1);
	_civSelectionComboBox->SetDropDownListSortingMode(1);
	_civSelectionComboBox->AssignIdToControlAndMoveInParentChildrenList(1, 1);
	_civSelectionComboBox->SetStyleText2Colors(0, 0);
	_civSelectionComboBox->GetDropDownScrollBar()->SetFillBackground(-1);
	_civSelectionComboBox->GetValueLabel()->SetBackgroundSlp("tech_tile.slp", 50343);
	_civSelectionComboBox->GetDropDownList()->SetBackgroundSlp("tech_tile.slp", 50343);

	// Create "game civs" label
//.........这里部分代码省略.........
开发者ID:Janworks,项目名称:AoETechTree,代码行数:101,代码来源:TechTreeWindow.cpp


注:本文中的LabelControl::AssignIdToControlAndMoveInParentChildrenList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。