[commit] r1713 - trunk/GME/ObjectInspector

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Dec 1 10:41:10 CST 2011


Author: ksmyth
Date: Thu Dec  1 10:41:09 2011
New Revision: 1713

Log:
Fix combobox dropdown height for high DPI. Fix color popup "default" button. Fix combobox click outside when activated

Modified:
   trunk/GME/ObjectInspector/ColourPopup.cpp
   trunk/GME/ObjectInspector/ColourPopup.h
   trunk/GME/ObjectInspector/ComboBoxSelectDlg.cpp
   trunk/GME/ObjectInspector/CompassOptDlg.cpp
   trunk/GME/ObjectInspector/InPlaceManager.cpp
   trunk/GME/ObjectInspector/InspectorDefs.h
   trunk/GME/ObjectInspector/InspectorDlg.cpp
   trunk/GME/ObjectInspector/InspectorList.cpp
   trunk/GME/ObjectInspector/InspectorList.h

Modified: trunk/GME/ObjectInspector/ColourPopup.cpp
==============================================================================
--- trunk/GME/ObjectInspector/ColourPopup.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/ColourPopup.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -42,7 +42,6 @@
 static char THIS_FILE[] = __FILE__;
 #endif
 
-#define DEFAULT_BOX_VALUE -3
 #define CUSTOM_BOX_VALUE  -2
 #define INVALID_COLOUR    -1
 

Modified: trunk/GME/ObjectInspector/ColourPopup.h
==============================================================================
--- trunk/GME/ObjectInspector/ColourPopup.h	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/ColourPopup.h	Thu Dec  1 10:41:09 2011	(r1713)
@@ -24,6 +24,7 @@
 
 #include "resource.h"
 
+#define DEFAULT_BOX_VALUE -3
 
 // To hold the colours and their names
 typedef struct {

Modified: trunk/GME/ObjectInspector/ComboBoxSelectDlg.cpp
==============================================================================
--- trunk/GME/ObjectInspector/ComboBoxSelectDlg.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/ComboBoxSelectDlg.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -57,20 +57,13 @@
 
 BOOL CComboBoxSelectDlg::OnNcActivate(BOOL bActive)
 {
-	if(m_bInited)
-	{
-		m_bInited=false;
-	}
-	else
-	{
-		if (!bActive && !m_bClosed) {
-			m_bClosed = true;
-			EndDialog(IDCANCEL);
-			DWORD pos = GetMessagePos();
-			CPoint msgPoint(LOWORD(pos), HIWORD(pos));
-			RelayMouseClickToInspectorList(m_pParentWnd, msgPoint);
-		}
-		// OnOK();
+	if (!bActive && !m_bClosed) {
+		m_bClosed = true;
+		EndDialog(IDCANCEL);
+		DWORD pos = GetMessagePos();
+		CPoint msgPoint(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
+		// FIXME: this doesn't work correctly
+		//RelayMouseClickToInspectorList(m_pParentWnd, msgPoint);
 	}
 	return FALSE;//CDialog::OnNcActivate(bActive);
 }
@@ -80,7 +73,7 @@
 	CDialog::OnInitDialog();
 
 	SetWindowPos( NULL, m_RectBound.left, m_RectBound.top, m_RectBound.Width(), m_RectBound.Height(), SWP_NOZORDER );
-	CRect rect( 0, 0, m_RectBound.Width(), m_RectBound.Height() + INSP_COMBOBOX_LINE_HEIGHT );
+	CRect rect( 0, 0, m_RectBound.Width(), m_RectBound.Height() + 13 /* FIXME: m_ComboboxLineHeight */ );
 	m_lstBox.Create( LBS_NOTIFY | WS_VSCROLL, rect, this, IDC_COMBO_LISTBOX );
 	m_lstBox.SetFont( m_pFontWnd );
 

Modified: trunk/GME/ObjectInspector/CompassOptDlg.cpp
==============================================================================
--- trunk/GME/ObjectInspector/CompassOptDlg.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/CompassOptDlg.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -92,7 +92,7 @@
 			m_bClosed = true;
 			EndDialog(IDCANCEL);
 			DWORD pos = GetMessagePos();
-			CPoint msgPoint(LOWORD(pos), HIWORD(pos));
+			CPoint msgPoint(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
 			RelayMouseClickToInspectorList(m_pParentWnd, msgPoint);
 		}
 		// OnOK();

Modified: trunk/GME/ObjectInspector/InPlaceManager.cpp
==============================================================================
--- trunk/GME/ObjectInspector/InPlaceManager.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/InPlaceManager.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -228,8 +228,15 @@
 
 	if(dlg.DoModal()==IDOK)
 	{
-		ListItem.Value.SetColorValue(dlg.GetSelectedColor());
-		ListItem.SetDirty();
+		if (dlg.m_nCurrentSel == DEFAULT_BOX_VALUE)
+		{
+			ListItem.RestoreDefault();
+		}
+		else
+		{
+			ListItem.Value.SetColorValue(dlg.GetSelectedColor());
+			ListItem.SetDirty();
+		}
 
 		m_pInspectorList->NotifyParent(m_nCurrentIndex);
 
@@ -545,13 +552,13 @@
 
 	case ITEMDATA_BOOLEAN:
 		{
-			rectWnd.bottom+=2*INSP_COMBOBOX_LINE_HEIGHT + 2; // +INSP_COMBOBOX_OFFSET;
+			rectWnd.bottom += 2 * m_pInspectorList->m_ComboboxLineHeight + 2;
 			DisplayCombo(rectWnd);
 		}break;
 	case ITEMDATA_FIXED_LIST:
 		{
-			rectWnd.bottom+=
-			  min( ListItem.Value.stringVal.GetSize(), 6 )*INSP_COMBOBOX_LINE_HEIGHT + 2; //+INSP_COMBOBOX_OFFSET;
+			rectWnd.bottom += min(ListItem.Value.stringVal.GetSize(), 8) 
+				* m_pInspectorList->m_ComboboxLineHeight + 2;
 			DisplayCombo(rectWnd);
 		}break;
 

Modified: trunk/GME/ObjectInspector/InspectorDefs.h
==============================================================================
--- trunk/GME/ObjectInspector/InspectorDefs.h	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/InspectorDefs.h	Thu Dec  1 10:41:09 2011	(r1713)
@@ -31,9 +31,6 @@
 typedef enum { INSP_ATTR_PANEL=0, INSP_PREF_PANEL, INSP_PROP_PANEL, INSP_PANEL_NUM } InspPanelID;
 
 
-#define INSP_COMBOBOX_LINE_HEIGHT		13
-#define INSP_COMBOBOX_OFFSET			 6
-
 #define INSP_COLORBOX_SIZE				13
 #define INSP_COLORBOX_MARGIN			 2
 

Modified: trunk/GME/ObjectInspector/InspectorDlg.cpp
==============================================================================
--- trunk/GME/ObjectInspector/InspectorDlg.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/InspectorDlg.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -204,7 +204,7 @@
 		m_inspectorSheet.GetClientRect(&listRect);
 		m_inspectorSheet.AdjustRect(FALSE, &listRect);
 		m_inspectorLists[i]->Create(WS_CHILD | WS_VISIBLE, listRect,&m_inspectorSheet,IDC_INSPECTOR_LIST0+i);
-		m_inspectorLists[i]->ShowWindow(FALSE);
+		m_inspectorLists[i]->ShowWindow(SW_HIDE);
 	}
 
 
@@ -348,7 +348,7 @@
 {
 	CWnd *checkBox = GetDlgItem(IDC_CHECK_KIND);
 
-	m_inspectorLists[m_currentPanel]->ShowWindow(FALSE);
+	m_inspectorLists[m_currentPanel]->ShowWindow(SW_HIDE);
 
 	if(m_bIsPanelVisible[panel])
 	{

Modified: trunk/GME/ObjectInspector/InspectorList.cpp
==============================================================================
--- trunk/GME/ObjectInspector/InspectorList.cpp	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/InspectorList.cpp	Thu Dec  1 10:41:09 2011	(r1713)
@@ -20,10 +20,12 @@
 {
 	m_bIsDividerDrag=FALSE;
 	m_ItemHeight = 16;
+	m_ComboboxLineHeight = 13;
 	HDC hdc = ::GetDC(NULL);
 	if (hdc)
 	{
 		m_ItemHeight = m_ItemHeight * GetDeviceCaps(hdc, LOGPIXELSY) / 96;
+		m_ComboboxLineHeight = m_ComboboxLineHeight * GetDeviceCaps(hdc, LOGPIXELSY) / 96;
 		::ReleaseDC(NULL, hdc);
 	}
 }

Modified: trunk/GME/ObjectInspector/InspectorList.h
==============================================================================
--- trunk/GME/ObjectInspector/InspectorList.h	Thu Dec  1 10:40:49 2011	(r1712)
+++ trunk/GME/ObjectInspector/InspectorList.h	Thu Dec  1 10:41:09 2011	(r1713)
@@ -118,6 +118,7 @@
 	CListItemArray m_ListItemArray;
 
 	int m_ItemHeight;
+	int m_ComboboxLineHeight;
 };
 
 /////////////////////////////////////////////////////////////////////////////


More information about the gme-commit mailing list