tacno smo utvrdili da je problem u toj listi, jer npr ako pomerimo malo te pozvane dijaloge, tako da ne zaklanjaju listu, i vratimo se sa OK, bude dobro. ako ostanu delimicno preko - samo zaklonjen deo liste bude taman.
evo primera
http://i213.photobucket.com/albums/cc181/ves604/komp/a.jpg
http://i213.photobucket.com/albums/cc181/ves604/komp/b.jpg
i
http://i213.photobucket.com/albums/cc181/ves604/komp/c.jpg
http://i213.photobucket.com/albums/cc181/ves604/komp/d.jpg
e sad, ni u jednom trenutku janemam potrebu da ubijam tu listu, zar ne? niti ubijam taj dijalog an kom je lista
deo koda, koji bi ti mogao biti interesantan:
mesto u glavnom dijalogu gde se radi spajanje dijaloga:
Code:
case 0:
dlgInfolist.pCurrDrawing = pCurrDrawing;
dlgInfolist.pDwgBlock = pDwgBlock;
dlgInfolist.vdi = vdi;
dlgInfolist.IsDDC = IsDDC;
if (pdialog) {
DetachChildDialog (pdialog);
}
if (! (AttachChildDialog (&dlgInfolist, &m_FdevEditChild))) {
TricErrorBox(IDS_ERR_FILL_DIALOG);
return FALSE;
//EndDialog (IDCANCEL);
} else {
pdialog = &dlgInfolist;
}
//dlgInfolist.FillDlgCtrl();
dlgInfolist.ShowWindow(TRUE);
break;
u tom prvom child dijalogu, OnInit fja
Code:
BOOL CFdevEditInfolist::OnInitDialog()
{
CTricDialog::OnInitDialog ();
bDlgInfolistActive = TRUE;
dlgDDC_RA.bCheckAutoCalc = pDwgBlock->data.iGE_Status;
//DetachChildDialog (&dlgDDC_RA, &m_DDC_RA);
//if (! (AttachChildDialog (&dlgDDC_RA, &m_DDC_RA) && LoadData () && FillDlgCtrl ())) {
if (GetProject ()->cInfoCalc.GetProInfoCalcData (GetProject ()->ID)) {
if (GetProject ()->cInfoCalc.arrProjectInfoCalc.GetCount () > 0) {
dlgDDC_RA.bAutoCalc = TRUE;
}
}
if (! (AttachChildDialog (&dlgDDC_RA, &m_DDC_RA) && LoadData () )) {
TricErrorBox (IDS_ERR_FILL_DIALOG);
EndDialog (IDCANCEL);
return FALSE;
}
FillDlgCtrl();
return TRUE;
}
OnInit drugog child dijaloga na kom je ta lista
Code:
BOOL CFieldDevicePropsDlg::OnInitDialog ()
{
CTricDialog::OnInitDialog ();
if (!DBConnection.CheckConnection ()) {
TricErrorBox (IDS_ERR_CONECTION);
EndDialog (IDCANCEL);
return FALSE;
}
((CButton*) GetDlgItem (IDC_BTN_VISIBLE))->ShowWindow (bShowVisibleColumn);
listProperties.SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
if (bShowVisibleColumn) {
m_staticImageList.Create (16, 16, ILC_MASK, 0, 1);
m_staticImageList.Add (acedGetAcadWinApp ()->LoadIcon (IDI_OFF));
m_staticImageList.Add (acedGetAcadWinApp ()->LoadIcon (IDI_ON));
listProperties.SetImageList (&m_staticImageList, LVSIL_SMALL);
}
AddControl (IDC_TEXT_CAPTION, sizeResize, sizeNone);
AddControl (IDC_LIST_PROPERTIES, sizeResize, sizeResize, TRUE,TRUE);
AddControl (IDC_CHK_USEFUNCTIONTYPES, sizeResize, sizeRepos, TRUE, TRUE);
AddControl (IDC_CHK_USEAUTOCALC, sizeResize, sizeRepos, TRUE, TRUE);
AddControl (IDC_BTN_EDIT, sizeNone, sizeRepos, FALSE);
if (bShowVisibleColumn) {
AddControl (IDC_BTN_VISIBLE, sizeNone, sizeRepos, FALSE);
}
AddControl (IDC_BTN_SELECTALL, sizeRepos, sizeRepos, FALSE);
AddControl (IDC_BTN_DELESECTALL, sizeRepos, sizeRepos, FALSE);
DisableControls ();
return TRUE;
}
kada se klikne na ono dugme Edit u tom dijalogu:
Code:
void CFieldDevicePropsDlg::OnEdit ()
{
UpdateData ();
// first find out which props are selected
int iCount = listProperties.GetItemCount ();
CTricArray<CFieldDeviceProps*> arrSelected;
int i;
for (i = 0; i < iCount; i++) {
if (listProperties.GetItemState (i, LVIS_SELECTED) == LVIS_SELECTED) {
arrSelected.Add (&arrProps [i]);
}
}
// then edit all of them
for (i = 0; i < arrSelected.GetSize (); i++) {
// This runs the dialog "CDPFunctionSelectDlg()"
SetNumberOfFunctions (*arrSelected [i]/*, _wtoi (strCont) */);
if (arrSelected [i]->GetNumberOfFunctions () > 0) {
arrSelected [i]->SetVisible (1);
}
}
/*::InvalidateRect(listProperties.m_hWnd, NULL, TRUE);
listProperties.UpdateWindow();*/
FillList ();
listProperties.SetFocus();
}
[/QUOTE]
u fji SetNumberOfFunctions iz ove OnEdit se poziva prvi sledeci dijalog:
Code:
BOOL CFieldDevicePropsDlg::SetNumberOfFunctions (CFieldDeviceProps& property/*, int iNumberOfFunctions*/)
{
CDBObjArray<CDPFunction> arrFunctionsEmpty;
if (property.GetCalculate()) {
// We cannot change calculated values!
return TRUE;
}
//the column has functions and are used
if (property.GetVDICol ()->bHasFunctions && bUseFunctioncodes) {
// function codes are used, get available functions for this property
int iPropertyColID = property.GetVDICol ()->data.iVDI_Col_ID;
// let user choose functions for the property
CDPFunctionSelectDlg dlg;
dlg.mode = mode;
dlg.bReadonly = bReadonly;
dlg.mode = mode;
dlg.SetGroup (group);
dlg.SetColumn (*property.GetVDICol ());
if (!property.GetVisible()){
property.SetFunctions(arrFunctionsEmpty);
}
dlg.SetFunctions (property.GetFunctions ());
//dlg.SetNumberOfFunctions (iNumberOfFunctions);
if (dlg.DoModal () != IDOK) {
// user cancelled selection
return FALSE;
}
// user has made selection
property.SetNumberOfFunctions (dlg.GetNumberOfFunctions ());
property.SetFunctions (dlg.GetFunctions ());
//listProperties.Invalidate();
return TRUE;
}
if (bReadonly) {
return TRUE;
}
// get number of functions from user
CString strCont = StringFromLong (property.GetNumberOfFunctions ());
if (!UserInput (strCont, GetString (IDS_LABEL_ENTERNOOFFUNCTIONS),
property.GetVDICol ()->data.strVDI_ColDesc
+ _T(" ")
+ property.GetVDICol ()->data.strVDI_ColShortDesc)) {
return FALSE;
}
int iNumberOfFunctions = _wtoi (strCont);
if (!property.GetVDICol ()->bHasFunctions) {
// this column doesn't have functions
property.SetNumberOfFunctions (iNumberOfFunctions);
return TRUE;
}
// this column has functions but didn't use
if (!bUseFunctioncodes) {
// function codes are not used
CDPFunction funcDefault;
int iPropertyColID;
iPropertyColID = property.GetVDICol ()->data.iVDI_Col_ID;
funcDefault.data.iDPFun_ID = group.GetDefaultFunctionID (iPropertyColID);
if (!funcDefault.Load ()) {
// default function for this property not found!
return FALSE;
}
// adjust functions
CDBObjArray<CDPFunction> arrFunctions;
while (arrFunctions.GetSize () < iNumberOfFunctions) {
arrFunctions.Add (funcDefault);
}
// update property
if (!property.SetFunctions (arrFunctions)) {
return FALSE;
}
if (!property.SetNumberOfFunctions (iNumberOfFunctions)) {
return FALSE;
}
return TRUE;
}
return FALSE;
} // CFieldDevicePropsDlg::SetNumberOfFunctions
a kroz
Code:
if (dlg.DoModal () != IDOK) {
// user cancelled selection
return FALSE;
se poziva onaj poslednji dijalog..
verovatno sam ugusila sad sa ovim kodom :( postajemo bas ocajne nas dve
ostavila sam poruku na jos par foruma, na jednom nasem i na stranskim, codeguru, bilo je nekih ideja ali za ipak drukciji problem.
neko mi je rekao da probamo da sa Spy++ nadjemo sta se desava, ali se sa njim ne snalazimo tako dobro, i na kraju kad je koleginica shvatila sta se tu desava, opet nam je sam ponovilo to da je problem u listi, sto smo i same pronasle pre.