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


C++ Ctrl类代码示例

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


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

示例1: LLOG

bool MenuBar::HotKey(dword key)
{
	if(Ctrl::HotKey(key))
		return true;
	if(IsChild()) {
		if((key == (K_ALT_KEY|K_KEYUP) || key == K_F10) && (submenu || HasFocusDeep())) {
			LLOG("CloseMenu()");
			CloseMenu();
			if(restorefocus)
				restorefocus->SetFocus();
			s_doaltkey = false;
			return true;
		}
		if(key == K_ALT_KEY) {
			LLOG("K_ALT_KEY");
			s_doaltkey = true;
			return true;
		}
		if((key == K_F10 || key == (K_ALT_KEY|K_KEYUP) && s_doaltkey)
		   && !submenu && !HasFocusDeep() && GetTopWindow() && GetTopWindow()->IsForeground()) {
			LLOG("Open menu by F10 or ALT-UP");
			SetupRestoreFocus();
			for(Ctrl *q = pane.GetFirstChild(); q; q = q->GetNext())
				if(q->SetFocus()) return true;
		}
	}
	LLOG("MenuBar::HotKey");
	return (key == K_LEFT || key == K_RIGHT) && parentmenu ? parentmenu->Key(key, 1) : false;
}
开发者ID:koz4k,项目名称:soccer,代码行数:29,代码来源:MenuBar.cpp

示例2: GetOwner

// get user options, process and save.
void
Options::onbtnSave()
{
	int dontsplash = optSplash.Get();    // get the value from option control
	int savewinpos = optSaveWinPos.Get();// get the value from option control

	Ctrl* owner = GetOwner(); // get a handle to the Options dislog owner which is MyUppApp main window.
	Rect rc;                  // create a struct to store window position and size

	if ( savewinpos != 1 ) {  // if Save Window option is not checked.
		rc.left = 0;          // set window position x to 0
		rc.top = 0;           // set window position y to 0
	} else {
		rc = owner->GetRect(); // get the position and size of MyUppApp main window
	}

	String cfg;  // create a string to store config data
	cfg << "Splash="     << dontsplash << "\n"    // save user's choice
	       "SaveWinPos=" << savewinpos << "\n"    // save user's choice
	       "PosX="       << rc.left    << "\n"    // save window x position
	       "PosY="       << rc.top     << "\n";   // save window y position

	if( !SaveFile(cfgfile, cfg) )  // save the config file
		Exclamation("Error saving configuration!"); // if failed show error dialog
	else
	    PromptOK("Options saved!");  // show success dialog

	Break(IDOK); // close this dialog
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:30,代码来源:Options.cpp

示例3: ShowToolTip

void ShowToolTip()
{
	LLOG("ShowToolTip");
	CloseToolTip();
	if(tipctrl) {
		String text = tipctrl->GetTip();
		LLOG("-> showing tip: " << text << " tipctrl: " << UPP::Name(tipctrl));
		Ctrl *top = tipctrl->GetTopCtrl();
		if(!text.IsEmpty() && top && (top->IsForeground() || top->IsPopUp())) {
			LLOG("-> foreground");
			ToolTip& q = AppToolTip();
			q.Set(text);
			Size sz = q.GetMinSize();
			Rect r = top->GetWorkArea();
			Point p = GetMousePos() + Size(0, 22);
			if(p.y + sz.cy > r.bottom)
				p = GetMousePos() - Size(0, 22);
			q.PopUp(top, p, !showmode);
			showmode = true;
			KillTimeCallback((void *)EndShowMode);
			return;
		}
		LLOG("-> background / empty text, top = " << UPP::Name(top));
	}
	SetTimeCallback(200, callback(EndShowMode), (void *)EndShowMode);
}
开发者ID:pedia,项目名称:raidget,代码行数:26,代码来源:ToolTip.cpp

示例4: RemoveFullRefresh

void Ctrl::RemoveFullRefresh()
{
	GuiLock __;
	fullrefresh = false;
	for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
		q->RemoveFullRefresh();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:CtrlDraw.cpp

示例5: GetFirstChild

Ctrl * DockPane::FindCtrl(int ix)
{
	Ctrl *c = GetFirstChild();
	for (int i = 0; i < ix && c; i++)
		c = c->GetNext();
	return c;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:DockPane.cpp

示例6: tm

void Themed::ReadTheme()
{
	int q = theme.Find(ToLower(GetClass()));
	if(q < 0) return;
	ClassTheme& cm = theme[q];
	ThemeProperties tm(cm.data.property, cm.data.image, true);
	Properties(tm);
	Ctrl *p = dynamic_cast<Ctrl *>(this);
	if(p)
		for(Ctrl *q = p->GetFirstChild(); q; q = q->GetNext()) {
			Themed *t = dynamic_cast<Themed *>(q);
			if(t) {
				int i = cm.child.Find(t->GetClass());
				if(i >= 0) {
					ThemeProperties tm(cm.child[i].property, cm.child[i].image, true);
					t->Properties(tm);
				}
				i = cm.child.Find(t->id);
				if(i >= 0) {
					q->SetPos(cm.child[i].pos);
					ThemeProperties tm(cm.child[i].property, cm.child[i].image, true);
					t->Properties(tm);
				}
			}
		}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:26,代码来源:Theme.cpp

示例7: max

void DisplayPopup::Sync()
{
	if(display && ctrl && !ctrl->IsDragAndDropTarget() && !IsDragAndDropTarget()) {
		Ctrl *top = ctrl->GetTopCtrl();
		if(top && top->HasFocusDeep()) {
			Size sz = display->GetStdSize(value);
			if(sz.cx + 2 * margin > item.GetWidth() || sz.cy > item.GetHeight()) {
				slim = item + ctrl->GetScreenView().TopLeft();
				if(slim.Contains(GetMousePos())) {
//					Rect wa = GetWorkArea();
					Rect r = item;
					r.right = max(r.right, r.left + sz.cx + 2 * margin);
					r.bottom = max(r.bottom, r.top + sz.cy);
					r.Inflate(1, 1);
					r.Offset(ctrl->GetScreenView().TopLeft());
					SetRect(r);
					if(!IsOpen())
						Ctrl::PopUp(ctrl, true, false, false);
					Refresh();
					return;
				}
			}
		}
	}
	if(IsOpen())
		Close();
}
开发者ID:pedia,项目名称:raidget,代码行数:27,代码来源:LabelBase.cpp

示例8: GetDockAlign

void DockWindow::Undock(DockCont &c)
{
	if (!c.IsFloating() && !c.IsHidden()) {
		if (c.IsAutoHide()) {
			for (int i = 0; i < 4; i++) {
				int ix = hideframe[i].FindCtrl(c);
				if (ix >= 0) {
					hideframe[i].RemoveCtrl(ix);
					hideframe[i].RefreshFrame();
					break;
				}
			}
		}
		else {
			int dock = GetDockAlign(c);
			if (dock >= 0 && dock < 4) {
				Ctrl *p = &c;
				while (p && p->GetParent() != &dockpane[dock]) p = p->GetParent();
				ASSERT(p);
				bool v = !IsTB(dock);
				c.SyncUserSize(v, !v);
			}
			Undock0(c);
		}
		c.StateNotDocked();
	}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:27,代码来源:DockWindow.cpp

示例9: Reject

void TopWindow::Reject()
{
	for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
		q->Reject();
	if(!backup.IsEmpty())
		Restore();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:7,代码来源:TopWindow.cpp

示例10: DndTargets

PasteClip Ctrl::GtkDnd(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
                       guint time, gpointer user_data, bool paste)
{
	DndTargets(context);
	g_object_ref(context); // make sure these always survive the action...
	g_object_ref(widget);
	dnd_context = context;
	dnd_widget = widget;
	dnd_time = time;
	PasteClip clip;
	clip.type = 1;
	clip.paste = paste;
	clip.accepted = false;
	clip.allowed = DND_MOVE|DND_COPY;
	gint dummy;
	GdkModifierType mod;
	gdk_window_get_pointer(gdk_get_default_root_window(), &dummy, &dummy, &mod);
	clip.action = mod & GDK_CONTROL_MASK ? DND_COPY : DND_MOVE;
	Ctrl *w = DragWnd(user_data);
	if(w) {
		gint mx, my;
		GdkModifierType mod;
		gdk_window_get_pointer(gdk_get_default_root_window(), &mx, &my, &mod);
		CurrentState = mod;
		CurrentMousePos = Point(x, y) + w->GetScreenRect().TopLeft();	
		w->DnD(CurrentMousePos, clip);
	}
	gdk_drag_status(context, clip.IsAccepted() ? clip.GetAction() == DND_MOVE ? GDK_ACTION_MOVE
	                                                                          : GDK_ACTION_COPY
	                                           : GdkDragAction(0), time);
	return clip;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:32,代码来源:GtkDnD.cpp

示例11: LLOG

void Ctrl::WndUpdate(const Rect& r)
{
	GuiLock __;
	LLOG("WndUpdate " << UPP::Name(this));
	Ctrl *top = GetTopCtrl();
	if(top->IsOpen()) {
		HWND hwnd = top->GetHWND();
		HDC hdc = GetDC(hwnd);
		HRGN hrgn = CreateRectRgn(0, 0, 0, 0);
		if(GetUpdateRgn(hwnd, hrgn, FALSE) != NULLREGION) {
			SelectClipRgn(hdc, hrgn);
			SystemDraw draw(hdc);
			bool hcr = focusCtrl && focusCtrl->GetTopCtrl() == top &&
			           caretRect.Intersects(r + top->GetRect().TopLeft());
			if(hcr) ::HideCaret(hwnd);
			draw.Clip(r);
			top->UpdateArea(draw, r);
			ValidateRect(hwnd, r);
			SelectClipRgn(hdc, NULL);
			if(hcr) ::ShowCaret(hwnd);
		}
		ReleaseDC(hwnd, hdc);
		DeleteObject(hrgn);
	}
}
开发者ID:koz4k,项目名称:soccer,代码行数:25,代码来源:Win32Wnd.cpp

示例12: GetActiveCtrl

void Ctrl::PopUp(Ctrl *owner, bool savebits, bool activate, bool dropshadow, bool topmost)
{
	popup = false;
	Ctrl *q = owner ? owner->GetTopCtrl() : GetActiveCtrl();
	PopUpHWND(q ? q->GetHWND() : NULL, savebits, activate, dropshadow, topmost);
	if(top) top->owner = owner;
}
开发者ID:koz4k,项目名称:soccer,代码行数:7,代码来源:Win32Wnd.cpp

示例13: EnterGuiMutex

ViewDraw::ViewDraw(Ctrl *ctrl)
{
	EnterGuiMutex();
	Ctrl *top = ctrl->GetTopCtrl();
	cr = gdk_cairo_create(top->gdk());
	Clipoff(ctrl->GetScreenView() - top->GetScreenRect().TopLeft());
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:7,代码来源:GtkWnd.cpp

示例14: layout

VisGenDlg::VisGenDlg(LayoutData& layout, const Vector<int>& cursor)
:	layout(layout)
{
	type <<= 0;
	CtrlLayoutOKCancel(*this, "Code generator");
	type <<= THISBACK(Type);

	// needs to be before Refresh to maintain the proper order of action
	toupper1 << [=] { tolower1 <<= false; initcaps1 <<= false; };
	tolower1 << [=] { toupper1 <<= false; initcaps1 <<= false; };
	initcaps1 << [=] { toupper1 <<= false; tolower1 <<= false; };

	toupper2 << [=] { tolower2 <<= false; initcaps2 <<= false; };
	tolower2 << [=] { toupper2 <<= false; initcaps2 <<= false; };
	initcaps2 << [=] { toupper2 <<= false; tolower2 <<= false; };

	for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
		if(dynamic_cast<Option *>(q))
			*q << [=] { Refresh(); };
			
	name << [=] { Refresh(); };
	

	Refresh();
	view.Highlight("cpp");
	view.HideBar();
	view.SetFont(CourierZ(12));
	if(cursor.GetCount())
		sel <<= cursor;
	else
		for(int i = 0; i < layout.item.GetCount(); i++)
			sel.Add(i);
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:33,代码来源:visgen.cpp

示例15: GetCtrl

Image DockCont::GetHighlightImage()
{
	Ctrl *ctrl = GetCtrl(GetCursor());
	ImageDraw img(ctrl->GetRect().GetSize());
	ctrl->DrawCtrlWithParent(img);
	return img;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:DockCont.cpp


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