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


C++ TopWindow::Add方法代码示例

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


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

示例1: AddGUILayout

	void AddGUILayout()
	{
		String name;

		TopWindow dlg;
		dlg.Title(t_("New layout"));
		dlg.SetRect( GetWorkArea().CenterRect(300, 80) );
		EditString s;
		Button ok, cancel;
		ok.SetLabel(t_("Add"));
		ok <<= dlg.Acceptor(IDOK);
		cancel <<= dlg.Rejector(IDCANCEL);
		cancel.SetLabel(t_("Cancel"));
		dlg.ToolWindow();
		dlg.Add( s.HSizePosZ(8, 8).TopPosZ(8, 18) );
		dlg.Add( ok.RightPosZ(80, 65).BottomPosZ(8, 25) );
		dlg.Add( cancel.RightPosZ(8, 65).BottomPosZ(8, 25) );
		if (dlg.Execute() == IDCANCEL)
			return;
		name = (~s).ToString();
		if (name.IsEmpty())
			name = t_("User Interface");

		name = " " + name;
		SaveLayout(name);
		DeleteFile(ConfigFile("Layouts.bin"));
		StoreToFile(*this, ConfigFile("Layouts.bin"));
		LoadGUILayouts();
		_GUILayouts <<= _GUILayouts.GetKey( _GUILayouts.GetCount() - 1 );
		UpdateTools();
	}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:31,代码来源:FormEdit.hpp

示例2: GuiPackageResolver

bool GuiPackageResolver(const String& error, const String& path, int line)
{
prompt:
	switch(Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(),
	              error + "&while parsing package " + DeQtf(path),
		          "Edit \\& Retry", "Ignore",  "Stop")) {
	case 0:
		if(!PromptYesNo("Ignoring will damage package. Everything past the "
			            "point of error will be lost.&Do you want to continue ?"))
			goto prompt;
		return false;
	case 1: {
			TopWindow win;
			LineEdit edit;
			edit.Set(LoadFile(path));
			edit.SetCursor(edit.GetPos(line));
			win.Title(path);
			win.Add(edit.SizePos());
			win.Run();
			SaveFile(path, edit.Get());
		}
		return true;;
	case -1:
		exit(1);
	}
	return false;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:27,代码来源:Util.cpp

示例3: Action

	void Action() {
		int rowind = GetCurrentRow();
		uint64 bit = (int64)Get(2);
		if(bit == 0) {
			TopWindow tw; 
			tw.Title("~~~~~"); 
			Image img = Images::hat;
			ImageCtrl ic;
			ic.SetImage(img).SetRect(0, 0, img.GetWidth(), img.GetHeight()); 
			tw.Add(ic); 
			tw.SetRect(::GetMousePos().x - 20, GetMousePos().y - 20, img.GetWidth(), img.GetHeight()); 
			tw.RunAppModal(); 
			return;
		}
		bool on = ((Option*)GetList().GetCtrl(0))->Get() == 1;
		uint64 bits = GetWindowLong((HWND)hwnd, (rowind>3+sizeof(stylesbits)/sizeof(stylesbits[0])) ? GWL_EXSTYLE : GWL_STYLE);
		if(on)
			SetBit(bits, bit);
		else  
			ClearBit(bits, bit);
		SetWindowLong((HWND)hwnd, (rowind > 3 + sizeof(stylesbits)/sizeof(stylesbits[0])) ? GWL_EXSTYLE : GWL_STYLE, (LONG)bits);
		RedrawWindow(GetDesktopWindow(), 0, 0, RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_FRAME|RDW_ERASE);
		RedrawWindow((HWND)hwnd, 0, 0, RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_FRAME|RDW_ERASE);
	}
开发者ID:ultimatepp,项目名称:mirror,代码行数:24,代码来源:main.cpp

示例4: MakeTutorial

void MakeTutorial()
{
	String log = LoadFile(GetStdLogPath());
	StringStream ss(log);

	VectorMap<String, Vector<Tuple<int, String>>> logline;
	
	String path;
	int    line;

	while(!ss.IsEof()) {
		String ln = ss.GetLine();
		if(ln.StartsWith("-=>")) {
			SplitTo(ln.Mid(4), '@', path, ln);
			line = atoi(ln) - 1;
		}
		else
		if(path.GetCount())
			logline.GetAdd(path).Add(MakeTuple(line, ln));
	}
	
	for(auto&& f : ~logline) {
		Vector<String> src = Split(Filter(LoadFile(f.key), [] (int c) { return c == '\r' ? 0 : c; }), '\n', false);
		int i = 0;
		int logi = 0;
		bool wasdoc = false;
		Vector<String> code;
		while(i < src.GetCount()) {
			String block;
			while(i < src.GetCount() && TrimLeft(src[i]).StartsWith("///")) {
				FlushCode(code);
				Vector<String> logblock;
				while(logi < f.value.GetCount() && f.value[logi].a <= i)
					logblock.Add(f.value[logi++].b);
				FlushLog(logblock);
				
				String line = src[i++];
				int q = line.FindAfter("///");
				if(TrimRight(line).GetCount() > q) {
					if(block.GetCount())
						block << ' ';
					block << TrimBoth(line.Mid(q));
				}
				else
					FlushDoc(block);
				wasdoc = true;
			}
			FlushDoc(block);
			while(i < src.GetCount() && !TrimLeft(src[i]).StartsWith("///")) {
				String tl = TrimLeft(src[i]);
				if(!tl.StartsWith("#if") && !tl.StartsWith("#end"))
					code.Add(src[i]);
				i++;
			}
			DUMPC(code);
			if(!wasdoc)
				code.Clear();
		}
	}
	
	LOG("--------------------------------------------");
	LOG(out);
	
	LOG("--------------------------------------------");
	LOG(qtf);
	
	RichEditWithToolBar edit;
	edit.SetReadOnly();
	edit <<= qtf;
	TopWindow win;
	win.Add(edit.SizePos());
	win.Run();
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:73,代码来源:Tutorial.cpp


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