Browse Source

updated icons for clips that are groups, shortcut keys, in group, don't delete

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@690 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 12 years ago
parent
commit
8dbf3eb999

+ 16 - 0
CP_Main.rc

@@ -992,6 +992,22 @@ IDB_MAXIMIZE_8_8        PNG                     "res\\maximize_8_8.png"
 IDB_MAXIMIZE_10_10      PNG                     "res\\maximize_10_10.png"
 IDB_MAXIMIZE_12_12      PNG                     "res\\maximize_12_12.png"
 IDB_MAXIMIZE_16_16      PNG                     "res\\maximize_16_16.png"
+IDB_YELLOW_STAR_32_32   PNG                     "res\\yellow_star_32_32.png"
+IDB_YELLOW_STAR_24_24   PNG                     "res\\yellow_star_24_24.png"
+IDB_YELLOW_STAR_20_20   PNG                     "res\\yellow_star_20_20.png"
+IDB_YELLOW_STAR_16_16   PNG                     "res\\yellow_star_16_16.png"
+IDB_IN_FOLDER_32_32     PNG                     "res\\in_folder_32_32.png"
+IDB_IN_FOLDER_24_24     PNG                     "res\\in_folder_24_24.png"
+IDB_IN_FOLDER_20_20     PNG                     "res\\in_folder_20_20.png"
+IDB_IN_FOLDER_16_16     PNG                     "res\\in_folder_16_16.png"
+IDB_KEY_32_32           PNG                     "res\\key_stroke_32_32.png"
+IDB_KEY_24_24           PNG                     "res\\key_stroke_24_24.png"
+IDB_KEY_20_20           PNG                     "res\\key_stroke_20_20.png"
+IDB_KEY_16_16           PNG                     "res\\key_stroke_16_16.png"
+IDB_STICKY_32_32        PNG                     "res\\Sticky_32_32.png"
+IDB_STICKY_24_24        PNG                     "res\\Sticky_24_24.png"
+IDB_STICKY_20_20        PNG                     "res\\Sticky_20_20.png"
+IDB_STICKY_16_16        PNG                     "res\\Sticky_16_16.png"
 
 /////////////////////////////////////////////////////////////////////////////
 //

+ 16 - 0
CP_Main.vcxproj

@@ -1931,6 +1931,14 @@
     <None Include="res\DittoNew.ico" />
     <None Include="res\Ditto_NoCopyCb.ico" />
     <None Include="res\folder_open.png" />
+    <None Include="res\in_folder_16_16.png" />
+    <None Include="res\in_folder_20_20.png" />
+    <None Include="res\in_folder_24_24.png" />
+    <None Include="res\in_folder_32_32.png" />
+    <None Include="res\key_stroke_16_16.png" />
+    <None Include="res\key_stroke_20_20.png" />
+    <None Include="res\key_stroke_24_24.png" />
+    <None Include="res\key_stroke_32_32.png" />
     <None Include="res\left-blue.png" />
     <None Include="res\left_arrow_16_16.png" />
     <None Include="res\left_arrow_20_20.png" />
@@ -1956,6 +1964,10 @@
     <None Include="res\search_normal_150.bmp" />
     <None Include="res\search_normal_200.bmp" />
     <None Include="res\shortcut.png" />
+    <None Include="res\Sticky_16_16.png" />
+    <None Include="res\Sticky_20_20.png" />
+    <None Include="res\Sticky_24_24.png" />
+    <None Include="res\Sticky_32_32.png" />
     <None Include="res\Toolbar.bmp" />
     <None Include="res\toolbar1.bmp" />
     <CustomBuild Include="RulerRichEditCtrl\toolbar.bmp">
@@ -1967,6 +1979,10 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </CustomBuild>
     <None Include="res\FILECOPY.AVI" />
+    <None Include="res\yellow_star_16_16.png" />
+    <None Include="res\yellow_star_20_20.png" />
+    <None Include="res\yellow_star_24_24.png" />
+    <None Include="res\yellow_star_32_32.png" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="U3Stop\U3Stop.vcxproj">

+ 16 - 0
CP_Main.vcxproj.filters

@@ -960,6 +960,22 @@
     <None Include="res\maximize_16_16.png">
       <Filter>res</Filter>
     </None>
+    <None Include="res\yellow_star_32_32.png" />
+    <None Include="res\yellow_star_24_24.png" />
+    <None Include="res\yellow_star_20_20.png" />
+    <None Include="res\yellow_star_16_16.png" />
+    <None Include="res\in_folder_32_32.png" />
+    <None Include="res\in_folder_24_24.png" />
+    <None Include="res\in_folder_20_20.png" />
+    <None Include="res\in_folder_16_16.png" />
+    <None Include="res\key_stroke_32_32.png" />
+    <None Include="res\key_stroke_24_24.png" />
+    <None Include="res\key_stroke_20_20.png" />
+    <None Include="res\key_stroke_16_16.png" />
+    <None Include="res\Sticky_32_32.png" />
+    <None Include="res\Sticky_24_24.png" />
+    <None Include="res\Sticky_20_20.png" />
+    <None Include="res\Sticky_16_16.png" />
   </ItemGroup>
   <ItemGroup>
     <Filter Include="sqlite">

+ 1 - 1
DatabaseUtilities.cpp

@@ -595,7 +595,7 @@ BOOL RemoveOldEntries(bool checkIdleTime)
 					double stickyClipOrder = q.getFloatField(_T("stickyClipOrder"));
 					double stickyClipGroupOrder = q.getFloatField(_T("stickyClipGroupOrder"));
 
-					//Only delete entries that have no shortcut and don't have the flag set
+					//Only delete entries that have no shortcut and don't have the flag set and aren't in groups and 
 					if(shortcut == 0 && 
 						dontDelete == 0 &&
 						parentId <= 0 &&

+ 2 - 0
GdiImageDrawer.h

@@ -12,6 +12,8 @@ public:
 	BOOL LoadStdImageDPI(UINT id96, UINT id120, UINT id144, UINT id192, LPCTSTR pType);
 	void CGdiImageDrawer::Draw(CDC* pScreenDC, CWnd *pWnd, int posX, int posY, bool mouseHover, bool mouseDown);
 
+	UINT ImageWidth() { return m_pStdImage->m_pBitmap->GetWidth(); }
+
 protected:
 	CGdiPlusBitmapResource* m_pStdImage;
 	CDC*	m_pCurBtn;		// current pointer to one of the above

+ 42 - 33
QListCtrl.cpp

@@ -62,7 +62,11 @@ CQListCtrl::CQListCtrl()
 
 	m_mouseOverScrollAreaStart = 0;
 
-	//m_groupFolder.LoadStdImage(IDB_SHORTCUT_PNG, _T("PNG"));
+	m_groupFolder.LoadStdImageDPI(IDB_OPEN_FOLDER_16_16, IDB_OPEN_FOLDER_20_20, IDB_OPEN_FOLDER_24_24, IDB_OPEN_FOLDER_32_32, _T("PNG"));
+	m_dontDeleteImage.LoadStdImageDPI(IDB_YELLOW_STAR_16_16, IDB_YELLOW_STAR_20_20, IDB_YELLOW_STAR_24_24, IDB_YELLOW_STAR_32_32, _T("PNG"));
+	m_inFolderImage.LoadStdImageDPI(IDB_IN_FOLDER_16_16, IDB_IN_FOLDER_20_20, IDB_IN_FOLDER_24_24, IDB_IN_FOLDER_32_32, _T("PNG"));
+	m_shortCutImage.LoadStdImageDPI(IDB_KEY_16_16, IDB_KEY_20_20, IDB_KEY_24_24, IDB_KEY_32_32, _T("PNG"));
+	m_stickyImage.LoadStdImageDPI(IDB_STICKY_16_16, IDB_STICKY_20_20, IDB_STICKY_24_24, IDB_STICKY_32_32, _T("PNG"));
 }
 
 CQListCtrl::~CQListCtrl()
@@ -427,29 +431,36 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
 		// draw the symbol box
 		if( strSymbols.GetLength() > 0 )
 		{
-			strSymbols = " " + strSymbols + " "; // leave space for box
-			// add spaces to leave room for the symbols
-			CRect rectSym(rcText.left, rcText.top+1, rcText.left, rcText.top+1);
-			CRect rectSpace(0,0,0,0);
-			//Get text bounds
-			pDC->DrawText(" ", &rectSpace, DT_VCENTER | DT_EXPANDTABS | DT_CALCRECT);
-			pDC->DrawText(strSymbols, &rectSym, DT_VCENTER | DT_EXPANDTABS | DT_CALCRECT);
-			VERIFY( rectSpace.Width() > 0 );
-			
-//			int numSpaces = rectSym.Width() / rectSpace.Width();
-//			numSpaces++;
-//			csText = CString(' ',numSpaces) + csText;
-			
-			// draw the symbols
-			pDC->FillSolidRect( rectSym, GetSysColor(COLOR_ACTIVECAPTION) );
-			//pDC->FillSolidRect( rectSym, RGB(0,255,255) );
-			pDC->Draw3dRect(rectSym, GetSysColor(COLOR_3DLIGHT), GetSysColor(COLOR_3DDKSHADOW));
-			//		COLORREF crOld = pDC->SetTextColor(GetSysColor(COLOR_INFOTEXT));
-			COLORREF crOld = pDC->SetTextColor(RGB(255, 255, 255));
-			pDC->DrawText(strSymbols, rectSym, DT_VCENTER|DT_EXPANDTABS|DT_NOPREFIX);
-			pDC->SetTextColor(crOld);
-
-			rcText.left += rectSym.Width() + 2;
+			if(strSymbols.Find('G') >= 0) //group 
+			{
+				m_groupFolder.Draw(pDC, this, rcText.left, rcText.top, false, false);
+				rcText.left += m_groupFolder.ImageWidth() + 2;
+			}
+			if (strSymbols.Find('*') >= 0 &&
+				strSymbols.Find('G') < 0 &&
+				strSymbols.Find(_T("sticky")) < 0) //don't auto delete
+			{
+				m_dontDeleteImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
+				rcText.left += m_dontDeleteImage.ImageWidth() + 2;
+			}
+			if (strSymbols.Find('s') >= 0) // has shortcut
+			{
+				m_shortCutImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
+				rcText.left += m_shortCutImage.ImageWidth() + 2;
+			}
+			if (strSymbols.Find('!') >= 0) // in group
+			{
+				m_inFolderImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
+				rcText.left += m_inFolderImage.ImageWidth() + 2;
+			}
+			if (strSymbols.Find('Q') >= 0) // has quick paste text
+			{
+			}
+			if (strSymbols.Find(_T("Sticky")) >= 0) //sticky clip
+			{
+				m_stickyImage.Draw(pDC, this, rcText.left, rcText.top, false, false);
+				rcText.left += m_stickyImage.ImageWidth() + 2;
+			}			
 		}
 		
 		if(DrawRtfText(nItem, rcText, pDC) == FALSE)
@@ -460,9 +471,7 @@ void CQListCtrl::OnCustomdrawList(NMHDR* pNMHDR, LRESULT* pResult)
         // Draw a focus rect around the item if necessary.
         if(bListHasFocus && (rItem.state & LVIS_FOCUSED))
 			pDC->DrawFocusRect(rcItem);
-
-		//m_groupFolder.Draw(pDC, rcItem.left, rcItem.top);
-		
+						
 		if( m_bShowTextForFirstTenHotKeys && firstTenNum > 0 )
 		{
 			CString cs;
@@ -1402,10 +1411,10 @@ bool CQListCtrl::MouseInScrollBarArea(CRect crWindow, CPoint point)
 	return false;
 }
 
-void CQListCtrl::StopHideScrollBarTimer() 
-{
-	GetParent()->SendMessage(NM_SHOW_HIDE_SCROLLBARS, 0, 0);
-
-	m_timerToHideScrollAreaSet = false;
-	KillTimer(TIMER_HIDE_SCROL);
+void CQListCtrl::StopHideScrollBarTimer() 
+{
+	GetParent()->SendMessage(NM_SHOW_HIDE_SCROLLBARS, 0, 0);
+
+	m_timerToHideScrollAreaSet = false;
+	KillTimer(TIMER_HIDE_SCROL);
 }

+ 5 - 0
QListCtrl.h

@@ -165,6 +165,11 @@ protected:
 	DWORD m_mouseOverScrollAreaStart;
 	bool m_timerToHideScrollAreaSet;
 	CGdiImageDrawer m_groupFolder;
+	CGdiImageDrawer m_dontDeleteImage;
+	CGdiImageDrawer m_inFolderImage;
+	CGdiImageDrawer m_shortCutImage;
+	CGdiImageDrawer m_stickyImage;
+
 
 	// Generated message map functions
 protected:

+ 18 - 1
Resource.h

@@ -87,6 +87,23 @@
 #define IDB_MAXIMIZE_12_12              220
 #define IDB_PNG7                        221
 #define IDB_MAXIMIZE_16_16              221
+#define IDB_YELLOW_STAR_32_32           222
+#define IDB_YELLOW_STAR_24_24           223
+#define IDB_YELLOW_STAR_20_20           224
+#define IDB_YELLOW_STAR_16_16           225
+#define IDB_IN_FOLDER_32_32             226
+#define IDB_IN_FOLDER_24_24             227
+#define IDB_IN_FOLDER_20_20             228
+#define IDB_IN_FOLDER_16_16             229
+#define IDB_KEY_32_32                   230
+#define IDB_KEY_24_24                   231
+#define IDB_KEY_20_20                   232
+#define IDB_KEY_16_16                   233
+#define IDB_STICKY_32_32                234
+#define IDB_STICKY_24_24                235
+#define IDB_STICKY_20_20                236
+#define IDB_PNG8                        237
+#define IDB_STICKY_16_16                237
 #define IDC_PATH                        1000
 #define IDC_GET_PATH                    1001
 #define IDC_SELECT_SOUND                1002
@@ -424,7 +441,7 @@
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        222
+#define _APS_NEXT_RESOURCE_VALUE        238
 #define _APS_NEXT_COMMAND_VALUE         32882
 #define _APS_NEXT_CONTROL_VALUE         2101
 #define _APS_NEXT_SYMED_VALUE           101

BIN
res/Sticky_16_16.png


BIN
res/Sticky_20_20.png


BIN
res/Sticky_24_24.png


BIN
res/Sticky_32_32.png


BIN
res/in_folder_16_16.png


BIN
res/in_folder_20_20.png


BIN
res/in_folder_24_24.png


BIN
res/in_folder_32_32.png


BIN
res/key_stroke_16_16.png


BIN
res/key_stroke_20_20.png


BIN
res/key_stroke_24_24.png


BIN
res/key_stroke_32_32.png


BIN
res/yellow_star_16_16.png


BIN
res/yellow_star_20_20.png


BIN
res/yellow_star_24_24.png


BIN
res/yellow_star_32_32.png