// -----------------------------------------------------------------------
// Properties form init
void CALLBACK FrmUserDiagPropsInitProc(HWND hWnd)
{
    HDC ProphDC = 0;
    SIZE PropSize;
    HGDIOBJ OldPropObject = 0;
    char *Property_Name;
    int i = 0;

    hPropListbox = CreateListBox(1, 20, ControlWidth(hWnd) - 1, ControlHeight(hWnd) - 20, hWnd, 0, &PropListboxHook, 0,
                                 LBS_USETABSTOPS | LBS_OWNERDRAWFIXED | WS_VSCROLL, WS_EX_STATICEDGE);
    hPropCombobox = CreateComboBox(0, 0, ControlWidth(hWnd), 150, hWnd, "", 1, 0, CBS_DROPDOWNLIST | WS_TABSTOP);
    ComboBoxAddItem(hPropCombobox, DialogName + (CStr) " - " + (CStr) "Dialog", -1);
    ComboBoxSetIndex(hPropCombobox, 0);
    FillPropertiesListbox(PROPDIAG_NBRPROPS);
    ProphDC = GetDC(hWnd);
    OldPropObject = SelectObject(ProphDC, WASerifFont);
    MaxPropXSize = 0;
    // Get largest property size
    for(i = 0; i < GetObjectDatas(hCurrentObject, OBJECT_PROPNBR); i++)
    {
        Property_Name = (char *) GetPropertyDatas(hCurrentObject, i, PROPERTY_NAME);
        GetTextExtentPoint32(ProphDC, Property_Name, strlen(Property_Name), &PropSize);
        if(PropSize.cx > MaxPropXSize) MaxPropXSize = PropSize.cx;
    }
    MaxPropXSize = MaxPropXSize + 10;
    SelectObject(ProphDC, OldPropObject);
    ReleaseDC(hWnd, ProphDC);
    ListBoxSetColumnsWidth(hPropListbox, MaxPropXSize);
    ListBoxSetIndex(hPropListbox, 0);
    ListBoxSetTopIndex(hPropListbox, 0);
    // Get the icons
    hPropComboPoints = LoadImage(ApphInstance, MAKEINTRESOURCE(ICON_RES_TOOL_BASE + ICON_RES_TOOL_COMBOPOINTS), IMAGE_ICON, 0, 0, 0);
}
예제 #2
0
void ReportDataHelper::ReadDatas( const CString& name, ArrayVector& datasVector,int unitCount )
{
	AcStringArray getDatas;
	AcDbObjectId objId;
	GDESDataObjectHelper::GetObjectId(name,objId);
	GetObjectDatas(objId,getDatas);
	//AcStringArray strName,strIsRunning,strReason;
	ArrayVector datas;
	int nCount = getDatas.length();
	if(nCount <= 0) return;
	datas.resize( unitCount );
	for(int i = 0;  i < nCount; i = i+2 )
	{
		int j = (i/2)% unitCount;
		datas[j].append(getDatas[i]);
	}

	datasVector.clear();
	for(int i = 0; i < nCount / (2 * unitCount); i++)
	{
		CString temp;
		AcStringArray temps;
		for(int j = 0; j < unitCount; j++)
		{
			temp.Format(_T("%s"),datas[j][i].kACharPtr());
			if(temp == ISNULL) temp = _T("");
			temps.append(temp);
		}
		datasVector.push_back(temps);
	}
}