|
From: <mbe...@us...> - 2010-05-13 18:38:53
|
Revision: 775
http://scstudio.svn.sourceforge.net/scstudio/?rev=775&view=rev
Author: mbezdeka
Date: 2010-05-13 18:38:46 +0000 (Thu, 13 May 2010)
Log Message:
-----------
global settings dialog added
Modified Paths:
--------------
trunk/doc/help/frontend/shortcuts.html
trunk/doc/help/frontend.html
trunk/doc/help/scstudio.hhc
trunk/src/view/visio/addon/addon.cpp
trunk/src/view/visio/addon/dllmodule.rc
trunk/src/view/visio/addon/document.cpp
trunk/src/view/visio/addon/document.h
trunk/src/view/visio/addon/enumerationDlg.h
trunk/src/view/visio/addon/messagesequencedlg.cpp
trunk/src/view/visio/addon/resource.h
trunk/src/view/visio/addon/scstudio.vcproj
Added Paths:
-----------
trunk/doc/help/frontend/message-numbering.html
trunk/doc/help/frontend/pictures/icon_message_enumeration.png
trunk/doc/help/frontend/pictures/icon_message_enumeration_disable.png
trunk/doc/help/frontend/pictures/message_numbering_options.png
trunk/src/view/visio/addon/GlobalSettingsDlg.cpp
trunk/src/view/visio/addon/GlobalSettingsDlg.h
trunk/src/view/visio/addon/numberingGlobalDlg.cpp
trunk/src/view/visio/addon/numberingGlobalDlg.h
Removed Paths:
-------------
trunk/doc/help/pictures/icon_message_enumeration.png
trunk/doc/help/pictures/icon_message_enumeration_disable.png
trunk/doc/help/pictures/message_numbering_options.png
Added: trunk/doc/help/frontend/message-numbering.html
===================================================================
--- trunk/doc/help/frontend/message-numbering.html (rev 0)
+++ trunk/doc/help/frontend/message-numbering.html 2010-05-13 18:38:46 UTC (rev 775)
@@ -0,0 +1,25 @@
+<!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">
+</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>By pressing Message numbering button <img src="pictures/icon_message_enumeration.png" alt="Message Numbering"> 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">
+</p>
+
+<p>You can choose specific numbering type (numbers, letters, capital letters, romans), starting index (1-9999) and additional string following the index such as ".", ",", …</p>
+
+<p>If <code>automatically enumerate new messages</code> is checked, any newly dropped messages will be enumerate according to the nearest numbered group.</p>
+
+<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 or by using hotkey <Code>Ctrl+Alt+D.</Code></p>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/doc/help/frontend/pictures/icon_message_enumeration.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/help/frontend/pictures/icon_message_enumeration.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/doc/help/frontend/pictures/icon_message_enumeration_disable.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/help/frontend/pictures/icon_message_enumeration_disable.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/doc/help/frontend/pictures/message_numbering_options.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/help/frontend/pictures/message_numbering_options.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/doc/help/frontend/shortcuts.html
===================================================================
--- trunk/doc/help/frontend/shortcuts.html 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/doc/help/frontend/shortcuts.html 2010-05-13 18:38:46 UTC (rev 775)
@@ -13,6 +13,8 @@
<tr><td><code>Ctrl+Alt+M</code></td><td><a href="shape-selection.html">Select all message</a></td></tr>
<tr><td><code>Ctrl+Alt+F</code></td><td><a href="automatic-drawing.html#add_instances">Add instances</a></td></tr>
<tr><td><code>Ctrl+Alt+S</code></td><td><a href="automatic-drawing.html#message_sequence">Message sequence</a></td></tr>
+<tr><td><code>Ctrl+Alt+E</code></td><td><a href="message-numbering.html">Message Numbering</a></td></tr>
+<tr><td><code>Ctrl+Alt+D</code></td><td><a href="message-numbering.html">Delete Message Numbering</a></td></tr>
</table>
</body>
Modified: trunk/doc/help/frontend.html
===================================================================
--- trunk/doc/help/frontend.html 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/doc/help/frontend.html 2010-05-13 18:38:46 UTC (rev 775)
@@ -23,21 +23,5 @@
See the <a href="frontend/shortcuts.html">Keyboard accelerators</a> section to
list all of them.</p>
-<h2>Message Numbering</h2>
-<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>By pressing Message numbering button <img src="pictures/icon_message_enumeration.png" alt="Message Numbering"> 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">
-</p>
-
-<p>You can choose specific numbering type (numbers, letters, capital letters, romans), starting index (1-9999) and additional string following the index such as ".", ",", …</p>
-
-<p>If <code>automatically enumerate new messages</code> is checked, any newly dropped messages will be enumerate according to the nearest numbered group.</p>
-
-<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 or by using hotkey <Code>Ctrl+Alt+D.</Code></p>
-
</body>
</html>
Deleted: trunk/doc/help/pictures/icon_message_enumeration.png
===================================================================
(Binary files differ)
Deleted: trunk/doc/help/pictures/icon_message_enumeration_disable.png
===================================================================
(Binary files differ)
Deleted: trunk/doc/help/pictures/message_numbering_options.png
===================================================================
(Binary files differ)
Modified: trunk/doc/help/scstudio.hhc
===================================================================
--- trunk/doc/help/scstudio.hhc 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/doc/help/scstudio.hhc 2010-05-13 18:38:46 UTC (rev 775)
@@ -22,6 +22,10 @@
<param name="Local" value="frontend\automatic-drawing.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
+ <param name="Name" value="Message Numbering">
+ <param name="Local" value="frontend\message-numbering.html">
+ </OBJECT>
+ <LI> <OBJECT type="text/sitemap">
<param name="Name" value="Keyboard accelerators">
<param name="Local" value="frontend\shortcuts.html">
</OBJECT>
Added: trunk/src/view/visio/addon/GlobalSettingsDlg.cpp
===================================================================
--- trunk/src/view/visio/addon/GlobalSettingsDlg.cpp (rev 0)
+++ trunk/src/view/visio/addon/GlobalSettingsDlg.cpp 2010-05-13 18:38:46 UTC (rev 775)
@@ -0,0 +1,124 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2010 Martin Bezdeka <mbe...@se...>
+ *
+ */
+#include "stdafx.h"
+#include "dllmodule.h"
+#include "GlobalSettingsDlg.h"
+
+
+
+CTabCtrlMSC::CTabCtrlMSC()
+{
+ dialogs[0] = new CNumberingGlobalDlg;
+
+ m_nNumberOfPages = 1;
+}
+
+CTabCtrlMSC::~CTabCtrlMSC()
+{
+ for(int i=0; i<m_nNumberOfPages; i++)
+ delete dialogs[i];
+}
+
+void CTabCtrlMSC::Init()
+{
+ m_tabCurrent = 0;
+ dialogs[0]->Create(this->m_hWnd,NULL);
+ dialogs[0]->ShowWindow(SW_SHOW);
+
+ SetRectangle();
+}
+
+void CTabCtrlMSC::SetRectangle()
+{
+ RECT tabRect, itemRect;
+ int nX, nY, nXc, nYc;
+
+ GetClientRect(&tabRect);
+ GetItemRect(0, &itemRect);
+
+ nX=itemRect.left;
+ nY=itemRect.bottom+2;
+ nXc=tabRect.right-itemRect.left-3;
+ nYc=tabRect.bottom-nY-3;
+
+ dialogs[0]->SetWindowPos(HWND_TOP, nX, nY, nXc, nYc, SWP_SHOWWINDOW);
+ //hiding other windows
+ for(int i=1; i < m_nNumberOfPages; i++)
+ {
+ dialogs[i]->SetWindowPos(HWND_TOP, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CMyTabCtrl message handlers
+
+LRESULT CTabCtrlMSC::OnLButtonDown(UINT nFlags, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
+{
+ //not implemented yet!
+
+ /*CTabCtrl::OnLButtonDown(nFlags, point);
+
+ if(m_tabCurrent != this->GetCurFocus() != 0)
+ {
+ dialogs[0]->ShowWindow(SW_HIDE);
+ }*/
+
+ return 0;
+}
+
+//////////////////////////////
+// GLOBAL SETTINGS DIALOG
+
+LRESULT CGlobalSettingsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ CenterWindow(GetParent());
+
+ DoDataExchange();
+ LoadRegistryData();
+
+
+ return bHandled = FALSE;
+}
+
+LRESULT CGlobalSettingsDlg::OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
+{
+ if(wID == IDOK)
+ {
+ DoDataExchange(TRUE);
+ if(SaveRegistryData() == 0)
+ EndDialog(wID);
+ }
+ else if(wID == IDCANCEL)
+ EndDialog(wID);
+
+ return 0;
+}
+
+int CGlobalSettingsDlg::LoadRegistryData()
+{
+ m_tabSettings.AddItem(_T("Numbering"));
+ m_tabSettings.Init();
+
+ DoDataExchange();
+
+ return 0;
+}
+
+int CGlobalSettingsDlg::SaveRegistryData()
+{
+ return 0;
+}
Added: trunk/src/view/visio/addon/GlobalSettingsDlg.h
===================================================================
--- trunk/src/view/visio/addon/GlobalSettingsDlg.h (rev 0)
+++ trunk/src/view/visio/addon/GlobalSettingsDlg.h 2010-05-13 18:38:46 UTC (rev 775)
@@ -0,0 +1,83 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2010 Martin Bezdeka <mbe...@se...>
+ *
+ */
+
+#pragma once
+
+#include <atldlgs.h>
+#include <atlctrls.h>
+#include <atlddx.h>
+#include <string>
+#include <sstream>
+#include "data/msc.h"
+#include "GlobalSettingsDlg.h"
+#include "numberingGlobalDlg.h"
+
+class CTabCtrlMSC : public ATL::CWindowImpl<CTabCtrlMSC, CTabCtrl>
+{
+// Construction
+public:
+ CTabCtrlMSC();
+ virtual ~CTabCtrlMSC();
+
+ int m_tabCurrent;
+ int m_nNumberOfPages;
+ //Add your specific dialog on the tab
+ CNumberingGlobalDlg* dialogs[1];
+
+ void Init();
+ void SetRectangle();
+
+protected:
+ BEGIN_MSG_MAP(CTabCtrlMSC)
+ MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
+ END_MSG_MAP()
+
+ LRESULT OnLButtonDown(UINT, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+};
+
+/////////////////////////////////////
+// GLOBAL SETTINGS DIALOG
+
+class CGlobalSettingsDlg
+ : public ATL::CDialogImpl<CGlobalSettingsDlg>, public CWinDataExchange<CGlobalSettingsDlg>
+{
+public:
+ //CGlobalSettingsDlg();
+ enum { IDD = IDD_GLOBAL_SETTINGS };
+
+ CTabCtrlMSC m_tabSettings;
+
+protected:
+BEGIN_DDX_MAP(CGlobalSettingsDlg)
+ DDX_CONTROL(IDC_TAB_SETTINGS, m_tabSettings);
+END_DDX_MAP()
+
+BEGIN_MSG_MAP(CGlobalSettingsDlg)
+ MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+ COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
+ COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
+END_MSG_MAP()
+
+// Handler prototypes:
+
+ LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+
+ int LoadRegistryData();
+ int SaveRegistryData();
+
+};
\ No newline at end of file
Modified: trunk/src/view/visio/addon/addon.cpp
===================================================================
--- trunk/src/view/visio/addon/addon.cpp 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/addon.cpp 2010-05-13 18:38:46 UTC (rev 775)
@@ -331,6 +331,9 @@
case CDocumentMonitor::MENU_DISABLE_MESSAGE_ENUMERATION:
TRACE("CStudioAddon::Run() disable message enumeration");
return pDocumentMonitor->OnMenuDisableMessageEnumeration(vsoApp);
+ case CDocumentMonitor::MENU_GLOBAL_SETTINGS:
+ TRACE("CStudioAddon::Run() global settings");
+ return pDocumentMonitor->OnMenuGlobalSettings(vsoApp);
default:
TRACE("CStudioAddon::Run() unexpected event id=" << iEvent);
@@ -478,19 +481,22 @@
TRACE("CStudioAddon::HandleVisioEvent() visEvtCodeWinSelChange");
HandleWinSelChange(pSourceObj);
break;
+
case Visio::visEvtCodeShapeBeforeTextEdit:
TRACE("CStudioAddon::HandleVisioEvent() visEvtCodeShapeBeforeTextEdit");
HandleBeforeTextEdit(pSubjectObj, pSourceObj);
break;
+
case Visio::visEvtCodeShapeExitTextEdit:
TRACE("CStudioAddon::HandleVisioEvent() visEvtCodeShapeExitTextEdit");
HandleAfterTextEdit(pSubjectObj, pSourceObj);
break;
+
case Visio::visEvtDel+Visio::visEvtShape:
TRACE("CStudioAddon::HandleVisioEvent() visEvtCodeShapeDelete");
HandleBeforeShapeDeleted(pSubjectObj, pSourceObj);
break;
-
+
case visEvtApp+visEvtNonePending:
TRACE("CStudioAddon::HandleVisioEvent() visEvtNonePending");
HandleNonePending(pSourceObj);
@@ -547,7 +553,7 @@
(GetDocumentMonitor(vsoCell->Application,vsoCell->Application->ActiveDocument)->isMessageShape(vsoCell->Shape)) &&
(_tcsicmp(vsoCell->Shape->Data1,_T("1")) == 0))
{
- //vlozit do mnoziny
+ //add to set
m_enumerationGroups.insert(vsoCell->Shape->Data3);
m_bCellChanged = true;
}
@@ -655,25 +661,8 @@
m_enumerationGroups.clear();
- //for(int i=1; i<=shapesPtr->Count; i++)
- //{
- // Visio::IVShapePtr shape = shapesPtr->Item[i];
- // if(!GetDocumentMonitor(vsoApp,vsoApp->ActiveDocument)->isMessageShape(shape) || !_tcsicmp(shape->Data1,_T("1")) == 0)
- // continue;
- //
- // GetDocumentMonitor(vsoApp,vsoApp->ActiveDocument)->OnMenuDisableMessageEnumeration(vsoApp);
- // break;
- //}
m_bShapeDeleted = m_bCellChanged = false;
}
- //if(m_bTextChanged)
- //{
- // for(std::set<_bstr_t>::iterator it = m_enumerationGroups.begin(); it != m_enumerationGroups.end(); it++)
- // GetDocumentMonitor(vsoApp,vsoApp->ActiveDocument)->drawNumbers(vsoApp->ActivePage->Shapes,*it);
-
- // m_enumerationGroups.clear();
- // m_bTextChanged = false;
- //}
}
void CStudioAddon::HandleBeforeTextEdit(Visio::IVShapePtr shapePtr, Visio::IVApplicationPtr vsoApp)
@@ -684,8 +673,6 @@
shapePtr->Text = shapePtr->Data2;
m_bMessageTextEdited = true;
}
- /*else if(_tcsicmp(shapePtr->Data1,_T("")) != 0)
- MessageBox(GetActiveWindow(),_T("Corrupted enumeration! Data1 has wrong format"),_T("Error"),MB_OK | MB_ICONERROR);*/
}
void CStudioAddon::HandleAfterTextEdit(Visio::IVShapePtr shapePtr, Visio::IVApplicationPtr vsoApp)
@@ -710,18 +697,6 @@
void CStudioAddon::HandleTextChanged(Visio::IVShapePtr shapePtr,Visio::IVDocumentPtr vsoDocument)
{
- //if(m_bMessageTextEdited)
- // return;
-
- //if(vsoDocument->Application->IsUndoingOrRedoing == VARIANT_TRUE)
- // return;
-
- //if(GetDocumentMonitor(vsoDocument->Application,vsoDocument)->isMessageShape(shapePtr) && _tcsicmp(shapePtr->Data1,_T("1")) == 0)
- //{
- // shapePtr->Data2 = shapePtr->Text;
- // m_enumerationGroups.insert(shapePtr->Data3);
- // m_bTextChanged = true;
- //}
}
void CStudioAddon::RegisterPersistentEvents(Visio::IVDocumentPtr vsoDocument)
Modified: trunk/src/view/visio/addon/dllmodule.rc
===================================================================
--- trunk/src/view/visio/addon/dllmodule.rc 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/dllmodule.rc 2010-05-13 18:38:46 UTC (rev 775)
@@ -206,7 +206,37 @@
"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | WS_TABSTOP,12,54,144,12
END
+IDD_GLOBAL_SETTINGS DIALOGEX 0, 0, 311, 202
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Settings"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,200,180,50,15
+ PUSHBUTTON "Cancel",IDCANCEL,254,180,50,15
+ CONTROL "",IDC_TAB_SETTINGS,"SysTabControl32",0x0,7,7,297,170
+END
+IDD_NUMBERING_GLOBAL DIALOGEX 0, 0, 289, 134
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_TRANSPARENT
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "",IDC_STATIC,7,7,275,119
+ CONTROL "automatic numbering new messages",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,7,126,10
+ CONTROL "as nearest message",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,24,26,80,10
+ CONTROL "as nearest numbered message",IDC_RADIO3,"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_RADIO2,"Button",BS_AUTORADIOBUTTON,24,81,58,10
+ CONTROL "use numbering style:",IDC_RADIO4,"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,244,95,25,14,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Index:",IDC_STATIC,221,97,21,8,SS_CENTERIMAGE
+END
+
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@@ -261,6 +291,27 @@
TOPMARGIN, 7
BOTTOMMARGIN, 68
END
+
+ IDD_GLOBAL_SETTINGS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 304
+ VERTGUIDE, 200
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 195
+ HORZGUIDE, 177
+ HORZGUIDE, 180
+ END
+
+ IDD_NUMBERING_GLOBAL, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 282
+ VERTGUIDE, 14
+ VERTGUIDE, 24
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 127
+ END
END
#endif // APSTUDIO_INVOKED
Modified: trunk/src/view/visio/addon/document.cpp
===================================================================
--- trunk/src/view/visio/addon/document.cpp 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/document.cpp 2010-05-13 18:38:46 UTC (rev 775)
@@ -24,8 +24,12 @@
#include "extract.h"
#include "visualize.h"
#include "finddlg.h"
+
+//Dialog classes
#include "messagesequencedlg.h"
#include "enumerationDlg.h"
+#include "GlobalSettingsDlg.h"
+
#include <fstream>
#include "shapeutils.h"
@@ -71,9 +75,6 @@
LoadModulesFromRegistry(HKEY_LOCAL_MACHINE);
LoadModulesFromRegistry(HKEY_CURRENT_USER);
-
-
- ID = 1; // message group ID
}
CDocumentMonitor::~CDocumentMonitor()
@@ -513,6 +514,12 @@
itemCheckOptions->AddOnName = ADDON_NAME;
itemCheckOptions->AddOnArgs = stringize() << L"/event=" << MENU_CHECK_OPTIONS;
+ Visio::IVMenuItemPtr globalSettings = itemDrawing->MenuItems->Add();
+ globalSettings->Caption = "&Settings...";
+ globalSettings->AddOnName = ADDON_NAME;
+ globalSettings->BeginGroup = true;
+ globalSettings->AddOnArgs = stringize() << L"/event=" << MENU_GLOBAL_SETTINGS;
+
// step 2: create accelerators
// note: the accelerators must be created in this custom menu set
// note: the accelerators are bound with menu items via CmdNum property
@@ -554,17 +561,6 @@
accelItemMessageEnumerationDisable->Control = true;
accelItemMessageEnumerationDisable->Alt = true;
- //Visio::IVMenuSetsPtr visMenuSets = vsoMenus->MenuSets;
-
- //Visio::IVMenuSetPtr visMenuSet = visMenuSets->ItemAtID[visUIObjSetCntx_DrawObjSel];
- //Visio::IVMenusPtr visMenus = visMenuSet->Menus;
- //Visio::IVMenuPtr visMenu = visMenus->Item[0];
- //visMenuItems = visMenu->MenuItems;
-
- //visMenuItems->AddAt(0);
- //visMenuItems->Item[0]->Caption = _T("Select numbering group");
- //visMenuItems->Item[0]->Visible = false;
-
m_vsoDocument->SetCustomMenus(vsoMenus);
}
@@ -687,7 +683,7 @@
m_disableMessageEnumerationToolbarItem->Enabled = enabled;
itemMessageEnumerating->Enabled = enabled;
- //DODELAT HORKE KLAVESY!!!!
+ //TODO: add hot keys!
accelItemMessageEnumeration->Control = enabled;
accelItemMessageEnumerationDisable->Control = enabled;
@@ -1246,7 +1242,7 @@
_T("Error"), MB_OK | MB_ICONEXCLAMATION);
return VAORC_FAILURE;
}
-
+
// step 3: dialog
CShapeComparator instanceCmp;
MsgSeqDirection origDir = (instanceCmp(boundaries.first, boundaries.second) ? MSDIR_RIGHT : MSDIR_LEFT);
@@ -1621,6 +1617,14 @@
return false;
}
+VAORC CDocumentMonitor::OnMenuGlobalSettings(Visio::IVApplicationPtr vsoApp)
+{
+ CGlobalSettingsDlg dlg;
+
+ dlg.DoModal();
+ return VAORC_SUCCESS;
+}
+
void CDocumentMonitor::ShowReportView()
{
if(m_reportVisible)
Modified: trunk/src/view/visio/addon/document.h
===================================================================
--- trunk/src/view/visio/addon/document.h 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/document.h 2010-05-13 18:38:46 UTC (rev 775)
@@ -82,6 +82,7 @@
MENU_SELECT_ADD_ALL_MESSAGES,
MENU_ENABLE_MESSAGE_ENUMERATION,
MENU_DISABLE_MESSAGE_ENUMERATION,
+ MENU_GLOBAL_SETTINGS,
};
VAORC OnMenuWindowsReporter(Visio::IVApplicationPtr vsoApp);
@@ -99,6 +100,7 @@
VAORC OnMenuEnableMessageEnumeration(Visio::IVApplicationPtr vsoApp);
VAORC OnMenuDisableMessageEnumeration(Visio::IVApplicationPtr vsoApp);
VAORC OnMenuSelectNumberedGroup(Visio::IVApplicationPtr vsoApp);
+ VAORC OnMenuGlobalSettings(Visio::IVApplicationPtr vsoApp);
void ShowReportView();
void OnHideReportView();
@@ -301,12 +303,7 @@
Visio::IVShapePtr DrawMessage(Visio::IVMasterPtr msgMaster, Visio::IVShapePtr from, Visio::IVShapePtr to, double yCoord, const TCHAR* caption, MsgSeqCoregionTreatment coregionTreatment);
public:
- /**
- *******************************
- * Message enumeration functions
- *******************************
- *
- *
+ /*
* Returns whether shape is message (ordinary, lost, found)
* @param shape a shape to check
*/
@@ -326,8 +323,6 @@
void enumerate(Visio::IVApplicationPtr vsoApp, _bstr_t groupID, bool enable, bool onlySelected);
bool temporaryDisableEnumeration(Visio::IVApplicationPtr vsoApp);
void restoreDisabledEnumeration(Visio::IVApplicationPtr vsoApp, bool UndoEnumNewMsg);
-
- int ID;
Visio::IVMenuItemsPtr visMenuItems;
Visio::IVMenuItemPtr itemMessageEnumerating;
Modified: trunk/src/view/visio/addon/enumerationDlg.h
===================================================================
--- trunk/src/view/visio/addon/enumerationDlg.h 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/enumerationDlg.h 2010-05-13 18:38:46 UTC (rev 775)
@@ -44,14 +44,14 @@
CButton m_enumerateNew;
protected:
-BEGIN_DDX_MAP(CNumberMessage)
+BEGIN_DDX_MAP(CEnumerationDlg)
DDX_CONTROL_HANDLE(IDC_COMBO_NUMBERING, m_numbering);
DDX_CONTROL_HANDLE(IDC_ADDITION, m_addition);
DDX_CONTROL_HANDLE(IDC_STARTING_INDEX, m_index);
DDX_CONTROL_HANDLE(IDC_CHECK_ENUMERATE_NEW, m_enumerateNew);
END_DDX_MAP()
-BEGIN_MSG_MAP(CNumberMessage)
+BEGIN_MSG_MAP(CEnumerationDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
Modified: trunk/src/view/visio/addon/messagesequencedlg.cpp
===================================================================
--- trunk/src/view/visio/addon/messagesequencedlg.cpp 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/messagesequencedlg.cpp 2010-05-13 18:38:46 UTC (rev 775)
@@ -131,7 +131,7 @@
sMsg = "Unknown error";
TRACE("CMessageSequenceDlg::OnDataValidateError() does not have a validation error message for a control");
}
-
+
MessageBox(sMsg, _T("Message Sequence Error"), MB_ICONEXCLAMATION);
}
Added: trunk/src/view/visio/addon/numberingGlobalDlg.cpp
===================================================================
--- trunk/src/view/visio/addon/numberingGlobalDlg.cpp (rev 0)
+++ trunk/src/view/visio/addon/numberingGlobalDlg.cpp 2010-05-13 18:38:46 UTC (rev 775)
@@ -0,0 +1,57 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2010 Martin Bezdeka <mbe...@se...>
+ *
+ */
+
+#include "stdafx.h"
+#include "dllmodule.h"
+#include "numberingGlobalDlg.h"
+
+
+LRESULT CNumberingGlobalDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ CenterWindow(GetParent());
+
+ DoDataExchange();
+ LoadRegistryData();
+
+ return bHandled = FALSE;
+}
+
+LRESULT CNumberingGlobalDlg::OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
+{
+ if(wID == IDOK)
+ {
+ DoDataExchange(TRUE);
+ if(SaveRegistryData() == 0)
+ EndDialog(wID);
+ }
+ else if(wID == IDCANCEL)
+ EndDialog(wID);
+
+ return 0;
+}
+
+int CNumberingGlobalDlg::LoadRegistryData()
+{
+
+ return 0;
+}
+
+int CNumberingGlobalDlg::SaveRegistryData()
+{
+
+ return 0;
+}
Added: trunk/src/view/visio/addon/numberingGlobalDlg.h
===================================================================
--- trunk/src/view/visio/addon/numberingGlobalDlg.h (rev 0)
+++ trunk/src/view/visio/addon/numberingGlobalDlg.h 2010-05-13 18:38:46 UTC (rev 775)
@@ -0,0 +1,58 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2010 Martin Bezdeka <mbe...@se...>
+ *
+ */
+
+#pragma once
+
+#include <atldlgs.h>
+#include <atlctrls.h>
+#include <atlddx.h>
+#include <string>
+#include <sstream>
+#include "data/msc.h"
+
+class CNumberingGlobalDlg
+ : public ATL::CDialogImpl<CNumberingGlobalDlg>, public CWinDataExchange<CNumberingGlobalDlg>
+{
+public:
+ //CNumberingGlobalDlg(int startIndex, int enumType, bool enumNew, BSTR addition);
+ enum { IDD = IDD_NUMBERING_GLOBAL };
+
+protected:
+BEGIN_DDX_MAP(CNumberingGlobalDlg)
+ //DDX_CONTROL_HANDLE(IDC_COMBO_NUMBERING, m_numbering);
+ //DDX_CONTROL_HANDLE(IDC_ADDITION, m_addition);
+ //DDX_CONTROL_HANDLE(IDC_STARTING_INDEX, m_index);
+ //DDX_CONTROL_HANDLE(IDC_CHECK_ENUMERATE_NEW, m_enumerateNew);
+END_DDX_MAP()
+
+BEGIN_MSG_MAP(CNumberingGlobalDlg)
+ MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+ COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
+ COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
+END_MSG_MAP()
+
+// Handler prototypes:
+
+ LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+
+ int LoadRegistryData();
+ int SaveRegistryData();
+
+public:
+
+};
Modified: trunk/src/view/visio/addon/resource.h
===================================================================
--- trunk/src/view/visio/addon/resource.h 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/resource.h 2010-05-13 18:38:46 UTC (rev 775)
@@ -40,6 +40,8 @@
#define IDC_IF_START_POS_X 223
#define IDI_ICON_DISABLE_MESSAGE_ENUMERATION 223
#define IDI_MESSAGE_NUMBERING_DISABLE 224
+#define IDD_GLOBAL_SETTINGS 224
+#define IDD_NUMBERING_GLOBAL 225
#define IDC_OPTIONS_SWITCH_BTN 226
#define IDC_OPTIONS_SWITCH_LBL 227
#define IDC_OPTIONS_GROUP_BOX 228
@@ -56,6 +58,7 @@
#define IDC_TOTAL_WIDTH_RDO 242
#define IDC_RADIO2 243
#define IDC_SPACING_RDO 243
+#define IDC_MS_DIR_RIGHT 243
#define IDC_IF_TOTAL_WIDTH 244
#define IDC_DEFAULT_BTN 245
#define IDC_MS_DIR_LEFT 251
@@ -79,23 +82,28 @@
#define IDC_IF_UNITS1 262
#define IDC_MS_COREGION_ERROR 263
#define IDC_MS_COREGION_CONTINUE 264
+#define IDC_RADIO1 264
#define IDC_MS_COREGION_ORDER 265
+#define IDC_TAB2 265
+#define IDC_TAB_SETTINGS 265
+#define IDC_RADIO3 265
#define IDC_IF_UNITS2 267
#define IDC_IF_UNITS3 268
#define IDC_MS_CONNECT_WITH_LINE 268
#define IDC_IF_UNITS4 269
#define IDC_MS_CONNECT_WITH_SIDE_SIDE 269
-#define IDC_MS_DIR_LEFT 251
-#define IDC_MS_DIR_LEFT_RIGHT 252
-#define IDC_MS_LEFT_MESSAGE 254
-#define IDC_MS_DIR_RIGHT 243
+#define IDC_CHECK2 271
+#define IDC_RADIO4 273
+#define IDC_COMBO_NUMBERING_GLOBAL 276
+#define IDC_ADDITION_GLOBAL 277
+
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 224
+#define _APS_NEXT_RESOURCE_VALUE 226
#define _APS_NEXT_COMMAND_VALUE 32768
-#define _APS_NEXT_CONTROL_VALUE 270
+#define _APS_NEXT_CONTROL_VALUE 278
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Modified: trunk/src/view/visio/addon/scstudio.vcproj
===================================================================
--- trunk/src/view/visio/addon/scstudio.vcproj 2010-05-13 16:46:24 UTC (rev 774)
+++ trunk/src/view/visio/addon/scstudio.vcproj 2010-05-13 18:38:46 UTC (rev 775)
@@ -336,6 +336,14 @@
>
</File>
<File
+ RelativePath=".\GlobalSettingsDlg.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\GlobalSettingsDlg.h"
+ >
+ </File>
+ <File
RelativePath=".\instancesfielddlg.cpp"
>
</File>
@@ -352,6 +360,14 @@
>
</File>
<File
+ RelativePath=".\numberingGlobalDlg.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\numberingGlobalDlg.h"
+ >
+ </File>
+ <File
RelativePath=".\optionsdlg.cpp"
>
</File>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|