本文整理汇总了C++中Window::CenterInWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::CenterInWindow方法的具体用法?C++ Window::CenterInWindow怎么用?C++ Window::CenterInWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window::CenterInWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _EditItem
void EditWin::_EditItem( int nIndex )
{
ListViewStringRow *lvr = (ListViewStringRow *)m_pcItems->GetRow( nIndex );
lvr->SetIsSelectable(false);
Window *w = NULL;
switch( m_nType ) {
case T_STRING:
case T_INT16:
case T_INT32:
case T_INT64:
case T_INT8:
case T_FLOAT:
case T_DOUBLE:
case T_POINT:
case T_IPOINT:
case T_RECT:
case T_IRECT:
w = new EditStringWin(Rect(0,0,250, 100), m_cName, lvr->GetString(2), lvr->GetString(1), this);
w->CenterInWindow(this);
break;
case T_MESSAGE:
{
Settings* pcMsg = new Settings(0);
if( m_pcMessage->FindMessage( m_cName.c_str(), (Message *)pcMsg, nIndex ) == 0 ) {
w = new MainWin( Rect(0,0,250, 100), (Message *)pcMsg, this, lvr->GetString(2) );
w->CenterInWindow(this);
}
}
break;
}
if( w ) w->Show();
}
示例2: HandleMessage
/** \brief Message Handling Callback.
* This handles all callbacks to the remote view window.
*/
void RemoteIconView::HandleMessage( Message* pcMessage )
{
switch( pcMessage->GetCode() )
{
case M_REMOTE_DIRLISTING:
{
if( !m_bUpdatePending ) {
DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING while no dirlisting is pending!\n" );
return;
}
String zPath;
if( pcMessage->FindString( "path", &zPath ) != 0 ) {
DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING without path!\n" );
return;
}
if( zPath != m_zPath ) {
DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING with wrong path %s! Expecting %s.\n", zPath.c_str(), m_zPath.c_str() );
return;
}
std::vector< RemoteNode >* pacNodes;
/* The Server creates an array of RemoteNodes and passes us the pointer. We should delete it when done. */
if( pcMessage->FindPointer( "list", (void**)&pacNodes ) ) {
DEBUG( "RemoteIconView: Got REMOTE_DIRLISTING without pointer to data!\n" );
return;
}
bool bInitial;
if( pcMessage->FindBool( "initial", &bInitial ) != 0 ) bInitial = false;
bool bFinal;
if( pcMessage->FindBool( "final", &bFinal ) != 0 ) bFinal = false;
SetContents( pacNodes, bInitial, bFinal );
if( pacNodes ) delete( pacNodes );
break;
}
/* Messages from the context menu */
case M_REMOTE_RENAME:
{
/* Check that only one icon is selected & get the selected icon */
uint nSelectedIcon = -1;
uint nNumSelected = 0;
for( uint i = 0; i < GetIconCount(); i++ ) {
if( GetIconSelected( i ) ) {
nSelectedIcon = i;
nNumSelected++;
}
}
if( nNumSelected != 1 ) {
DEBUG( "RemoteView: Got M_REMOTE_RENAME while %i icons are selected!\n", nNumSelected );
break;
}
RemoteIconData* pcData = (RemoteIconData*)GetIconData( nSelectedIcon );
/* Display rename dialog */
Window* pcDialog = new RenameRequester( pcData->m_cNode.m_zPath, this );
pcDialog->CenterInWindow( GetWindow() );
pcDialog->Show();
pcDialog->MakeFocus( true );
break;
}
case M_REMOTE_DELETE:
{
/* Save a list of the selected files */
std::vector< RemoteNode >* pacDeleteList = new std::vector< RemoteNode >;
for( uint i = 0; i < GetIconCount(); i++ ) {
if( GetIconSelected( i ) ) {
pacDeleteList->push_back( ((RemoteIconData*)GetIconData( i ))->m_cNode );
}
}
if( pacDeleteList->size() == 0 ) {
DEBUG( "RemoteView: Got M_REMOTE_DELETE while no icons are selected!\n" );
delete( pacDeleteList );
break;
}
/* Display confirmation dialog */
Window* pcDialog = new DeleteConfirmDialog( pacDeleteList, this );
pcDialog->CenterInWindow( GetWindow() );
pcDialog->Show();
pcDialog->MakeFocus( true );
break;
}
case M_REMOTE_MKDIR:
{
Window* pcDialog = new MkDirRequester( m_zPath, this );
pcDialog->CenterInWindow( GetWindow() );
pcDialog->Show();
pcDialog->MakeFocus( true );
break;
}
case M_DELETE_CONFIRMED:
{
std::vector< RemoteNode >* pacDeleteList = NULL;
//.........这里部分代码省略.........