本文整理汇总了C++中Show函数的典型用法代码示例。如果您正苦于以下问题:C++ Show函数的具体用法?C++ Show怎么用?C++ Show使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Show函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SCH_BASE_FRAME
LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
const wxString& aLibraryName ) :
SCH_BASE_FRAME( aKiway, aParent, aFrameType, _( "Symbol Library Browser" ),
wxDefaultPosition, wxDefaultSize,
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_STYLE_MODAL : LIB_VIEW_STYLE,
aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_NAME_MODAL : LIB_VIEW_NAME ),
m_libList( nullptr ),
m_cmpList( nullptr ),
m_previewItem( nullptr )
{
wxASSERT( aFrameType == FRAME_SCH_VIEWER || aFrameType == FRAME_SCH_VIEWER_MODAL );
if( aFrameType == FRAME_SCH_VIEWER_MODAL )
SetModal( true );
// Force the frame name used in config. the lib viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),
// but only one configuration is preferable.
m_configFrameName = LIB_VIEW_NAME;
// Give an icon
wxIcon icon;
icon.CopyFromBitmap( KiBitmap( library_browse_xpm ) );
SetIcon( icon );
m_hotkeysDescrList = g_Viewlib_Hotkeys_Descr;
m_libListWidth = 200;
m_cmpListWidth = 300;
m_listPowerCmpOnly = false;
SetShowElectricalType( true );
// Initialize grid id to the default value (50 mils):
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
SetScreen( new SCH_SCREEN( aKiway ) );
GetScreen()->m_Center = true; // Axis origin centered on screen.
LoadSettings( config() );
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
// Menu bar is not mandatory: uncomment/comment the next line
// to add/remove the menubar
ReCreateMenuBar();
ReCreateHToolbar();
ReCreateVToolbar();
m_libList = new wxListBox( this, ID_LIBVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_HSCROLL | wxNO_BORDER );
m_cmpList = new wxListBox( this, ID_LIBVIEW_CMP_LIST, wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_HSCROLL | wxNO_BORDER );
if( aLibraryName.empty() )
{
ReCreateListLib();
}
else
{
m_libraryName = aLibraryName;
m_entryName.Clear();
m_unit = 1;
m_convert = 1;
}
m_selection_changed = false;
DisplayLibInfos();
m_auimgr.SetManagedWindow( this );
m_auimgr.SetArtProvider( new EDA_DOCKART( this ) );
// Manage main toolbar
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
m_auimgr.AddPane( m_libList, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(3)
.CaptionVisible( false ).MinSize( 80, -1 ).BestSize( m_libListWidth, -1 ) );
m_auimgr.AddPane( m_cmpList, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1)
.CaptionVisible( false ).MinSize( 80, -1 ).BestSize( m_cmpListWidth, -1 ) );
m_auimgr.AddPane( m_canvas->GetWindow(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
m_auimgr.GetPane( m_libList ).Show( aLibraryName.empty() );
m_auimgr.Update();
setupTools();
GetToolManager()->RunAction( "common.Control.gridPreset", true, m_LastGridSizeId );
GetToolManager()->RunAction( "common.Control.zoomFitScreen", true );
if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
{
Raise();
Show( true );
}
SyncView();
GetGalCanvas()->GetViewControls()->SetSnapping( true );
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
//.........这里部分代码省略.........
示例2: wxMDIParentFrame
//---------------------------------------------------------
CSAGA_Frame::CSAGA_Frame(void)
: wxMDIParentFrame(NULL, ID_WND_MAIN, SAGA_CAPTION, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxHSCROLL|wxVSCROLL|wxFRAME_NO_WINDOW_MENU)
{
//-----------------------------------------------------
g_pSAGA_Frame = this;
m_nTopWindows = 0;
m_pTopWindows = NULL;
m_pINFO = NULL;
m_pData_Source = NULL;
m_pActive = NULL;
m_pWKSP = NULL;
SG_Set_UI_Callback (Get_Callback());
SetIcon (IMG_Get_Icon(ID_IMG_SAGA_ICON_32));
SetDropTarget (new CSAGA_Frame_DropTarget);
//-----------------------------------------------------
int STATUSBAR_Sizes[STATUSBAR_COUNT] = { -1, -1, 90, 90, 90, -1 };
CreateStatusBar (STATUSBAR_COUNT);
SetStatusWidths (STATUSBAR_COUNT, STATUSBAR_Sizes);
SetStatusBarPane (STATUSBAR_DEFAULT);
StatusBar_Set_Text (_TL("ready"));
m_pProgressBar = ((CSAGA_Frame_StatusBar *)GetStatusBar())->m_pProgressBar;
//-----------------------------------------------------
m_pLayout = new wxAuiManager(this);
m_pLayout->GetArtProvider()->SetColor (wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR,
wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)
);
m_pLayout->GetArtProvider()->SetColor (wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR,
wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)
);
m_pLayout->GetArtProvider()->SetMetric (wxAUI_DOCKART_GRADIENT_TYPE , wxAUI_GRADIENT_NONE);
m_pLayout->GetArtProvider()->SetMetric (wxAUI_DOCKART_CAPTION_SIZE , 14);
m_pLayout->SetFlags(m_pLayout->GetFlags() ^ wxAUI_MGR_TRANSPARENT_DRAG);
// m_pLayout->SetFlags(m_pLayout->GetFlags() ^ wxAUI_MGR_ALLOW_ACTIVE_PANE);
//-----------------------------------------------------
_Bar_Add(m_pINFO = new CINFO (this), 0, 0); m_pINFO ->Add_Pages();
_Bar_Add(m_pWKSP = new CWKSP (this), 2, 1); m_pWKSP ->Add_Pages();
_Bar_Add(m_pData_Source = new CData_Source(this), 2, 1); m_pData_Source ->Add_Pages();
_Bar_Add(m_pActive = new CACTIVE (this), 2, 0); m_pActive ->Add_Pages();
//-----------------------------------------------------
_Create_MenuBar();
//-----------------------------------------------------
m_pTB_Main = _Create_ToolBar();
m_pTB_Map = CVIEW_Map ::_Create_ToolBar();
m_pTB_Map_3D = CVIEW_Map_3D ::_Create_ToolBar();
m_pTB_Layout = CVIEW_Layout ::_Create_ToolBar();
m_pTB_Table = CVIEW_Table ::_Create_ToolBar();
m_pTB_Diagram = CVIEW_Table_Diagram ::_Create_ToolBar();
m_pTB_Histogram = CVIEW_Histogram ::_Create_ToolBar();
m_pTB_ScatterPlot = CVIEW_ScatterPlot ::_Create_ToolBar();
//-----------------------------------------------------
m_pLayout->GetPane(GetClientWindow()).Show().Center();
wxString s;
if( CONFIG_Read(wxT("/FL"), wxT("MANAGER"), s) )
{
m_pLayout->LoadPerspective(s);
}
_Bar_Show(m_pTB_Main, true);
//-----------------------------------------------------
m_pLayout->Update();
#if !defined(_SAGA_LINUX)
Show(true);
#endif
int x, y, dx, dy;
long l;
x = CONFIG_Read(wxT("/FL"), wxT("X" ), l) ? l : -1;
y = CONFIG_Read(wxT("/FL"), wxT("Y" ), l) ? l : -1;
dx = CONFIG_Read(wxT("/FL"), wxT("DX"), l) ? l : 800;
dy = CONFIG_Read(wxT("/FL"), wxT("DY"), l) ? l : 600;
SetSize(x, y, dx, dy);
if( !(CONFIG_Read(wxT("/FL"), wxT("STATE"), l) && l == 0) )
{
Maximize();
}
//.........这里部分代码省略.........
示例3: BWindow
//.........这里部分代码省略.........
the_rect.OffsetBy(rectHOffset + 4,0);
sprintf(buffer,FLOAT_FORMAT, ixMax);
XMaxBox = new BTextControl( the_rect, "xMax", "x-Max", buffer, new BMessage(XMAX_CHG));
XMaxBox->SetTarget(this);
XMaxBox->SetDivider(30);
view->AddChild(XMaxBox);
the_rect.OffsetBy(-(rectHOffset + 4.0f), XMinBox->Bounds().Height() + 4.0f);
sprintf(buffer,FLOAT_FORMAT, iyMin);
YMinBox = new BTextControl( the_rect, "yMin", "y-Min", buffer, new BMessage(YMIN_CHG));
YMinBox->SetTarget(this);
YMinBox->SetDivider(30);
view->AddChild(YMinBox);
the_rect.OffsetBy(rectHOffset + 4.0f, 0.0f);
sprintf(buffer,FLOAT_FORMAT, iyMax);
YMaxBox = new BTextControl( the_rect, "yMax", "y-Max", buffer, new BMessage(YMAX_CHG));
YMaxBox->SetTarget(this);
YMaxBox->SetDivider(30);
view->AddChild(YMaxBox);
the_rect.OffsetBy(-(rectHOffset + 4.0f), YMaxBox->Bounds().Height()+4.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellxStep());
XStepBox = new BTextControl(the_rect,"x step", "x step", buffer, new BMessage(XSTEP_CHG));
XStepBox->SetDivider(35);
XStepBox->SetTarget(this);
// XStepBox->ResizeToPreferred();
view->AddChild(XStepBox);
the_rect.OffsetBy(rectHOffset +4.0f,0.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellyStep());
YStepBox = new BTextControl(the_rect,"y step", "y step", buffer, new BMessage(YSTEP_CHG));
YStepBox->SetDivider(35);
YStepBox->SetTarget(this);
// YStepBox->ResizeToPreferred();
view->AddChild(YStepBox);
the_rect.OffsetBy(-(rectHOffset+4.0f),XStepBox->Bounds().Height()+4.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellThetaStep());
ThetaStepBox = new BTextControl(the_rect,"theta step", "theta step", buffer, new BMessage(THETA_STEP_CHG));
ThetaStepBox->SetDivider(50);
ThetaStepBox->SetTarget(this);
// ThetaStepBox->ResizeToPreferred();
view->AddChild(ThetaStepBox);
the_rect.OffsetBy(0,ThetaStepBox->Bounds().Height()+4.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellThetaStart());
ThetaStartBox = new BTextControl(the_rect,"theta start", "theta start", buffer, new BMessage(THETA_START_CHG));
ThetaStartBox->SetDivider(53);
ThetaStartBox->SetTarget(this);
// ThetaStartBox->ResizeToPreferred();
view->AddChild(ThetaStartBox);
the_rect.OffsetBy(rectHOffset+4.0f,0.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellThetaStop());
ThetaStopBox = new BTextControl(the_rect,"theta stop", "theta stop", buffer, new BMessage(THETA_STOP_CHG));
ThetaStopBox->SetDivider(50);
ThetaStopBox->SetTarget(this);
// ThetaStopBox->ResizeToPreferred();
view->AddChild(ThetaStopBox);
the_rect.OffsetBy(-(rectHOffset+4.0f),ThetaStartBox->Bounds().Height()+4.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellTStep());
TStepBox = new BTextControl(the_rect,"t step", "t step", buffer, new BMessage(T_STEP_CHG));
TStepBox->SetDivider(35);
TStepBox->SetTarget(this);
// TStepBox->ResizeToPreferred();
view->AddChild(TStepBox);
the_rect.OffsetBy(0,TStepBox->Bounds().Height()+4.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellTStart());
TStartBox = new BTextControl(the_rect,"t start", "t start", buffer, new BMessage(T_START_CHG));
TStartBox->SetDivider(35);
TStartBox->SetTarget(this);
// TStartBox->ResizeToPreferred();
view->AddChild(TStartBox);
the_rect.OffsetBy(rectHOffset+4.0f,0.0f);
sprintf(buffer,FLOAT_FORMAT, gState->TellTStop());
TStopBox = new BTextControl(the_rect,"t stop", "t stop", buffer, new BMessage(T_STOP_CHG));
TStopBox->SetDivider(35);
TStopBox->SetTarget(this);
// TStopBox->ResizeToPreferred();
view->AddChild(TStopBox);
gState->UnlockAsReader();
}
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(view);
ResizeTo(XMinBox->Bounds().Width() + XMaxBox->Bounds().Width() + 4.0f + 10.0f, XMinBox->Bounds().Height()*7+4.0f+ 4.0f +4.0f+4.0f+4.0f+4.0f+ 10.0f);
Show();
return;
}
示例4: Show
void PointCloudSettingsControl::show(const bool toBeShown)
{
Show(toBeShown);
}
示例5: GetFontId
// Draws a text in rect.
void GfxText16::Box(const char *text, uint16 languageSplitter, bool show, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId) {
int16 textWidth, maxTextWidth, textHeight, charCount;
int16 offset = 0;
int16 hline = 0;
GuiResourceId previousFontId = GetFontId();
int16 previousPenColor = _ports->_curPort->penClr;
bool doubleByteMode = false;
const char *curTextPos = text;
const char *curTextLine = text;
if (fontId != -1)
SetFont(fontId);
else
fontId = previousFontId;
// Reset reference code rects
_codeRefRects.clear();
_codeRefTempRect.left = _codeRefTempRect.top = -1;
maxTextWidth = 0;
while (*curTextPos) {
// We need to check for Shift-JIS every line
// Police Quest 2 PC-9801 often draws English + Japanese text during the same call
if (g_sci->getLanguage() == Common::JA_JPN) {
if (SwitchToFont900OnSjis(curTextPos, languageSplitter))
doubleByteMode = true;
}
charCount = GetLongest(curTextPos, rect.width(), fontId);
if (charCount == 0)
break;
Width(curTextLine, 0, charCount, fontId, textWidth, textHeight, true);
maxTextWidth = MAX<int16>(maxTextWidth, textWidth);
switch (alignment) {
case SCI_TEXT16_ALIGNMENT_RIGHT:
offset = rect.width() - textWidth;
break;
case SCI_TEXT16_ALIGNMENT_CENTER:
offset = (rect.width() - textWidth) / 2;
break;
case SCI_TEXT16_ALIGNMENT_LEFT:
offset = 0;
break;
default:
warning("Invalid alignment %d used in TextBox()", alignment);
}
_ports->moveTo(rect.left + offset, rect.top + hline);
if (show) {
Show(curTextLine, 0, charCount, fontId, previousPenColor);
} else {
Draw(curTextLine, 0, charCount, fontId, previousPenColor);
}
hline += textHeight;
curTextLine = curTextPos;
}
SetFont(previousFontId);
_ports->penColor(previousPenColor);
if (doubleByteMode) {
// Kanji is written by pc98 rom to screen directly. Because of
// GetLongest() behavior (not cutting off the last char, that causes a
// new line), results in the script thinking that the text would need
// less space. The coordinate adjustment in fontsjis.cpp handles the
// incorrect centering because of that and this code actually shows all
// of the chars - if we don't do this, the scripts will only show most
// of the chars, but the last few pixels won't get shown most of the
// time.
Common::Rect kanjiRect = rect;
_ports->offsetRect(kanjiRect);
kanjiRect.left &= 0xFFC;
kanjiRect.right = kanjiRect.left + maxTextWidth;
kanjiRect.bottom = kanjiRect.top + hline;
kanjiRect.left *= 2; kanjiRect.right *= 2;
kanjiRect.top *= 2; kanjiRect.bottom *= 2;
_screen->copyDisplayRectToScreen(kanjiRect);
}
}
示例6: switch
BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
//if (!m_hDlg) return FALSE;
switch(message)
{
case WM_INITDIALOG:
{
return TRUE;
}
break;
case WM_TIMER:
{
int iPage = TabCtrl_GetCurSel (GetDlgItem(m_hDlg, IDC_LEFTTABS));
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), iPage?SW_NORMAL:SW_HIDE);
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), iPage?SW_HIDE:SW_NORMAL);
}
break;
case WM_NOTIFY:
{
HWND tabs = GetDlgItem(m_hDlg, IDC_LEFTTABS);
NMHDR* pNotifyMessage = NULL;
pNotifyMessage = (LPNMHDR)lParam;
if (pNotifyMessage->hwndFrom == tabs)
{
int iPage = TabCtrl_GetCurSel (tabs);
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), iPage?SW_NORMAL:SW_HIDE);
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), iPage?SW_HIDE:SW_NORMAL);
}
break;
}
case WM_COMMAND:
{
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
switch(LOWORD(wParam))
{
case IDC_SHOWVFPU:
vfpudlg->Show(true);
break;
case IDC_FUNCTIONLIST:
switch (HIWORD(wParam))
{
case CBN_DBLCLK:
case CBN_SELCHANGE:
{
HWND lb = GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ListBox_GetCurSel(lb);
if (n!=-1)
{
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
ptr->gotoAddr(addr);
}
}
break;
};
break;
case IDC_GOTOINT:
switch (HIWORD(wParam))
{
case LBN_SELCHANGE:
{
HWND lb =GetDlgItem(m_hDlg,LOWORD(wParam));
int n = ComboBox_GetCurSel(lb);
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
if (addr != 0xFFFFFFFF)
ptr->gotoAddr(addr);
}
break;
};
break;
case IDC_GO:
{
SetDebugMode(false);
Core_EnableStepping(false);
MainWindow::UpdateMenus();
}
break;
case IDC_STEP:
{
Core_DoSingleStep();
Sleep(1);
_dbg_update_();
ptr->gotoPC();
reglist->redraw();
vfpudlg->Update();
}
break;
case IDC_STEPOVER:
{
SetDebugMode(false);
CBreakPoints::AddBreakPoint(cpu->GetPC()+cpu->getInstructionSize(0),true);
_dbg_update_();
//.........这里部分代码省略.........
示例7: GetWindowText
/*
メインダイアログ用 WM_INITDIALOG 処理ルーチン
*/
BOOL TInstDlg::EvCreate(LPARAM lParam)
{
char title[256], title2[256];
GetWindowText(title, sizeof(title));
::wsprintf(title2, "%s ver%s", title, GetVersionStr());
SetWindowText(title2);
GetWindowRect(&rect);
int cx = ::GetSystemMetrics(SM_CXFULLSCREEN), cy = ::GetSystemMetrics(SM_CYFULLSCREEN);
int xsize = rect.right - rect.left, ysize = rect.bottom - rect.top;
::SetClassLong(hWnd, GCL_HICON, (LONG)::LoadIcon(TApp::GetInstance(), (LPCSTR)SETUP_ICON));
MoveWindow((cx - xsize)/2, (cy - ysize)/2, xsize, ysize, TRUE);
Show();
if (IsWinVista() && !::IsUserAnAdmin() && TIsEnableUAC()) {
HWND hRunas = GetDlgItem(RUNAS_BUTTON);
::SetWindowLong(hRunas, GWL_STYLE, ::GetWindowLong(hRunas, GWL_STYLE)|WS_VISIBLE);
::SendMessage(hRunas, BCM_SETSHIELD, 0, 1);
}
// 現在ディレクトリ設定
char buf[MAX_PATH_U8], setupDir[MAX_PATH_U8];
#ifdef _WIN64
char x86dir[MAX_PATH_U8] = "";
#endif
// Program Filesのパス取り出し
TRegistry reg(HKEY_LOCAL_MACHINE);
if (reg.OpenKey(REGSTR_PATH_SETUP)) {
if (reg.GetStr(REGSTR_PROGRAMFILES, buf, sizeof(buf))) {
MakePath(setupDir, buf, IPMSG_STR);
}
#ifdef _WIN64
if (reg.GetStr(REGSTR_PROGRAMFILESX86, buf, sizeof(buf)))
MakePath(x86dir, buf, IPMSG_STR);
#endif
reg.CloseKey();
}
// 既にセットアップされている場合は、セットアップディレクトリを読み出す
if (reg.OpenKey(REGSTR_PATH_APPPATHS)) {
if (reg.OpenKey(IPMSG_EXENAME)) {
if (reg.GetStr(REGSTR_PATH, buf, sizeof(buf))) {
#ifdef _WIN64
if (strcmp(buf, x86dir))
#endif
strcpy(setupDir, buf);
}
reg.CloseKey();
}
reg.CloseKey();
}
SetDlgItemTextU8(FILE_EDIT, setupDir);
CheckDlgButton(STARTUP_CHECK, 1);
CheckDlgButton(PROGRAM_CHECK, 1);
CheckDlgButton(DESKTOP_CHECK, 1);
CheckDlgButton(EXTRACT_CHECK, 0);
char *p = strstr(GetCommandLine(), "runas=");
if (p) {
runasWnd = (HWND)strtoul(p+6, 0, 16);
if (!runasWnd || !IsWindow(runasWnd)) PostQuitMessage(0);
if ((p = strstr(p, ",imm="))) runasImm = atoi(p+5);
CheckDlgButton(EXTRACT_CHECK, ::IsDlgButtonChecked(runasWnd, EXTRACT_CHECK));
CheckDlgButton(STARTUP_CHECK, ::IsDlgButtonChecked(runasWnd, STARTUP_CHECK));
CheckDlgButton(PROGRAM_CHECK, ::IsDlgButtonChecked(runasWnd, PROGRAM_CHECK));
CheckDlgButton(DESKTOP_CHECK, ::IsDlgButtonChecked(runasWnd, DESKTOP_CHECK));
WCHAR wbuf[MAX_PATH] = L"";
::SendDlgItemMessageW(runasWnd, FILE_EDIT, WM_GETTEXT, MAX_PATH, (LPARAM)wbuf);
SetDlgItemTextU8(FILE_EDIT, WtoU8s(wbuf));
::SendMessage(runasWnd, WM_IPMSG_HIDE, 0, 0);
if (runasImm) {
PostMessage(WM_IPMSG_INSTALL, 0, 0);
}
}
return TRUE;
}
示例8: Show
void cPanelMinimap::OnClose(wxCloseEvent& event)
{
Show(false);
}
示例9: IsVisible
int Win::DoModal()
{
WinID lastParentFC = parent ? parent->lastFocusChild : 0;
bool visibled = IsVisible();
bool enabled = IsEnabled();
try {
if (!visibled) Show();
if (!enabled) Enable(true);
if (parent && type != WT_POPUP) parent->RecalcLayouts();
AppBlock(GetID());
UnblockTree(GetID());
ModalStruct modalStruct;
modal = &modalStruct;
MSG msg;
while (!modalStruct.end)
{
wth_DoEvents();
if (modalStruct.end) break;
if (!PeekMessage(&msg, NULL, 0, 0,PM_NOREMOVE))
{
unsigned waitTime = RunTimers();
if (waitTime > 5000) waitTime = 5000;
if (modalStruct.end) break;
HANDLE thEvent = wthInternalEvent.SignalFD();
DWORD res = MsgWaitForMultipleObjects(1,&thEvent,FALSE, waitTime, QS_ALLINPUT);
if (res == WAIT_TIMEOUT) CheckMousePosition();
continue;
}
if (!GetMessage(&msg, NULL, 0, 0))
break;
DispatchMessage(&msg);
}
modal = 0;
AppUnblock(GetID());
if (!visibled) Hide();
///
if (type == WT_POPUP || type == WT_CHILD && parent)
{
Win *w = GetWinByID(lastParentFC);
if (w) w->SetFocus();
}
return modalStruct.id;
} catch (...) {
modal = 0;
AppUnblock(GetID());
if (!visibled) Hide();
throw;
}
}
示例10: NS_WARNING
VectorImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
if (aWhichFrame > FRAME_MAX_VALUE) {
return DrawResult::BAD_ARGS;
}
if (!aContext) {
return DrawResult::BAD_ARGS;
}
if (mError) {
return DrawResult::BAD_IMAGE;
}
if (!mIsFullyLoaded) {
return DrawResult::NOT_READY;
}
if (mIsDrawing) {
NS_WARNING("Refusing to make re-entrant call to VectorImage::Draw");
return DrawResult::TEMPORARY_ERROR;
}
if (mAnimationConsumers == 0 && mProgressTracker) {
mProgressTracker->OnUnlockedDraw();
}
AutoRestore<bool> autoRestoreIsDrawing(mIsDrawing);
mIsDrawing = true;
float animTime = (aWhichFrame == FRAME_FIRST) ? 0.0f
: mSVGDocumentWrapper->GetCurrentTime();
AutoSVGRenderingState autoSVGState(aSVGContext, animTime,
mSVGDocumentWrapper->GetRootSVGElem());
// Pack up the drawing parameters.
SVGDrawingParameters params(aContext, aSize, aRegion, aFilter,
aSVGContext, animTime, aFlags);
if (aFlags & FLAG_BYPASS_SURFACE_CACHE) {
CreateSurfaceAndShow(params);
return DrawResult::SUCCESS;
}
DrawableFrameRef frameRef =
SurfaceCache::Lookup(ImageKey(this),
VectorSurfaceKey(params.size,
params.svgContext,
params.animationTime));
// Draw.
if (frameRef) {
RefPtr<SourceSurface> surface = frameRef->GetSurface();
if (surface) {
nsRefPtr<gfxDrawable> svgDrawable =
new gfxSurfaceDrawable(surface, ThebesIntSize(frameRef->GetSize()));
Show(svgDrawable, params);
return DrawResult::SUCCESS;
}
// We lost our surface due to some catastrophic event.
RecoverFromLossOfSurfaces();
}
CreateSurfaceAndShow(params);
return DrawResult::SUCCESS;
}
示例11: SVGDrawingCallback
void
VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
{
mSVGDocumentWrapper->UpdateViewportBounds(aParams.viewportSize);
mSVGDocumentWrapper->FlushImageTransformInvalidation();
nsRefPtr<gfxDrawingCallback> cb =
new SVGDrawingCallback(mSVGDocumentWrapper,
nsIntRect(nsIntPoint(0, 0), aParams.viewportSize),
aParams.size,
aParams.flags);
nsRefPtr<gfxDrawable> svgDrawable =
new gfxCallbackDrawable(cb, ThebesIntSize(aParams.size));
// We take an early exit without using the surface cache if too large,
// because for vector images this can cause bad perf issues if large sizes
// are scaled repeatedly (a rather common scenario) that can quickly exhaust
// the cache.
// Similar to max image size calculations, this has a max cap and size check.
// max cap = 8000 (pixels); size check = 5% of cache
int32_t maxDimension = 8000;
int32_t maxCacheElemSize = (gfxPrefs::ImageMemSurfaceCacheMaxSizeKB() * 1024) / 20;
bool bypassCache = bool(aParams.flags & FLAG_BYPASS_SURFACE_CACHE) ||
// Refuse to cache animated images:
// XXX(seth): We may remove this restriction in bug 922893.
mHaveAnimations ||
// The image is too big to fit in the cache:
!SurfaceCache::CanHold(aParams.size) ||
// Image x or y is larger than our cache cap:
aParams.size.width > maxDimension ||
aParams.size.height > maxDimension;
if (!bypassCache) {
// This is separated out to make sure width and height are sane at this point
// and the result can't overflow. Note: keep maxDimension low enough so that
// (maxDimension)^2 x 4 < INT32_MAX.
// Assuming surface size for any rendered vector image is RGBA, so 4Bpp.
bypassCache = (aParams.size.width * aParams.size.height * 4) > maxCacheElemSize;
}
if (bypassCache)
return Show(svgDrawable, aParams);
// Try to create an imgFrame, initializing the surface it contains by drawing
// our gfxDrawable into it. (We use FILTER_NEAREST since we never scale here.)
nsRefPtr<imgFrame> frame = new imgFrame;
nsresult rv =
frame->InitWithDrawable(svgDrawable, ThebesIntSize(aParams.size),
SurfaceFormat::B8G8R8A8,
GraphicsFilter::FILTER_NEAREST, aParams.flags);
// If we couldn't create the frame, it was probably because it would end
// up way too big. Generally it also wouldn't fit in the cache, but the prefs
// could be set such that the cache isn't the limiting factor.
if (NS_FAILED(rv))
return Show(svgDrawable, aParams);
// Take a strong reference to the frame's surface and make sure it hasn't
// already been purged by the operating system.
RefPtr<SourceSurface> surface = frame->GetSurface();
if (!surface)
return Show(svgDrawable, aParams);
// Attempt to cache the frame.
SurfaceCache::Insert(frame, ImageKey(this),
VectorSurfaceKey(aParams.size,
aParams.svgContext,
aParams.animationTime),
Lifetime::Transient);
// Draw.
nsRefPtr<gfxDrawable> drawable =
new gfxSurfaceDrawable(surface, ThebesIntSize(aParams.size));
Show(drawable, aParams);
}
示例12: wxFrame
//.........这里部分代码省略.........
m_nodeAddr[ 11 ] = 0;
m_nodeAddr[ 10 ] = 0;
m_nodeAddr[ 9 ] = 0;
m_nodeAddr[ 8 ] = 0; // Ethernet MAC MSB
m_nodeAddr[ 7 ] = 0xfe;
m_nodeAddr[ 6 ] = 0xff;
m_nodeAddr[ 5 ] = 0xff;
m_nodeAddr[ 4 ] = 0xff;
m_nodeAddr[ 3 ] = 0xff;
m_nodeAddr[ 2 ] = 0xff;
m_nodeAddr[ 1 ] = 0xff;
m_nodeAddr[ 0 ] = 0xff;
// Default group
m_zone = 0;
// Set address from MAC address
getMacAddress();
m_secondCounter = 0;
// create the status line
const int widths[] = { -1, 60, 60 };
CreateStatusBar( 3 );
SetStatusWidths( 3, widths );
wxLogStatus( this, wxT("Dimmer") );
///////////////////////////////////////////////////////////////////////////
// Persistent storage first time initialization
///////////////////////////////////////////////////////////////////////////
// Make a menubar
// --------------
// file submenu
wxMenu *menuFile = new wxMenu;
menuFile->Append( MenuAbout, wxT("&About...\tF1") );
menuFile->AppendSeparator();
menuFile->Append( MenuQuit, wxT("E&xit\tAlt-X") );
// tools submenu
//wxMenu *menuTools = new wxMenu;
//menuTools->Append( MenuTest, wxT("Testa OLE System\tCtrl-M") );
// options submenu
wxMenu *menuOptions = new wxMenu;
menuOptions->Append( MenuOptions, wxT("&General Settings...\tF10") );
// put it all together
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append( menuFile, wxT("&File") );
menu_bar->Append( menuOptions, wxT("&Settings") );
SetMenuBar( menu_bar );
// make a panel with some controls
m_panel = new wxPanel( this, -1, wxPoint( 0, 0 ), wxSize(400, 200), wxTAB_TRAVERSAL);
// create buttons for moving the items around
m_buttonDown = new wxButton( m_panel, BtnDown, wxT("<<"), wxPoint( 420, 60 ) );
m_buttonUp = new wxButton( m_panel, BtnUp, wxT(">>"), wxPoint( 420, 90 ) );
m_buttonOff = new wxButton( m_panel, BtnOff, wxT("O&ff"), wxPoint( 420, 120 ) );
m_buttonOn = new wxButton( m_panel, BtnOn, wxT("&On"), wxPoint( 420, 120 ) );
// Sizer for the listbox
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
// Sizer for the buttons
wxBoxSizer *bottomsizer1 = new wxBoxSizer( wxHORIZONTAL );
bottomsizer1->Add( m_buttonDown, 0, wxALL, 10 );
bottomsizer1->Add( m_buttonUp, 0, wxALL, 10 );
wxBoxSizer *bottomsizer2 = new wxBoxSizer( wxHORIZONTAL );
bottomsizer2->Add( m_buttonOff, 0, wxALL, 10 );
bottomsizer2->Add( m_buttonOn, 0, wxALL, 10 );
mainsizer->Add( bottomsizer1, 0, wxCENTER );
mainsizer->Add( bottomsizer2, 0, wxCENTER );
// tell frame to make use of sizer (or constraints, if any)
m_panel->SetAutoLayout( TRUE );
m_panel->SetSizer( mainsizer );
// don't allow frame to get smaller than what the sizers tell ye
mainsizer->SetSizeHints( this );
if ( !m_vscpif.doCmdOpen() ) {
wxMessageBox( _T("Failed to contact the VSCP daemon") );
Close( TRUE );
}
// Initialize timeevents
m_timer.SetOwner( this, RefreshTimer );
m_timer.Start( 200 ); // set timer interval
Show( TRUE );
}
示例13: AfxRegisterWndClass
BOOL CProgressWnd::Create(CWnd* pParent, LPCTSTR pszTitle, BOOL bSmooth /* = FALSE */)
{
BOOL bSuccess;
m_strTitle = pszTitle;
// Register window class
CString csClassName = AfxRegisterWndClass(CS_OWNDC|CS_HREDRAW|CS_VREDRAW,
::LoadCursor(NULL, IDC_APPSTARTING),
CBrush(::GetSysColor(COLOR_BTNFACE)));
// Get the system window message font for use in the cancel button and text area
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
m_font.CreateFontIndirect(&(ncm.lfMessageFont));
// If no parent supplied then try and get a pointer to it anyway
if (!pParent)
pParent = AfxGetMainWnd();
// Create popup window
//bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style
bSuccess = CreateEx(WS_EX_DLGMODALFRAME,
csClassName, // Classname
pszTitle, // Title
WS_POPUP|WS_BORDER|WS_CAPTION, // style
0,0, // position - updated soon.
390,130, // Size - updated soon
pParent->GetSafeHwnd(), // handle to parent
0, // No menu
NULL);
if (!bSuccess) return FALSE;
// Now create the controls
CRect TempRect(0,0,10,10);
bSuccess = m_Text.Create(_T(""), WS_CHILD|WS_VISIBLE|SS_NOPREFIX|SS_LEFTNOWORDWRAP,
TempRect, this, IDC_TEXT);
if (!bSuccess) return FALSE;
DWORD dwProgressStyle = WS_CHILD|WS_VISIBLE;
#ifdef PBS_SMOOTH
if (bSmooth)
dwProgressStyle |= PBS_SMOOTH;
#endif
bSuccess = m_wndProgress.Create(dwProgressStyle,TempRect, this, IDC_PROGRESS);
if (!bSuccess) return FALSE;
bSuccess = m_CancelButton.Create(m_strCancelLabel,
WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON,
TempRect, this, IDC_CANCEL);
if (!bSuccess) return FALSE;
m_CancelButton.SetFont(&m_font, TRUE);
m_Text.SetFont(&m_font, TRUE);
// Resize the whole thing according to the number of text lines, desired window
// width and current font.
SetWindowSize(m_nNumTextLines, 390);
// Center and show window
if (m_bPersistantPosition)
GetPreviousSettings();
else
CenterWindow();
Show();
return TRUE;
}
示例14: Show
void Stack::ShowAll()
{
if (!m_widgets.empty())
m_widgets.top()->ShowAll();
Show();
}
示例15: Show
void ToolBarMiniFrame::DoShow(bool visible)
{
Show(visible);
}