29 #include "../../idlib/precompiled.h"
36 #include "../comafx/DialogColorPicker.h"
41 static char THIS_FILE[] = __FILE__;
59 ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange)
66 ON_CBN_SELCHANGE(IDC_PROPCMBBOX, OnSelchangeCmbBox)
68 ON_EN_CHANGE(IDC_PROPEDITBOX, OnChangeEditBox)
76 if (!CListBox::PreCreateWindow(cs)) {
80 cs.style &= ~(LBS_OWNERDRAWVARIABLE | LBS_SORT);
81 cs.style |= LBS_OWNERDRAWFIXED;
101 lpMeasureItemStruct->itemHeight = (rect.Height() >= 20) ? rect.Height() : 20;
103 lpMeasureItemStruct->itemHeight = 20;
110 dc.Attach(lpDIS->hDC);
111 CRect rectFull = lpDIS->rcItem;
112 CRect rect = rectFull;
117 CRect rect2 = rectFull;
118 rect2.right = rect.left - 1;
119 UINT nIndex = lpDIS->itemID;
121 if (nIndex != (
UINT) -1) {
126 dc.FillSolidRect(rect2,RGB(220,220,220));
128 dc.FillSolidRect(rect2,RGB(192,192,192));
130 dc.DrawEdge(rect2,EDGE_SUNKEN,BF_BOTTOMRIGHT);
131 dc.DrawEdge(rect,EDGE_SUNKEN,BF_BOTTOM);
133 if (lpDIS->itemState == ODS_SELECTED) {
134 dc.DrawFocusRect(rect2);
138 dc.SetBkMode(TRANSPARENT);
139 dc.DrawText(pItem->
m_propName,CRect(rect2.left+3,rect2.top+3,
140 rect2.right-3,rect2.bottom+3),
141 DT_LEFT | DT_SINGLELINE);
144 dc.DrawText(pItem->
m_curValue,CRect(rect.left+3,rect.top+3, rect.right+3,rect.bottom+3), DT_LEFT | (pItem->
m_nItemType ==
PIT_VAR) ? DT_WORDBREAK : DT_SINGLELINE);
151 int nIndex = AddString(txt);
161 int nIndex = AddString(_T(
""));
163 SetItemDataPtr(nIndex,pItem);
168 if (CListBox::OnCreate(lpCreateStruct) == -1) {
187 static int recurse = 0;
212 m_cmbBox.Create(CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_CHILD | WS_BORDER,rect,
this,
IDC_PROPCMBBOX);
224 while ((i2=cmbItems.Find(
'|',i)) != -1) {
225 m_cmbBox.AddString(cmbItems.Mid(i,i2-i));
233 int j =
m_cmbBox.FindStringExact(0,lBoxSelText);
272 if (region.Width() > 25) {
273 region.left = region.right - 25;
292 int c = this->GetCount();
293 for (
int i = 0;
i <
c;
i++) {
299 CListBox::ResetContent();
304 CListBox::OnKillFocus(pNewWnd);
345 sscanf(pItem->
m_curValue,
"%f %f %f", &color.
x, &color.
y, &color.
z);
347 COLORREF cr = (
int)(color.
x * 255) + (((
int)(color.
y * 255))<<8) + (((
int)(color.
z * 255))<<16);
353 if (dlg.DoModal() == IDOK) {
355 color.
y = ((dlg.
GetColor() >> 8)&255)/255.0;
356 color.
z = ((dlg.
GetColor() >> 16)&255)/255.0;
365 CString SelectedFile;
366 CString Filter(
"Gif Files (*.gif)|*.gif||");
371 FileDlg.m_ofn.lpstrTitle =
"Select file";
372 if (currPath.GetLength() > 0) {
373 FileDlg.m_ofn.lpstrInitialDir = currPath.Left(currPath.GetLength() - currPath.ReverseFind(
'\\'));
376 if(IDOK == FileDlg.DoModal()) {
377 SelectedFile = FileDlg.GetPathName();
383 CFontDialog FontDlg(
NULL,CF_EFFECTS | CF_SCREENFONTS,
NULL,
this);
384 if(IDOK == FontDlg.DoModal()) {
385 CString faceName = FontDlg.GetFaceName();
431 if (GetCapture()==
this) {
446 int i = ItemFromPoint(point,loc);
448 CListBox::OnLButtonUp(nFlags, point);
457 GetWindowRect(windowRect);
458 windowRect.left += 10; windowRect.right -= 10;
460 ::ClipCursor(windowRect);
470 GetClientRect(clientRect);
484 CListBox::OnLButtonDown(nFlags, point);
502 CListBox::OnMouseMove(nFlags, point);
507 int nOldMode = pDC->SetROP2(R2_NOT);
510 pDC->SetROP2(nOldMode);
538 CListBox::OnVScroll(nSBCode, nPos, pScrollBar);
void UpdateRadiantColor(float r, float g, float b, float a)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
CONST PIXELFORMATDESCRIPTOR UINT
afx_msg void OnKillFocus(CWnd *pNewWnd)
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg void OnSelchange()
afx_msg void OnKillfocusEditBox()
static CPreviewDlg * ShowModelChooser()
void(* UpdateParent)(float r, float g, float b, float a)
afx_msg void OnChangeEditBox()
void DisplayButton(CRect region)
int AddPropItem(CPropertyItem *pItem)
afx_msg void OnKillfocusCmbBox()
CInspectorDialog * g_Inspectors
const char * ToString(int precision=2) const
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
static CPreviewDlg * ShowMaterialChooser()
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
static CPreviewDlg * ShowGuiChooser()
CPropertyItem * measureItem
afx_msg void OnSelchangeCmbBox()
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual void PreSubclassWindow()
void SetKeyVal(const char *key, const char *val)
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
void InvertLine(CDC *pDC, CPoint ptFrom, CPoint ptTo)