#include #include WORD MoreWindowsDialog::performDialog(Block &strLines,String &strWindowText) { mStrLines=strLines; WORD resultCode(::DialogBoxParam(processInstance(),(LPSTR)"MoreWindows",mhParent,(DLGPROC)DWindow::DlgProc,(LONG)((DWindow*)this))); if(resultCode)strWindowText=mSelText; return resultCode; } CallbackData::ReturnType MoreWindowsDialog::initDialogHandler(CallbackData &/*someCallbackData*/) { mListBox=new OwnerDrawListAltColor(*this,getItem(ListBoxID),ListBoxID,RGBColor(255,255,232),RGBColor(192,220,192),RGBColor(0,255,255)); mListBox.disposition(PointerDisposition::Delete); mListBox->show(SW_SHOW); setListBoxList(); return (CallbackData::ReturnType)FALSE; } CallbackData::ReturnType MoreWindowsDialog::dialogCodeHandler(CallbackData &/*someCallbackData*/) { return (CallbackData::ReturnType)DLGC_WANTALLKEYS; } CallbackData::ReturnType MoreWindowsDialog::commandHandler(CallbackData &someCallbackData) { if(LBN_DBLCLK==someCallbackData.wmCommandCommand()) { mListBox->getText(mSelText,mListBox->getCurrent()); endDialog(TRUE); return (CallbackData::ReturnType)FALSE; } switch(someCallbackData.wmCommandID()) { case IDOK : mListBox->getText(mSelText,mListBox->getCurrent()); endDialog(TRUE); break; case IDCANCEL : endDialog(FALSE); break; } return (CallbackData::ReturnType)FALSE; } void MoreWindowsDialog::setListBoxList(void) { mListBox->setRedraw(FALSE); mListBox->resetContent(); for(int index=0;indexinsertString(mStrLines[index]); mListBox->setCurrent(0); mListBox->setRedraw(TRUE); }