[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1765
Date       : Wed Jan 31 11:43:53 GMT 2007

Changed paths:
   M /Trunk/XaraLX/Kernel/Makefile.am
   M /Trunk/XaraLX/Kernel/finfodlg.cpp
   M /Trunk/XaraLX/Kernel/finfodlg.h
   M /Trunk/XaraLX/Kernel/main3.cpp
   M /Trunk/XaraLX/wxOil/Makefile.am
   M /Trunk/XaraLX/wxOil/xrc/EN/peterdlg.xrc

Commit Mikhail's changes to Document info box


Diff:
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am	(revision 1764)
+++ Trunk/XaraLX/Kernel/Makefile.am	(revision 1765)
@@ -81,7 +81,7 @@
 	xsepsops.cpp xarprefs.cpp printing.cpp prntview.cpp psrndrgn.cpp opimgset.cpp \
 	optsprin.cpp prnprefs.cpp rulers.cpp biasgdgt.cpp biasdlg.cpp prvwmenu.cpp \
 	ftfilter.cpp cxftree.cpp strlist.cpp selmedia.cpp brshname.cpp brushop.cpp \
-	brushdlg.cpp
+	brushdlg.cpp finfodlg.cpp
 
 
 AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/finfodlg.cpp
===================================================================
--- Trunk/XaraLX/Kernel/finfodlg.cpp	(revision 1764)
+++ Trunk/XaraLX/Kernel/finfodlg.cpp	(revision 1765)
@@ -257,7 +257,7 @@
 		{
 			Close(); // Close and destroy the dialog 
 			End();
-//			return (DLG_EAT_IF_HUNGRY(Msg));  	 
+			return (DLG_EAT_IF_HUNGRY(Msg));  	 
 		}
 
 		if (Msg->DlgMsg == DIM_TIMER)
@@ -311,22 +311,31 @@
 	this->SetTimer(42, DURATION_FASTJOB);				// Ten seconds between updates
 	timerSlowJob.Sample();
 
+	
+	// Setting up the external resources list control.
+	if (!m_lstctrlExternalResInfo.Init(WindowID, _R(IDC_FINFO_REFSLIST)))
+		return FALSE;
+		
+	m_lstctrlExternalResInfo.AddColumn(_T("Status"), 14);
+	m_lstctrlExternalResInfo.AddColumn(_T("Item"), 180);
+	m_lstctrlExternalResInfo.AddColumn(_T("Details"), 760);
+
 	// Setup list columns
 	// Why do we do this here when we have to use a custom AddItem function (AddRefsItem)
 	// to populate the list?
-	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
+/*	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
 	ERROR2IF(pListGadget==NULL, FALSE, "No refs list gadget");
 //	pListGadget->ShowColumnHeaders("", "Item", "Details");
 	pListGadget->SetColumnWidth(0, 14);		// Status indicators
 	pListGadget->SetColumnWidth(1, 80);		// Item name
 	pListGadget->SetColumnWidth(2, 760);	// Details
-
+*/
 	SetDocInfo(TRUE, TRUE);
 
 	return TRUE;
 }
 
-		 
+		 	
 
 /*******************************************************************************************
 
@@ -449,8 +458,8 @@
 
 BOOL FileInfo::UpdateFontList(Document*	WorkDoc)
 {
-	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
-	ERROR2IF(pListGadget == NULL, FALSE, "No list gadget?!");
+//	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
+//	ERROR2IF(pListGadget == NULL, FALSE, "No list gadget?!");
 
 	List ItemList;
 
@@ -514,7 +523,12 @@
 	while (pRefItem)
 	{
 		// Add the font in the list to the list box
-		pListGadget->AddRefsItem(pRefItem->idBitmap, pRefItem->strItemName, pRefItem->strDetails);
+//		pListGadget->AddRefsItem(pRefItem->idBitmap, pRefItem->strItemName, pRefItem->strDetails);
+		CFileInfoList::CListRow oNewRow = m_lstctrlExternalResInfo.AddRow();
+		oNewRow.SetBitmap(pRefItem->idBitmap);
+		oNewRow.SetText(1, pRefItem->strItemName);
+		oNewRow.SetText(2, pRefItem->strDetails);
+		
 
 		pRefItem = (RefItem*)ItemList.GetNext(pRefItem);
 	}
@@ -546,8 +560,8 @@
 	// Add each list item to the listbox, marking it if the referred effect can not
 	// be found in the installed effect list
 
-	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
-	ERROR2IF(pListGadget == NULL, FALSE, "No list gadget?!");
+//	CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
+//	ERROR2IF(pListGadget == NULL, FALSE, "No list gadget?!");
 
 	if (pWorkDoc == NULL)	// Don't try to fill in anything when the window is shaded
 	{
@@ -630,7 +644,11 @@
 	while (pRefItem)
 	{
 		// Add the font in the list to the list box
-		pListGadget->AddRefsItem(pRefItem->idBitmap, pRefItem->strItemName, pRefItem->strDetails);
+//		pListGadget->AddRefsItem(pRefItem->idBitmap, pRefItem->strItemName, pRefItem->strDetails);
+		CFileInfoList::CListRow oNewRow = m_lstctrlExternalResInfo.AddRow();
+		oNewRow.SetBitmap(pRefItem->idBitmap);
+		oNewRow.SetText(1, pRefItem->strItemName);
+		oNewRow.SetText(2, pRefItem->strDetails);
 
 		pRefItem = (RefItem*)ItemList.GetNext(pRefItem);
 	}
@@ -662,34 +680,40 @@
 BOOL FileInfo::SetDocInfo(BOOL UpdateComment, BOOL UpdateFonts)
 {
 	Document*	WorkDoc = Document::GetSelected();
-	
+
 	if (UpdateFonts)
 	{
 		BeginSlowJob();
 		GadgetRedraw(_R(IDC_FINFO_REFSLIST), FALSE);	// Disable redraw while updating
-		CCustomList* pListGadget = CCustomList::GetGadget(GetReadWriteWindowID(), _R(IDC_FINFO_REFSLIST));
-		ERROR2IF(pListGadget == NULL, FALSE, "No list gadget?!");
 
-		INT32 iSelectedItem = pListGadget->GetSelectedItemIndex();
-		INT32 iScrollPos = pListGadget->GetScrollPos(SB_VERT);
-		pListGadget->DeleteAllItems();
+//		INT32 iSelectedItem = pListGadget->GetSelectedItemIndex();
+//		INT32 iScrollPos = pListGadget->GetScrollPos(SB_VERT);
+		
+		m_lstctrlExternalResInfo.Clear();
 
 		// Work out all the document based fonts again and recreate the drop down list
-		pListGadget->AddRefsItem(0, String(_R(IDS_FINFO_FONTREFS_NAMEHEADER)), String(_R(IDS_FINFO_FONTREFS_DETAILSHEADER)));
+		CFileInfoList::CListRow oNewRow = m_lstctrlExternalResInfo.AddRow();
+		oNewRow.SetText(1, String(_R(IDS_FINFO_FONTREFS_NAMEHEADER)));
+		oNewRow.SetText(2, String(_R(IDS_FINFO_FONTREFS_DETAILSHEADER)));
+		
 		UpdateFontList(WorkDoc);
 
 		// Show effects usage
-		pListGadget->AddRefsItem(0, String(_R(IDS_FINFO_EFFECTREFS_NAMEHEADER)), String(_R(IDS_FINFO_EFFECTREFS_DETAILSHEADER)));
+//		pListGadget->AddRefsItem(0, String(_R(IDS_FINFO_EFFECTREFS_NAMEHEADER)), String(_R(IDS_FINFO_EFFECTREFS_DETAILSHEADER)));
+		oNewRow = m_lstctrlExternalResInfo.AddRow();
+		oNewRow.SetText(1, String(_R(IDS_FINFO_EFFECTREFS_NAMEHEADER)));
+		oNewRow.SetText(2, String(_R(IDS_FINFO_EFFECTREFS_DETAILSHEADER)));
+		
 		UpdateEffectsList(WorkDoc);
 
-		pListGadget->SetSelectedItemIndex(iSelectedItem);
-		pListGadget->SetScrollPos(SB_VERT, iScrollPos, FALSE);
+//		pListGadget->SetSelectedItemIndex(iSelectedItem);
+//		pListGadget->SetScrollPos(SB_VERT, iScrollPos, FALSE);
 
 		GadgetRedraw(_R(IDC_FINFO_REFSLIST), TRUE);		// Enable redraw while updating
 		InvalidateGadget(_R(IDC_FINFO_REFSLIST));		// Force redraw now that we're done
 		EndSlowJob();
 	}
-	
+
 	// If there is no selected document then we want to set the fields to be blank 
 	if (WorkDoc == NULL)
 	{
@@ -994,19 +1018,24 @@
 	// Now do the creation and save times
 	time_t	TimeData;
 	TimeData = WorkDoc->GetCreationTime();
-	LocalEnvironment::SystemTimeToString(&String, &TimeData);
-	LocalEnvironment::SystemDateToString(&String2, &TimeData);
-	String += _T("  ");
-	String += String2;
+			
+	String = asctime(localtime(&TimeData));
+	
+//	LocalEnvironment::SystemTimeToString(&String, &TimeData);
+//	LocalEnvironment::SystemDateToString(&String2, &TimeData);
+//	String += _T("  ");
+//	String += String2;
 	UpdateStringGadgetValue(_R(IDC_FILEINFO_CREATIONDATE), &String);
 
 	TimeData = WorkDoc->GetLastSaveTime();
 	if (TimeData != 0)
 	{
-		LocalEnvironment::SystemTimeToString(&String, &TimeData);
-		LocalEnvironment::SystemDateToString(&String2, &TimeData);
-		String += _T("  ");
-		String += String2;
+//		LocalEnvironment::SystemTimeToString(&String, &TimeData);
+//		LocalEnvironment::SystemDateToString(&String2, &TimeData);
+//		String += _T("  ");
+//		String += String2;
+		String = asctime(localtime(&TimeData));
+		
 		UpdateStringGadgetValue(_R(IDC_FILEINFO_LASTSAVEDATE), &String);
 	}
 	else
@@ -1203,3 +1232,4 @@
 
 
 
+
Index: Trunk/XaraLX/Kernel/main3.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main3.cpp	(revision 1764)
+++ Trunk/XaraLX/Kernel/main3.cpp	(revision 1765)
@@ -183,8 +183,9 @@
 			XPEEditOp::Init() &&				// Init the XPE Edit operation
 			EditSelectionOp::Init() &&			// Init the "Edit Selection" op
 			KeyPress::Init() &&					// Init the key press system
+#endif
 			FileInfo::Init() &&					// Init the document info dialogue
-#endif
+
 			ArrangeAlignment::Init() &&			// Init the arrange alignment dialogue
 			OpAlign::Init() &&					// Init the align op
 #ifndef EXCLUDE_FROM_XARALX
@@ -308,3 +309,4 @@
 			);
 }
 
+
Index: Trunk/XaraLX/Kernel/finfodlg.h
===================================================================
--- Trunk/XaraLX/Kernel/finfodlg.h	(revision 1764)
+++ Trunk/XaraLX/Kernel/finfodlg.h	(revision 1765)
@@ -101,6 +101,7 @@
 
 //#include "dialogop.h"  - in camtypes.h [AUTOMATICALLY REMOVED]
 #include "fontbase.h"		// font manager and associated items
+#include "fileinfolist.h"
 
 #define OPTOKEN_FINFODLG _T("FileInfo")    
 
@@ -144,6 +145,8 @@
 	static DocumentFontDropDown	*NameDropDown;
 	List BitmapList;
 	MonotonicTime timerSlowJob;
+	
+	CFileInfoList m_lstctrlExternalResInfo;
 }; 
 
 Node* StartTreeScan(Document* pDoc);
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am	(revision 1764)
+++ Trunk/XaraLX/wxOil/Makefile.am	(revision 1765)
@@ -41,7 +41,7 @@
 	lddirect.cpp prncamvw.cpp prdlgctl.cpp psdc.cpp grndprnt.cpp printprg.cpp \
 	oilruler.cpp bitmapdropdown.cpp helptabs.cpp tmplmngr.cpp imgmgkft.cpp ppmfiltr.cpp \
 	bitmapgriddropdown.cpp griddropdown.cpp camdoctp.cpp \
-	resources.cpp
+	resources.cpp fileinfolist.cpp
 
 # Keep resources.cpp on a separate line as it is odd
 
@@ -54,3 +54,4 @@
 
 RESOURCEDUMMY := ${if ${strip ${shell $(TOPDIR)/Scripts/build-resources.pl @BUILDRESFLAGS@ -t $(TOPDIR) -o . --version $(VERSION) -x $(XARALANGUAGE) -u $(USER) --wxrc "$(WXRC)" } }, ,${error "Resource build failed"}}
 
+
Index: Trunk/XaraLX/wxOil/xrc/EN/peterdlg.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/peterdlg.xrc	(revision 1764)
+++ Trunk/XaraLX/wxOil/xrc/EN/peterdlg.xrc	(revision 1765)
@@ -39,7 +39,8 @@
 			<label>Comment:</label>
 		</object>
 		<object class="wxTextCtrl" name="IDC_FILEINFO_COMMENT">
-			 <pos>5,192d</pos> <size>185,34d</size>
+			<pos>5,192d</pos> <size>185,34d</size>
+			<style>wxTE_MULTILINE</style>
 		</object>
 		<object class="wxStaticText" name="IDC_STATIC">
 			 <pos>5,93d</pos> <size>63,8d</size>
@@ -129,8 +130,9 @@
 			 <pos>5,115d</pos> <size>185,8d</size>
 			<label>External resources used by this document:</label>
 		</object>
-		<object class="wxListBox" name="IDC_FINFO_REFSLIST">
-			 <pos>5,124d</pos> <size>185,55d</size>
+		<object class="wxListCtrl" name="IDC_FINFO_REFSLIST">
+			<pos>5,124d</pos> <size>185,55d</size>
+			<style>wxLC_REPORT  | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxSIMPLE_BORDER</style>
 		</object>
 		<title>Document information</title>
 		<label>Document information</label>


Xara