void CreateListViewCanvas(bool bFamily) { KListViewCanvas * pList = new KListViewCanvas(bFamily); if ( pList ) if ( pList->Initialize(m_hInst, m_pStatus, m_hWnd) ) if ( bFamily ) CreateMDIChild(pList, _T("ListViewCanvas"), _T("Font Families")); else CreateMDIChild(pList, _T("ListViewCanvas"), _T("Fonts")); else delete pList; }
BOOL CreatePageCanvas(const TCHAR * Title) { KPageCanvas * pCanvas; pCanvas = new KTestPageCanvas(GetSysColorBrush(COLOR_BTNSHADOW)); if ( pCanvas ) { if ( pCanvas->Initialize(m_hInst, m_pStatus, IDR_DEMO) ) { CreateMDIChild(pCanvas, pCanvas->GetClassName(), Title); return TRUE; } delete pCanvas; } return FALSE; }
void __fastcall TMainForm::FileNew1Execute(TObject *Sender) { if (IdTCPServer1->Active == true || IdTCPClient1->Connected() == true) { CreateMDIChild("Active Game"); if(IdTCPServer1->Active == true){ TList *List = IdTCPServer1->Threads->LockList(); try { TIdPeerThread *Thread; for(int x = 0; x < List->Count; ++x) { Thread = (TIdPeerThread*) List->Items[x]; Thread->Connection->WriteLn("/new"); } } __finally { MainForm->IdTCPServer1->Threads->UnlockList(); } } else {
BOOL CreateCanvas(KView * pView, const TCHAR * Title) { if ( pView==NULL ) return FALSE; KMDICanvas * pCanvas = new KMDICanvas(); if ( pCanvas ) { if ( pCanvas->Initialize(m_hInst, m_pStatus, pView, IDR_DIBVIEW, IDI_FONT) ) { CreateMDIChild(pCanvas, pCanvas->GetClassName(), Title); return TRUE; } delete pCanvas; } delete pView; return FALSE; }