本文整理汇总了C++中TopWindow类的典型用法代码示例。如果您正苦于以下问题:C++ TopWindow类的具体用法?C++ TopWindow怎么用?C++ TopWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TopWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void WindowManager::show( TopWindow &rWindow ) const
{
rWindow.show();
if( isOpacityNeeded() )
rWindow.setOpacity( m_alpha );
}
示例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;
}
示例3: 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();
}
示例4: getWindow
void GenericLayout::refreshRect( int x, int y, int width, int height )
{
// Do nothing if the layout is hidden
if( !m_visible )
return;
// update the transparency global mask
m_pImage->clear( x, y, width, height );
// Draw all the controls of the layout
std::list<LayeredControl>::const_iterator iter;
for( iter = m_controlList.begin(); iter != m_controlList.end(); ++iter )
{
CtrlGeneric *pCtrl = (*iter).m_pControl;
if( pCtrl->isVisible() )
{
pCtrl->draw( *m_pImage, x, y, width, height );
}
}
// Refresh the associated window
TopWindow *pWindow = getWindow();
if( pWindow )
{
// first apply new shape to the window
pWindow->updateShape();
pWindow->invalidateRect( x, y, width, height );
}
}
示例5: msg_Dbg
void Theme::saveConfig()
{
msg_Dbg( getIntf(), "saving theme configuration");
map<string, TopWindowPtr>::const_iterator itWin;
map<string, GenericLayoutPtr>::const_iterator itLay;
ostringstream outStream;
for( itWin = m_windows.begin(); itWin != m_windows.end(); itWin++ )
{
TopWindow *pWin = itWin->second.get();
// Find the layout id for this window
string layoutId;
const GenericLayout *pLayout = &pWin->getActiveLayout();
for( itLay = m_layouts.begin(); itLay != m_layouts.end(); itLay++ )
{
if( itLay->second.get() == pLayout )
{
layoutId = itLay->first;
}
}
outStream << '[' << itWin->first << ' ' << layoutId << ' '
<< pWin->getLeft() << ' ' << pWin->getTop() << ' '
<< pLayout->getWidth() << ' ' << pLayout->getHeight() << ' '
<< (pWin->getVisibleVar().get() ? 1 : 0) << ']';
}
// Save config to file
config_PutPsz( getIntf(), "skins2-config", outStream.str().c_str() );
}
示例6: getIntf
void GenericLayout::resize( int width, int height )
{
// Update the window size
m_width = width;
m_height = height;
// Recreate a new image
if( m_pImage )
{
delete m_pImage;
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
m_pImage = pOsFactory->createOSGraphics( width, height );
}
// Notify all the controls that the size has changed and redraw them
list<LayeredControl>::const_iterator iter;
for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ )
{
iter->m_pControl->onResize();
}
// Resize and refresh the associated window
TopWindow *pWindow = getWindow();
if( pWindow )
{
// Resize the window
pWindow->resize( width, height );
refreshAll();
// Change the shape of the window and redraw it
pWindow->updateShape();
refreshAll();
}
}
示例7: SyncTopWindows
void Ctrl::SyncTopWindows()
{
for(int i = 0; i < topctrl.GetCount(); i++) {
TopWindow *w = dynamic_cast<TopWindow *>(topctrl[i]);
if(w)
w->SyncRect();
}
}
示例8: GetTopWindow
void Pdb::ToForeground()
{
TopWindow *w = GetTopWindow();
if(w && !w->IsForeground()) {
LLOG("Setting theide as foreground");
w->SetForeground();
}
}
示例9: CursorImage
Image SizeGrip::CursorImage(Point p, dword)
{
if(GuiPlatformHasSizeGrip()) {
TopWindow *q = dynamic_cast<TopWindow *>(GetTopCtrl());
if(q && !q->IsMaximized() && q->IsSizeable())
return Image::SizeBottomRight();
}
return Image::Arrow();
}
示例10: getWindow
void CtrlGeneric::notifyTooltipChange() const
{
TopWindow *pWin = getWindow();
if( pWin )
{
// Notify the window
pWin->onTooltipChange( *this );
}
}
示例11:
void Ctrl::WndSetPos0(const Rect& rect)
{
GuiLock __;
TopWindow *w = dynamic_cast<TopWindow *>(this);
if(w)
w->SyncFrameRect(rect);
invalid.Add(GetRect());
SetWndRect(rect);
invalid.Add(rect);
}
示例12: sExecutePrompt
void sExecutePrompt(PromptDlgWnd__ *dlg, int *result)
{
dlg->Open();
Vector<Ctrl *> wins = Ctrl::GetTopWindows();
for(int i = 0; i < wins.GetCount(); i++) {
TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
if(w && w->IsTopMost()) {
dlg->TopMost();
break;
}
}
*result = dlg->RunAppModal();
}
示例13: GetSize
void SizeGrip::Paint(Draw& w)
{
Size sz = GetSize();
if(!IsTransparent())
w.DrawRect(sz, SColorFace);
if(GuiPlatformHasSizeGrip()) {
TopWindow *q = dynamic_cast<TopWindow *>(GetTopCtrl());
if(q && !q->IsMaximized() && q->IsSizeable()) {
Size isz = CtrlsImg::SizeGrip().GetSize();
w.DrawImage(sz.cx - isz.cx, sz.cy - isz.cy, CtrlsImg::SizeGrip());
}
}
}
示例14: GetMainWindow
void TopWindow::FixIcons()
{
TopWindow *q = GetMainWindow();
if(q) {
if(IsNull(icon)) {
icon = q->GetIcon();
SyncCaption();
}
if(IsNull(largeicon)) {
largeicon = q->GetIcon();
SyncCaption();
}
}
}
示例15: main
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
TopWindow window;
QTime midnight(0, 0, 0);
qsrand(midnight.secsTo(QTime::currentTime()));
window.setAlgorithm(new Johnson());
window.setWindowTitle(QString::fromUtf8("MPD - projekt 1"));
window.setMinimumSize(640, 400);
window.show();
return app.exec();
}