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


C++ AddDialogItem函数代码示例

本文整理汇总了C++中AddDialogItem函数的典型用法代码示例。如果您正苦于以下问题:C++ AddDialogItem函数的具体用法?C++ AddDialogItem怎么用?C++ AddDialogItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: AddDialogItem

DialogItemEx *DialogBuilder::AddListControl(FARDIALOGITEMTYPES Type, IntOption& Value, string *Text, int Width, int Height, const std::vector<FarDialogBuilderListItem2> &Items, FARDIALOGITEMFLAGS Flags)
{
	const auto Item = AddDialogItem(Type, Text ? Text->c_str() : L"");
	SetNextY(Item);
	Item->X2 = Item->X1 + Width;
	Item->Y2 = Item->Y1 + Height;
	Item->Flags |= DIF_DROPDOWNLIST|Flags;

	m_NextY += Height;

	const auto ListItems = new FarListItem[Items.size()];
	std::transform(ALL_CONST_RANGE(Items), ListItems, [&Value](const auto& i)
	{
		FarListItem NewItem = {};
		NewItem.Text = i.Text.c_str();
		NewItem.Flags = i.Flags | ((Value == i.ItemValue)? LIF_SELECTED : 0);
		NewItem.UserData = i.ItemValue;
		return NewItem;
	});
	const auto List = new FarList;
	List->StructSize = sizeof(FarList);
	List->Items = ListItems;
	List->ItemsNumber = Items.size();
	Item->ListItems = List;

	SetLastItemBinding(new FarListControlBinding<IntOption>(Value, Text, List));
	return Item;
}
开发者ID:FarGroup,项目名称:FarManager,代码行数:28,代码来源:FarDlgBuilder.cpp

示例2: AddSeparator

		void AddSeparator(const wchar_t* Text)
		{
			T *Separator = AddDialogItem(DI_TEXT, Text);
			Separator->Flags = DIF_SEPARATOR;
			Separator->X1 = -1;
			Separator->Y1 = Separator->Y2 = m_NextY++;
		}
开发者ID:brucewu16899,项目名称:cmder-1,代码行数:7,代码来源:DlgBuilder.hpp

示例3: AddDialogItem

DialogItemEx *DialogBuilder::AddListControl(FARDIALOGITEMTYPES Type, int& Value, string *Text, int Width, int Height, const DialogBuilderListItem *Items, size_t ItemCount, FARDIALOGITEMFLAGS Flags)
{
	const auto Item = AddDialogItem(Type, Text ? Text->data() : L"");
	SetNextY(Item);
	Item->X2 = Item->X1 + Width;
	Item->Y2 = Item->Y1 + Height;
	Item->Flags |= Flags;

	m_NextY += Height;

	const auto ListItems = Items? new FarListItem[ItemCount] : nullptr;
	if (Items)
	{
		std::transform(Items, Items + ItemCount, ListItems, [&Value](const DialogBuilderListItem& Item) -> FarListItem
		{
			FarListItem NewItem = {};
			NewItem.Text = MSG(static_cast<LNGID>(Item.MessageId));
			NewItem.Flags = (Value == Item.ItemValue)? LIF_SELECTED : 0;
			NewItem.Reserved[0] = Item.ItemValue;
			return NewItem;
		});
	}
	const auto List = new FarList;
	List->StructSize = sizeof(FarList);
	List->Items = ListItems;
	List->ItemsNumber = ItemCount;
	Item->ListItems = List;

	SetLastItemBinding(new ListControlBinding<DialogItemEx>(Value, Text, List));
	return Item;
}
开发者ID:Maximus5,项目名称:Far3bis,代码行数:31,代码来源:FarDlgBuilder.cpp

示例4: AddButtons

		// Добавляет линейку кнопок.
		void AddButtons(int ButtonCount, const int* MessageIDs, int defaultButtonIndex = 0, int cancelButtonIndex = -1)
		{
			int LineY = m_NextY++;
			T *PrevButton = nullptr;

			for (int i = 0; i < ButtonCount; i++)
			{
				T *NewButton = AddDialogItem(DI_BUTTON, GetLangString(MessageIDs[i]));
				NewButton->Flags = DIF_CENTERGROUP;
				NewButton->Y1 = NewButton->Y2 = LineY;
				if (PrevButton)
				{
					NewButton->X1 = PrevButton->X2 + 1;
				}
				else
				{
					NewButton->X1 = 2 + m_Indent;
					m_FirstButtonID = m_DialogItemsCount - 1;
				}
				NewButton->X2 = NewButton->X1 + ItemWidth(*NewButton);

				if (defaultButtonIndex == i)
				{
					NewButton->Flags |= DIF_DEFAULTBUTTON;
				}
				if (cancelButtonIndex == i)
					m_CancelButtonID = m_DialogItemsCount - 1;

				PrevButton = NewButton;
			}
		}
开发者ID:brucewu16899,项目名称:cmder-1,代码行数:32,代码来源:DlgBuilder.hpp

示例5: AddSeparator

		// Добавляет сепаратор.
		void AddSeparator(int MessageId=-1)
		{
			T *Separator = AddDialogItem(DI_TEXT, MessageId == -1 ? L"" : GetLangString(MessageId));
			Separator->Flags = DIF_SEPARATOR;
			Separator->X1 = 3;
			Separator->Y1 = Separator->Y2 = NextY++;
		}
开发者ID:landswellsong,项目名称:FAR,代码行数:8,代码来源:DlgBuilder.hpp

示例6: AddDialogItem

		FarDialogItem *AddListControl(FARDIALOGITEMTYPES Type, int *SelectedItem, wchar_t *Text, int Width, int Height, const wchar_t* ItemsText [], size_t ItemCount, FARDIALOGITEMFLAGS ItemFlags)
		{
			FarDialogItem *Item = AddDialogItem(Type, Text ? Text : L"");
			SetNextY(Item);
			Item->X2 = Item->X1 + Width;
			Item->Y2 = Item->Y2 + Height;
			Item->Flags |= ItemFlags;

			m_NextY += Height;

			FarListItem *ListItems = nullptr;
			if (ItemsText)
			{
				ListItems = new FarListItem[ItemCount];
				for(size_t i=0; i<ItemCount; i++)
				{
					ListItems[i].Text = ItemsText[i];
					ListItems[i].Flags = SelectedItem && (*SelectedItem == static_cast<int>(i)) ? LIF_SELECTED : 0;
				}
			}
			FarList *List = new FarList;
			List->StructSize = sizeof(FarList);
			List->Items = ListItems;
			List->ItemsNumber = ListItems ? ItemCount : 0;
			Item->ListItems = List;

			SetLastItemBinding(new PluginListControlBinding(Info, &DialogHandle, m_DialogItemsCount - 1, SelectedItem, Text, List));
			return Item;
		}
开发者ID:brucewu16899,项目名称:cmder-1,代码行数:29,代码来源:DlgBuilder.hpp

示例7: AddOKCancel

		// Добавляет сепаратор, кнопки OK и Cancel.
		void AddOKCancel(int OKMessageId, int CancelMessageId, bool Separator=true)
		{
			if (Separator)
				AddSeparator();

			T *OKButton = AddDialogItem(DI_BUTTON, GetLangString(OKMessageId));
			OKButton->Flags = DIF_CENTERGROUP|DIF_DEFAULTBUTTON;
			OKButton->Y1 = OKButton->Y2 = NextY++;
			OKButtonID = DialogItemsCount-1;

			if(CancelMessageId != -1)
			{
				T *CancelButton = AddDialogItem(DI_BUTTON, GetLangString(CancelMessageId));
				CancelButton->Flags = DIF_CENTERGROUP;
				CancelButton->Y1 = CancelButton->Y2 = OKButton->Y1;
			}
		}
开发者ID:landswellsong,项目名称:FAR,代码行数:18,代码来源:DlgBuilder.hpp

示例8: StartSingleBox

		// Начинает располагать поля диалога внутри single box
		void StartSingleBox(int MessageId=-1, bool LeftAlign=false)
		{
			T *SingleBox = AddDialogItem(DI_SINGLEBOX, MessageId == -1 ? L"" : GetLangString(MessageId));
			SingleBox->Flags = LeftAlign ? DIF_LEFTTEXT : DIF_NONE;
			SingleBox->X1 = 5;
			SingleBox->Y1 = m_NextY++;
			m_Indent = 2;
			m_SingleBoxIndex = m_DialogItemsCount - 1;
		}
开发者ID:brucewu16899,项目名称:cmder-1,代码行数:10,代码来源:DlgBuilder.hpp

示例9: AddDialogItem

DialogItemEx *DialogBuilder::AddEditField(string *Value, int Width, const wchar_t *HistoryID, int Flags)
{
	DialogItemEx *Item = AddDialogItem(DI_EDIT, *Value);
	SetNextY(Item);
	Item->X2 = Item->X1 + Width;
	if (HistoryID)
	{
		Item->strHistory = HistoryID;
		Item->Flags |= DIF_HISTORY;
	}
	Item->Flags |= Flags;

	SetLastItemBinding(new EditFieldBinding(Value));
	return Item;
}
开发者ID:alexlav,项目名称:conemu,代码行数:15,代码来源:DlgBuilder.cpp


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