|
From: <mbe...@us...> - 2010-07-05 22:56:34
|
Revision: 826
http://scstudio.svn.sourceforge.net/scstudio/?rev=826&view=rev
Author: mbezdeka
Date: 2010-07-05 22:56:28 +0000 (Mon, 05 Jul 2010)
Log Message:
-----------
Message numbering
- auto numbering help added
- rest of functionality of global numbering dialog added
Modified Paths:
--------------
trunk/doc/help/frontend/message-numbering.html
trunk/src/view/visio/addon/dllmodule.rc
trunk/src/view/visio/addon/document.cpp
trunk/src/view/visio/addon/enumerateUtils.cpp
trunk/src/view/visio/addon/enumerateUtils.h
trunk/src/view/visio/addon/globalSettingsDlg.h
trunk/src/view/visio/addon/numberingGlobalDlg.cpp
trunk/src/view/visio/addon/numberingGlobalDlg.h
trunk/src/view/visio/addon/resource.h
Added Paths:
-----------
trunk/doc/help/frontend/pictures/message_numbering_autoenum_options.png
Modified: trunk/doc/help/frontend/message-numbering.html
===================================================================
--- trunk/doc/help/frontend/message-numbering.html 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/doc/help/frontend/message-numbering.html 2010-07-05 22:56:28 UTC (rev 826)
@@ -1,25 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
-<title>Shape Selection – SCStudio frontend</title>
-<link href="../help.css" rel="stylesheet" type="text/css">
+<title>Message Numbering – SCStudio frontend</title>
+<link href="../help.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>Message Numbering</h1>
-<p>Message numbering allows users to enumerate all types of message shapes (left, right, lost, found).<br>
-You can enumerate all messages on the active page (if no messages are selected) or the selection.<br>
+<p>Message numbering allows users to enumerate all types of message shapes (left, right, lost, found).<br/>
+You can enumerate all messages on the active page (if no messages are selected) or the selection.<br/>
+</p>
-<h3>Enable message numbering</h3>
-<p>By pressing Message numbering button <img src="pictures/icon_message_enumeration.png" alt="Message Numbering">, via menu <code>Check->Drawing->Message numbering->Message numbering</code> or by using hotkey <Code>Ctrl+Alt+E</Code> the dialog with options will be shown:</p>
+<h2>Enable message numbering</h2>
+<p>By pressing Message numbering button <img src="pictures/icon_message_enumeration.png" alt="Message Numbering" />, via menu <code>Check->Drawing->Message numbering->Message numbering</code> or by using hotkey <Code>Ctrl+Alt+E</Code> the dialog with options will be shown:</p>
<p>
-<img src="pictures/message_numbering_options.png" alt="Message Numbering options dialog">
+<img src="pictures/message_numbering_options.png" alt="Message Numbering options dialog"/>
</p>
-<p>You can choose:<br>
-- specific numbering type (numbers, letters, capital letters, romans)<br>
-- starting index (1-9999)<br>
-- and additional string following the index such as ".", "-", … (max 4 chars)<br>
+<p>You can choose:<br/>
+- specific numbering type (numbers, letters, capital letters, romans)<br/>
+- starting index (1-9999)<br/>
+- and additional string following the index such as ".", "-", … (max 4 chars)<br/>
</p>
<p>
@@ -27,7 +28,7 @@
Already numbered messages will be overwritten by new numbering.
</p>
-<h3>Disable message numbering</h3>
+<h2>Disable message numbering</h2>
<p>Numbering can be deleted by pressing Delete numbering button <img src="pictures/icon_message_enumeration_disable.png" alt="Disable message numbering"> on the toolbar, via menu <code>Check->Drawing->Message numbering->Delete numbering</code> or by using hotkey <Code>Ctrl+Alt+D.</Code></p>
<p>
@@ -35,12 +36,35 @@
If no selection is used all numbering indexes will be deleted.
</p>
-<h3>Numbering group selection</h3>
+<h2>Numbering group selection</h2>
<p>When a group of messages is numbered, user can select it by right-click on any of numbered messages from group and choose <code>Select numbering group</code> from context menu. Example is shown in the following picture:</p>
<p>
-<img src="pictures/select_numbering_group.png" alt="Select numbering group">
+<img src="pictures/select_numbering_group.png" alt="Select numbering group" />
</p>
+<h2>Auto numbering</h2>
+<p>New messages can be automatically numbered after they are dropped on the page. Specific behavior can be set via menu <code>Check->Drawing->Settings</code>, tab Numbering. Following dialog will be shown:</p>
+
+<p>
+<img src="pictures/message_numbering_autoenum_options.png" alt="Auto numbering options" />
+</p>
+
+<p>
+Options are:<br />
+<p/>
+
+<p>
+<code>automatic numbering new messages</code><br />
+ - sets whether auto numbering is enabled, otherwise all other options are disabled.<br /><br />
+<code>as nearest message</code><br />
+ - new messages will be numbered according to the group of the closest message on the active page. All message indexes in the current group will be recounted. If the closest message isn't numbered, new one won't be either. <br />
+<code>as nearest numbered message</code><br />
+ - new messages will be numbered according to the closest <b>numbered</b> message on the active page. If there are no numbered messages on the active page you can choose between: <br /><br />
+ <code>don't number</code><br />
+ - don't number new messages if there are no numbered messages on the page.<br />
+ <code>use numbering style</code><br />
+ - use specific numbering style if there are no numbered messages on the page.<br />
+</p>
</body>
</html>
\ No newline at end of file
Added: trunk/doc/help/frontend/pictures/message_numbering_autoenum_options.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/help/frontend/pictures/message_numbering_autoenum_options.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/src/view/visio/addon/dllmodule.rc
===================================================================
--- trunk/src/view/visio/addon/dllmodule.rc 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/dllmodule.rc 2010-07-05 22:56:28 UTC (rev 826)
@@ -204,25 +204,24 @@
LTEXT "Starting index:",IDC_STATIC,11,39,50,8,SS_CENTERIMAGE
END
-IDD_NUMBERING_GLOBAL DIALOGEX 0, 0, 289, 134
+IDD_NUMBERING_GLOBAL DIALOGEX 0, 0, 275, 126
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
EXSTYLE WS_EX_TRANSPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- GROUPBOX "",IDC_STATIC,7,7,275,120
- CONTROL "automatic numbering new messages",IDC_ENUM_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,6,128,10
- CONTROL "as nearest message",IDC_NEAREST_MSG,"Button",BS_AUTORADIOBUTTON,24,26,80,10
+ CONTROL "as nearest message",IDC_NEAREST_MSG,"Button",BS_AUTORADIOBUTTON | WS_GROUP,17,27,80,10
CONTROL "as nearest numbered message",IDC_NEAREST_NUMBERED_MSG,
- "Button",BS_AUTORADIOBUTTON,24,40,114,10
- GROUPBOX "If no nearest (numbered) message found:",IDC_STATIC,14,65,261,53,WS_GROUP
- CONTROL "don't number",IDC_DONT_NUMBER,"Button",BS_AUTORADIOBUTTON,24,81,58,10
- CONTROL "use numbering style:",IDC_USE_NUMBERING_STYLE,"Button",BS_AUTORADIOBUTTON,24,97,83,10
- GROUPBOX "",IDC_STATIC,14,16,128,42,WS_GROUP
- COMBOBOX IDC_COMBO_NUMBERING_GLOBAL,107,95,71,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CTEXT "+",IDC_STATIC,179,95,12,12,SS_CENTERIMAGE
- EDITTEXT IDC_ADDITION_GLOBAL,191,95,25,14,ES_AUTOHSCROLL | ES_NOHIDESEL
- EDITTEXT IDC_STARTING_INDEX_GLOBAL,244,95,25,14,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Index:",IDC_STATIC,221,97,21,8,SS_CENTERIMAGE
+ "Button",BS_AUTORADIOBUTTON,17,41,114,10
+ CONTROL "don't number",IDC_DONT_NUMBER,"Button",BS_AUTORADIOBUTTON | WS_GROUP,17,81,58,10
+ CONTROL "use numbering style:",IDC_USE_NUMBERING_STYLE,"Button",BS_AUTORADIOBUTTON,17,97,83,10
+ GROUPBOX "",IDC_STATIC,7,17,261,42,WS_GROUP
+ COMBOBOX IDC_COMBO_NUMBERING_GLOBAL,101,95,71,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CTEXT "+",IDC_STATIC,173,95,12,12,SS_CENTERIMAGE
+ EDITTEXT IDC_ADDITION_GLOBAL,185,95,25,14,ES_AUTOHSCROLL | ES_NOHIDESEL
+ EDITTEXT IDC_STARTING_INDEX_GLOBAL,237,95,25,14,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Index:",IDC_STATIC,215,97,21,8,SS_CENTERIMAGE
+ CONTROL "automatic numbering new messages",IDC_ENUM_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,131,10
+ GROUPBOX "If no nearest (numbered) message found:",IDC_STATIC,7,65,261,54,WS_GROUP
END
@@ -284,11 +283,11 @@
IDD_NUMBERING_GLOBAL, DIALOG
BEGIN
LEFTMARGIN, 7
- RIGHTMARGIN, 282
+ RIGHTMARGIN, 268
VERTGUIDE, 14
VERTGUIDE, 24
TOPMARGIN, 7
- BOTTOMMARGIN, 127
+ BOTTOMMARGIN, 119
END
END
#endif // APSTUDIO_INVOKED
Modified: trunk/src/view/visio/addon/document.cpp
===================================================================
--- trunk/src/view/visio/addon/document.cpp 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/document.cpp 2010-07-05 22:56:28 UTC (rev 826)
@@ -1466,6 +1466,8 @@
continue;
page->DeleteRow(visSectionUser,page->GetCells(userGroupID)->Row);
}
+ //erase AutoNumbering information if exists
+ CEnumerateUtils::eraseAutoEnumGroup(vsoApp);
//restore IDs
CEnumerateUtils::setGroupCount(vsoApp,0);
}
@@ -1491,8 +1493,67 @@
int bAutoEnumType = GetRegistry<bool>(regFolder, NULL, _T("AutoEnumType"), 0);
closestMsg = CEnumerateUtils::getClosestMessage(msgShape->Application,msgShape,bAutoEnumType ? true : false);
+ //enumerate according to closest message
if(closestMsg && _tcsicmp(closestMsg->Data3,_T("")) != 0)
+ {
enumerate(msgShape->Application,closestMsg->Data3,true,true);
+ }
+ //or use numbering style
+ else if(GetRegistry<bool>(regFolder, NULL, _T("AutoEnumStyleEnabled"), 0) && bAutoEnumType)
+ {
+ int autoEnumGroupID = CEnumerateUtils::getAutoEnumGroup(m_vsoApp);
+ if(autoEnumGroupID == -1)
+ {
+ int ID = CEnumerateUtils::getGroupCount(m_vsoApp);
+ _bstr_t groupID = stringize() << _T("Enum") << ++ID;
+
+ //addition string
+ HKEY hKey;
+ if(RegCreateKey(HKEY_CURRENT_USER, regFolder,&hKey) != ERROR_SUCCESS)
+ {
+ MessageBox(GetActiveWindow(), _T("Failed load key for addition string!"), _T("Error"), MB_OK);
+ return;
+ }
+
+ DWORD dwType = 0;
+ wchar_t buffer[5] = {0};
+ DWORD dwSize = sizeof(buffer);
+ if(!RegQueryValueEx(hKey,_T("AutoEnumStyleAddition"),0,&dwType, (LPBYTE)buffer, &dwSize) == ERROR_SUCCESS)
+ {
+ RegCloseKey(hKey);
+ return;
+ }
+ RegCloseKey(hKey);
+
+ //save group setting into page sheet
+ CEnumerateUtils::saveGroupSettings(m_vsoApp, groupID,
+ GetRegistry<int>(regFolder, NULL, _T("AutoEnumStyleIndex"), 1),
+ GetRegistry<int>(regFolder, NULL, _T("AutoEnumStyleNumType"), 0),
+ buffer);
+
+ enumerate(m_vsoApp, groupID, true,true);
+
+ CEnumerateUtils::setGroupCount(m_vsoApp,ID);
+ pageSheet->AddNamedRow(visSectionUser,_T("AutoEnumGroupID"),visTagDefault);
+ pageSheet->Cells["User.AutoEnumGroupID"]->FormulaU = stringize() << ID;
+ }
+ else
+ {
+ _bstr_t groupID = stringize() << _T("Enum") << autoEnumGroupID;
+ enumerate(m_vsoApp, groupID, true,true);
+ }
+
+ //MessageBox(GetActiveWindow(),temp.c_str(),NULL,MB_OK);
+ //if group for auto numbering doesn't exists yet, create a new one
+ /*int ID = GetRegistry<int>(regFolder, NULL, _T("AutoEnumGroupID"), -1)
+ if(ID == -1)
+ {
+ ID = CEnumerateUtils::getGroupCount(m_vsoApp);
+ SetRegistry<int>
+
+ }
+ MessageBox(GetActiveWindow(),_T("The group doesn't exists yet!"),NULL, MB_OK);*/
+ }
}
//Check which groups have changed
@@ -1659,6 +1720,14 @@
{
CGlobalSettingsDlg sheet(_T("Settings"));
sheet.DoModal();
+
+ //Message Numbering processing
+ const TCHAR* regFolder = _T("Software\\Sequence Chart Studio\\MessageNumbering");
+ if(GetRegistry<bool>(regFolder, NULL, _T("AutoEnumStyleIndexChanged"), 0))
+ {
+ CEnumerateUtils::eraseAutoEnumGroup(vsoApp);
+ SetRegistry<bool>(HKEY_CURRENT_USER, regFolder, _T("AutoEnumStyleIndexChanged"), false);
+ }
return VAORC_SUCCESS;
}
Modified: trunk/src/view/visio/addon/enumerateUtils.cpp
===================================================================
--- trunk/src/view/visio/addon/enumerateUtils.cpp 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/enumerateUtils.cpp 2010-07-05 22:56:28 UTC (rev 826)
@@ -239,6 +239,25 @@
pagesheet->Cells["User.EnumCount"]->FormulaU = stringize() << count;
}
+int CEnumerateUtils::getAutoEnumGroup(Visio::IVApplicationPtr vsoApp)
+{
+ Visio::IVShapePtr pagesheet = vsoApp->ActivePage->PageSheet;
+
+ if(pagesheet->GetCellExists(_T("User.AutoEnumGroupID"),0))
+ {
+ return pagesheet->Cells["User.AutoEnumGroupID"]->ResultInt[visNone][visTruncate];
+ }
+
+ return -1;
+}
+
+void CEnumerateUtils::eraseAutoEnumGroup(Visio::IVApplicationPtr vsoApp)
+{
+ Visio::IVShapePtr pagesheet = vsoApp->ActivePage->PageSheet;
+ if(getAutoEnumGroup(vsoApp) != -1)
+ pagesheet->DeleteRow(visSectionUser,pagesheet->CellsRowIndex["User.AutoEnumGroupID"]);
+}
+
VAORC CEnumerateUtils::enableEnumeration(Visio::IVShapePtr shape, _bstr_t groupID, std::set<_bstr_t>& formerGroups)
{
if(_tcsicmp(shape->Data1,_T("")) == 0)
Modified: trunk/src/view/visio/addon/enumerateUtils.h
===================================================================
--- trunk/src/view/visio/addon/enumerateUtils.h 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/enumerateUtils.h 2010-07-05 22:56:28 UTC (rev 826)
@@ -42,15 +42,24 @@
* @return whether first shape is "smaller" then the second one
*/
static bool messageCompare(Visio::IVShapePtr p1, Visio::IVShapePtr p2);
- static bool loadGroupSettings(Visio::IVApplicationPtr vsoApp, _bstr_t groupID, int& startIndex, int& numberingType, std::wstring& addition);
+
+ static bool loadGroupSettings(Visio::IVApplicationPtr vsoApp, _bstr_t groupID, int& startIndex, int& numberingType, std::wstring& addition);
static bool saveGroupSettings(Visio::IVApplicationPtr vsoApp, _bstr_t groupID, int startIndex, int numberingType, BSTR addition);
- static void selectGroup(Visio::IVApplicationPtr vsoApp, _bstr_t groupID);
- static Visio::IVShapePtr getClosestMessage(Visio::IVApplicationPtr vsoApp, const Visio::IVShapePtr shapePtr, bool onlyNumbered);
- static int getGroupCount(Visio::IVApplicationPtr vsoApp);
+
+ static void selectGroup(Visio::IVApplicationPtr vsoApp, _bstr_t groupID);
+
+ static Visio::IVShapePtr getClosestMessage(Visio::IVApplicationPtr vsoApp, const Visio::IVShapePtr shapePtr, bool onlyNumbered);
+
+ static int getGroupCount(Visio::IVApplicationPtr vsoApp);
static void setGroupCount(Visio::IVApplicationPtr vsoApp, int count);
- static VAORC disableEnumeration(Visio::IVShapePtr shape);
+
+ static VAORC disableEnumeration(Visio::IVShapePtr shape);
static VAORC enableEnumeration(Visio::IVShapePtr shape, _bstr_t groupID, std::set<_bstr_t>& formerGroups);
- static void fillComboWithTypes(WTL::CComboBox& combo);
+
+ static void fillComboWithTypes(WTL::CComboBox& combo);
+
+ static int getAutoEnumGroup(Visio::IVApplicationPtr vsoApp);
+ static void eraseAutoEnumGroup(Visio::IVApplicationPtr vsoApp);
};
// $Id$
\ No newline at end of file
Modified: trunk/src/view/visio/addon/globalSettingsDlg.h
===================================================================
--- trunk/src/view/visio/addon/globalSettingsDlg.h 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/globalSettingsDlg.h 2010-07-05 22:56:28 UTC (rev 826)
@@ -42,7 +42,6 @@
//Pages of property sheet
CNumberingGlobalDlg page1;
- CPropertyPage<IDD_CHECK_OPTIONS> page2;
};
// $Id$
\ No newline at end of file
Modified: trunk/src/view/visio/addon/numberingGlobalDlg.cpp
===================================================================
--- trunk/src/view/visio/addon/numberingGlobalDlg.cpp 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/numberingGlobalDlg.cpp 2010-07-05 22:56:28 UTC (rev 826)
@@ -31,40 +31,40 @@
//Number according to nearest msg OR nearest numbered msg
if(GetRegistry<bool>(GetRegistryFolder(), NULL, _T("AutoEnumType"), 0))
- m_nearestNumberedMsg.SetCheck(BST_CHECKED);
+ m_nearestNumberedMsg.SetCheck(BST_CHECKED);
else
{
- m_nearestMsg.SetCheck(BST_CHECKED);
- EnableNearestNumberedMsgControls(false);
+ m_nearestMsg.SetCheck(BST_CHECKED);
+ EnableNearestNumberedMsgControls(false);
}
//don't number OR use numbering style
if(GetRegistry<bool>(GetRegistryFolder(), NULL, _T("AutoEnumStyleEnabled"), 0))
- m_useNumberingStyle.SetCheck(BST_CHECKED);
+ m_useNumberingStyle.SetCheck(BST_CHECKED);
else
- m_dontNumber.SetCheck(BST_CHECKED);
+ m_dontNumber.SetCheck(BST_CHECKED);
//Numbering type
- m_numberingTypeCombo.SetCurSel(GetRegistry<int>(GetRegistryFolder(), NULL, _T("AutoEnumStyleNumType"), 0));
+ m_numberingTypeCombo.SetCurSel((m_iNumberingTypeCombo = GetRegistry<int>(GetRegistryFolder(), NULL, _T("AutoEnumStyleNumType"), 0)));
//Numbering index
- std::wstring strIndex = stringize() << GetRegistry<int>(GetRegistryFolder(), NULL, _T("AutoEnumStyleIndex"), 1);
+ std::wstring strIndex = stringize() << (m_iIndex = GetRegistry<int>(GetRegistryFolder(), NULL, _T("AutoEnumStyleIndex"), 1));
m_index.SetWindowText(strIndex.c_str());
//Addition string
HKEY hKey;
if(RegCreateKey(HKEY_CURRENT_USER, GetRegistryFolder(),&hKey) != ERROR_SUCCESS)
{
- MessageBox(_T("Failed load key for addition string!"));
- return FALSE;
+ MessageBox(_T("Failed load key for addition string!"));
+ return FALSE;
}
DWORD dwType = 0;
wchar_t buffer[5] = {0};
DWORD dwSize = sizeof(buffer);
if(RegQueryValueEx(hKey,_T("AutoEnumStyleAddition"),0,&dwType, (LPBYTE)buffer, &dwSize) == ERROR_SUCCESS)
- m_addition.SetWindowText(_bstr_t(buffer));
+ m_addition.SetWindowText((m_szAddition = _bstr_t(buffer)));
else
- m_addition.SetWindowText(_T(". "));
+ m_addition.SetWindowText(m_szAddition = _T("."));
RegCloseKey(hKey);
@@ -88,34 +88,38 @@
if(index <= 0 || index > 9999)
{
MessageBox(_T("Starting index must be in range of 1-9999!"), _T("Error"), MB_OK | MB_ICONERROR);
- return PSNRET_INVALID;
+ return PSNRET_INVALID;
}
if(index > 3999 && m_numberingTypeCombo.GetCurSel() == 1)
{
MessageBox(_T("Index too big! Use another type of enumeration. Roman index can be from 0-3999."),
_T("Error"),MB_OK | MB_ICONERROR);
- return PSNRET_INVALID;
+ return PSNRET_INVALID;
}
if(bResult)
{
- SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnum"), m_bAutoEnum);
- SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumType"),m_nearestNumberedMsg.GetCheck() == BST_CHECKED);
- SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleEnabled"),m_useNumberingStyle.GetCheck() == BST_CHECKED);
- SetRegistry<int>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleNumType"),m_numberingTypeCombo.GetCurSel());
- SetRegistry<int>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleIndex"),index);
-
- //Store addition string
- m_addition.GetWindowTextW(temp);
- if(!temp) temp = _T("");
- HKEY hKey;
- if(RegCreateKey(HKEY_CURRENT_USER, GetRegistryFolder(), &hKey) != ERROR_SUCCESS)
- MessageBox(_T("Failed to create key for addition string!"));
- else if(RegSetValueEx(hKey,_T("AutoEnumStyleAddition"),0, REG_SZ, (CONST LPBYTE)temp, 2*sizeof(BSTR)) != ERROR_SUCCESS)
- MessageBox(_T("Failed to set registry key for addition string!"));
- RegCloseKey(hKey);
+ SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnum"), m_bAutoEnum);
+ SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumType"),m_nearestNumberedMsg.GetCheck() == BST_CHECKED);
+ SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleEnabled"),m_useNumberingStyle.GetCheck() == BST_CHECKED);
+ SetRegistry<int>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleNumType"),m_numberingTypeCombo.GetCurSel());
+ SetRegistry<int>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleIndex"),index);
+
+ //Store addition string
+ m_addition.GetWindowTextW(temp);
+ if(!temp) temp = _T("");
+ HKEY hKey;
+ if(RegCreateKey(HKEY_CURRENT_USER, GetRegistryFolder(), &hKey) != ERROR_SUCCESS)
+ MessageBox(_T("Failed to create key for addition string!"));
+ else if(RegSetValueEx(hKey,_T("AutoEnumStyleAddition"),0, REG_SZ, (CONST LPBYTE)temp, 2*sizeof(BSTR)) != ERROR_SUCCESS)
+ MessageBox(_T("Failed to set registry key for addition string!"));
+ RegCloseKey(hKey);
- return PSNRET_NOERROR;
+ //If numbering style changed, erase autoNumberingGroupID -> force creating new autoNumbering style
+ if((_tcsicmp(temp,m_szAddition) != 0) || (m_iIndex != index) || m_iNumberingTypeCombo != m_numberingTypeCombo.GetCurSel())
+ SetRegistry<bool>(HKEY_CURRENT_USER, GetRegistryFolder(), _T("AutoEnumStyleIndexChanged"), true);
+
+ return PSNRET_NOERROR;
}
return PSNRET_INVALID;
Modified: trunk/src/view/visio/addon/numberingGlobalDlg.h
===================================================================
--- trunk/src/view/visio/addon/numberingGlobalDlg.h 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/numberingGlobalDlg.h 2010-07-05 22:56:28 UTC (rev 826)
@@ -67,6 +67,9 @@
CEdit m_index;
bool m_bAutoEnum;
+ int m_iNumberingTypeCombo;
+ int m_iIndex;
+ _bstr_t m_szAddition;
LRESULT OnBnClickedEnumCheck(WORD, WORD, HWND, BOOL&);
LRESULT OnBnClickedNearestMsg(WORD, WORD, HWND, BOOL&);
Modified: trunk/src/view/visio/addon/resource.h
===================================================================
--- trunk/src/view/visio/addon/resource.h 2010-07-04 14:02:59 UTC (rev 825)
+++ trunk/src/view/visio/addon/resource.h 2010-07-05 22:56:28 UTC (rev 826)
@@ -100,6 +100,7 @@
#define IDC_COMBO_NUMBERING_GLOBAL 276
#define IDC_ADDITION_GLOBAL 277
#define IDC_STARTING_INDEX_GLOBAL 278
+#define IDC_CHECK1 279
// Next default values for new objects
//
@@ -107,7 +108,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 227
#define _APS_NEXT_COMMAND_VALUE 32768
-#define _APS_NEXT_CONTROL_VALUE 279
+#define _APS_NEXT_CONTROL_VALUE 280
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|