summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-11-27 12:39:32 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-11-27 12:39:32 +0000
commit98686c447f73b1fb65393dde646e87355006ac43 (patch)
tree0bc6e9aa82ed69528ee7e1d13e5116fe9044e29d /svtools
parentcf144cb77169bfc84604434f4b7923fe5dac3d1e (diff)
dba33a: summary migration from SVN
2009-11-06 13:10:39 +0000 msc r277387 : minor fix for automatic test 2009-11-06 13:09:33 +0000 msc r277385 : minor fix for automatic test 2009-11-06 12:30:57 +0000 fs r277383 : argh. On some virtual machines, waiting 5 seconds for the event to arrive is not enough. Increasing the timeout ... 2009-11-06 12:13:34 +0000 fs r277382 : this diagnostic code should not have slipped in 2009-11-05 13:21:06 +0000 fs r277369 : SHL2NOCHECK=TRUE (requested by hjs) 2009-11-04 14:09:46 +0000 msc r277355 : minor fix for automatic testing 2009-11-04 13:23:02 +0000 msc r277352 : minor fix for automatic testing 2009-11-04 10:53:28 +0000 msc r277341 : minor fix for automated testscript 2009-11-04 08:30:58 +0000 msc r277333 : minor fix for automatic test 2009-11-04 08:15:43 +0000 msc r277332 : minor fix for automatic test 2009-11-03 14:25:44 +0000 fs r277324 : #i10000# 2009-11-03 09:47:47 +0000 fs r277315 : found yet another help ID zombie ... moved formhelpid.hrc content to propctrlr.hrc, where it belongs 2009-11-03 08:50:24 +0000 fs r277312 : use createTempFileURL, which cares for some more specialities ... 2009-11-03 08:44:55 +0000 fs r277311 : when creating a temp file for purpose of getting a temp file URL, the delete the file immediately. On some machines/JVMs, the file exists, with write access denied, which isn't Good (TM) 2009-10-22 13:06:17 +0000 fs r277126 : removed wrong assertion 2009-10-21 08:10:35 +0000 fs r277077 : reverted the previous change, which was nonsense 2009-10-21 07:19:43 +0000 fs r277076 : export the component_foo functions, now that some of the objects are built with VISIBILITY_HIDDEN=TRUE 2009-10-21 07:08:35 +0000 fs r277075 : spare useless call 2009-10-20 21:26:31 +0000 fs r277072 : #i10000# 2009-10-20 08:06:04 +0000 fs r277039 : CWS-TOOLING: rebase CWS dba33a to trunk@277035 (milestone: DEV300:m62) 2009-10-16 09:55:25 +0000 fs r276960 : remove one of the superfluous implts_doLayout calls introduced with the previous patch 2009-10-15 13:18:52 +0000 fs r276941 : removed the basic tests. According to cn, they're not used anymore (for a long time), and according to 'du -h', they take up 6.0M on my hard disc. For too much for useless code, /me thinks. 2009-10-15 13:06:51 +0000 fs r276940 : #i10000# remove useless include (otherwise the compiler warning it provokes would need to be fixed by declaring VISIBILITY_HIDDEN=TRUE in the makefile.mk) 2009-10-15 12:52:39 +0000 fs r276939 : #i10000# 2009-10-15 12:44:26 +0000 fs r276938 : #i10000# 2009-10-15 12:00:33 +0000 fs r276936 : #i10000# 2009-10-15 10:31:37 +0000 fs r276934 : #i105259# prepare for the Hidden arg 2009-10-15 10:31:05 +0000 fs r276933 : IsMaximized -> const 2009-10-15 09:50:15 +0000 fs r276932 : during #i105259#: introduce an option to the layout manager to preserve, if possible, the size of the content window when layouting. Enable this option for embedded (SFX-based) documents opened for outplace editing. (the option is incompatible with in-place editing, anyway) This is because such embedded objects couple the (content) window size to the VisAreaSize, in that both are used interchangeably. When an embedded object is closed, it remembers the VisAreaSize, and restores it upon next open. This, however, leads to different content window sizes when the window is closed with another toolbar set than used during opening. This patch here prevents those different content window sizes. Also, now the content window size doesn't change when, explicitly or implicitly, a toolbar is shown or hidden. Instead, the content window size stays the same, and the container window size is adjusted. 2009-10-15 09:32:41 +0000 fs r276931 : during #i105259#: UNO access to more attributes of top windows 2009-10-15 09:30:28 +0000 fs r276930 : indention corrected (better readable) 2009-10-15 09:26:46 +0000 fs r276929 : during #i105259#: access to more attributes of top windows 2009-10-14 10:04:39 +0000 fs r276889 : connecting via services manager, not naming service 2009-10-12 11:31:08 +0000 fs r276831 : during #i105806# FillPropertySet: do not attempt to set *AutoStyleName if it doesn't exist 2009-10-12 11:24:44 +0000 fs r276830 : #i105806# getPropertyValue: throw an UnknownPropertyException for, well, unknown properties 2009-10-08 08:20:58 +0000 fs r276774 : implSubmit: re-throw WrappedTargetExceptions unmodified 2009-10-07 19:19:42 +0000 fs r276770 : #i105198# do not pass an CommandType if we do not have a command 2009-10-07 17:39:36 +0000 fs r276768 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 12:59:17 +0000 fs r276754 : #i87693# 2009-10-07 11:19:22 +0000 fs r276752 : #i10000# 2009-10-07 10:21:08 +0000 fs r276748 : #105482# do not require a controller, at least not in *all* circumstances (executed reports have a model, the ReportDefinition, but no Controller) 2009-10-07 10:04:08 +0000 fs r276747 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:58:30 +0000 fs r276746 : copying the changes from CWS fwk121 herein, in particular the fix for issue #i105371# 2009-10-07 09:48:14 +0000 fs r276744 : removed (now) pointless assertion 2009-10-07 06:59:19 +0000 fs r276740 : export the OWeakObject::disposeWeakConnectionPoint symbol 2009-10-07 06:44:43 +0000 fs r276739 : OComponentHelper::release & WeakAggComponentImplHelperBase::release: when our ref count drops to 0, call OWeakObject's disposeWeakConnectionPoint before (temporarily) incrementing the ref count, again. This ensures that our adapter cannot create references to the dying object anymore. (A complex test case in dbaccess (#i105505#) triggered such a situation, but in another class using an analogous release/dispose/destroy pattern, namely WeakComponentImplHelperBase) 2009-10-07 06:37:20 +0000 fs r276738 : found during some new complex test cases: call disposeWeakConnectionPoint before actually starting to destroy the object, this ensures no other threads will resurrect it while it is dying 2009-10-06 21:58:24 +0000 fs r276734 : oops, two small corrections to the previous fix (hey, complex test cases are cool) 2009-10-06 21:51:16 +0000 fs r276733 : log the name of the data source which cannot be revoked 2009-10-06 21:50:41 +0000 fs r276732 : more detailed error message when cleanup fails 2009-10-06 21:50:01 +0000 fs r276731 : reworked the ModelImpl caching. The new and improved UNO API test for css.sdb.RowSet revealed some inconsistencies, in whether the objects are cached by their URL, or by their registration name. This has been changed to caching by registration name. 2009-10-06 13:50:34 +0000 fs r276714 : print diagnostics when we cannot clean up the test case 2009-10-06 13:45:02 +0000 fs r276713 : this test failed all the time, since the core (rightfully) threw an exception. Disabled it for the moment, until issue 84253 is fixed 2009-10-06 12:52:46 +0000 fs r276711 : rewrote this test. Now we do not re-use the same .odb across different test cases, as this leads to unreliable (timing-dependent) results/failures. Instead, every test sets up a new odb file. Also, did some re-factoring, improved the cleanup code, and caught a few more errors. 2009-10-06 12:51:07 +0000 fs r276710 : DBTools taking a logger now 2009-10-06 12:50:42 +0000 fs r276709 : taking a PrintWriter for logging purpose 2009-10-06 12:50:03 +0000 fs r276708 : DBTools taking a logger now 2009-10-06 12:49:22 +0000 fs r276707 : typo 2009-10-06 12:49:03 +0000 fs r276706 : typo 2009-10-06 12:48:52 +0000 fs r276705 : wrappers around some database-related services - initial versions only, to evolve over time, and intended to finally replace the DBTools class 2009-10-06 12:48:02 +0000 fs r276704 : typo 2009-10-06 12:38:42 +0000 fs r276702 : some better diagnostics, done during getting the API tests to work more reliably 2009-10-06 10:35:51 +0000 fs r276698 : when living in, e.g., the DataSourceBrowser, we can't expect to find an XModifiable2, so don't assert its existence 2009-10-05 12:47:52 +0000 oj r276677 : #i105607# check for read moved into if scope 2009-10-05 11:37:06 +0000 fs r276676 : when saving a file fails, retrieve the error message from the InteractionRequestStringResolver - this is better than any generic message we can create 2009-10-05 10:04:23 +0000 oj r276673 : #i105607# check for read moved into if scope 2009-10-05 09:46:17 +0000 fs r276671 : #i10000# 2009-10-05 08:43:58 +0000 fs r276664 : #i105505# release: dispose the (base classes) weak connection point before disposing ourself, and in particular before temporarily incrementing our ref count, again. This way, we prevent that a separate thread re-surrects us (using the weak connection point's queryAdapted) while we're in the process of destruction 2009-10-05 08:41:49 +0000 fs r276663 : #i105505# +disposeWeakConnectionPoint (outsourced into dedicated method from ::release) 2009-10-05 08:40:26 +0000 fs r276662 : no need to derived from OSubComponent, its features are not used, directly derive from WeakComponentImplFoo instead 2009-10-05 08:39:38 +0000 fs r276661 : #i105505# diagnostics 2009-10-05 08:39:16 +0000 fs r276660 : #i105505# +testDocumentRevenants 2009-10-05 08:36:01 +0000 fs r276659 : #i105560# reverted the removal of GenericController::openHelpAgent - this is needed in module reportdesign 2009-10-04 19:53:30 +0000 fs r276657 : #105560# remove unused code thanks to cmc@openoffice.org for submitting the patch 2009-10-04 19:50:28 +0000 fs r276656 : #i105550# remove unused 'fire' method (thanks to cmc) 2009-10-03 16:13:15 +0000 fs r276655 : CWS-TOOLING: rebase CWS dba33a to trunk@276429 (milestone: DEV300:m60) 2009-10-02 19:20:48 +0000 fs r276651 : #i104117# lotta changed IDs ... 2009-10-02 10:52:24 +0000 fs r276634 : #i105505# If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized. In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl call attachResource. This ensures that the model is initialized completely, including firing the necessary events. 2009-10-02 10:51:08 +0000 fs r276633 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document 2009-10-01 11:10:13 +0000 fs r276597 : do not rely on the name 'Standard' for the one and only form in a document 2009-10-01 10:36:29 +0000 fs r276590 : #i105509# don't rely on default form component names, use indexes 2009-10-01 09:12:20 +0000 fs r276582 : #i105505# 2009-09-30 07:55:21 +0000 fs r276542 : removed some unsed methods / spared some unnecessary pixel<->logic conversion 2009-09-30 07:53:22 +0000 fs r276541 : removed unneeded methods 2009-09-30 06:35:59 +0000 fs r276538 : #i10000# 2009-09-29 13:45:02 +0000 fs r276531 : refactored the Roadmap* classes, to be able to fix above-mentioned #i105113# 2009-09-29 10:27:10 +0000 fs r276520 : #i105367# 2009-09-29 08:46:45 +0000 fs r276510 : #i104956# cleaned up the makefiles 2009-09-28 21:00:07 +0000 fs r276505 : #i104117# sourced those IDs out from extension.hrc 2009-09-28 20:59:05 +0000 fs r276504 : no need to let one FREE... 2009-09-28 20:53:36 +0000 fs r276503 : #i104117# cleaned up the mess with help IDs in module extensions. Formerly, extensions used to use help IDs which were declared in module svx, and vice versa. Also, help ID ranges were not respected. 2009-09-28 11:25:36 +0000 fs r276489 : typo 2009-09-28 11:25:10 +0000 fs r276488 : #i105235# 2009-09-24 11:53:16 +0000 fs r276423 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document) 2009-09-24 09:42:28 +0000 fs r276415 : #i105234# proper zoom handling for the nav bar 2009-09-24 09:42:19 +0000 fs r276414 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double 2009-09-16 11:11:43 +0000 fs r276195 : #i105082# consolidated the sub storage handling, by delegating more functionality into the DocumentStorageAccess class. As a result, there won't be that many unnecessary commits anymore. Also, the two different storage caches (in ModelImpl::m_aStorages and DocumentStorageAccess::m_aExposedStorages) have been consolidated. This is not really part of the fix of issue 105082, but it helped reducing the calls to the storage/package implementation. 2009-09-15 21:42:27 +0000 fs r276190 : don't calculate space for BOLD if the text is not really bold (speeds up rendering for large tree structures) 2009-09-15 20:20:23 +0000 fs r276188 : getTypeInfo: fill m_aTypeInfoRows only if really all type infos could be retrieved 2009-09-15 20:19:29 +0000 fs r276187 : do not continue loading when the controller initialization throws an error 2009-09-14 12:25:57 +0000 fs r276119 : oops, this patch was not intended for this CWS 2009-09-14 12:13:57 +0000 fs r276114 : #cr6875455# introduce a ReferenceDevice property for various control models 2009-09-14 10:33:02 +0000 fs r276106 : removed dead file 2009-09-09 08:37:31 +0000 fs r275972 : remove OSL_TRACE in VCLXButton dtor 2009-09-08 11:19:17 +0000 oj r275926 : i76534# remove mnemonic from fixed text 2009-09-07 08:39:37 +0000 fs r275874 : create CWS dba33a from cws/dba32g@275857 (CWS: dba32g)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/roadmap.hxx82
-rw-r--r--svtools/inc/svtools/hyperlabel.hxx11
-rw-r--r--svtools/inc/svtools/solar.hrc15
-rw-r--r--svtools/source/control/hyperlabel.cxx43
-rw-r--r--svtools/source/control/roadmap.cxx687
5 files changed, 393 insertions, 445 deletions
diff --git a/svtools/inc/roadmap.hxx b/svtools/inc/roadmap.hxx
index 8a6f75eb1428..14ed6abceed6 100644
--- a/svtools/inc/roadmap.hxx
+++ b/svtools/inc/roadmap.hxx
@@ -54,64 +54,8 @@ namespace svt
typedef sal_Int32 ItemIndex;
};
-
class RoadmapImpl;
-
-
- class ORoadmapIDHyperLabel : public FixedText
- {
- public:
- ORoadmapIDHyperLabel( Window* _pParent, const ResId& _rId );
- ORoadmapIDHyperLabel( Window* _pParent, WinBits _nWinStyle = 0 );
- ~ORoadmapIDHyperLabel( );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- };
-
- class ORoadmapHyperLabel : public RoadmapTypes
- {
- private:
- ORoadmapIDHyperLabel* mpIDLabel;
- HyperLabel* mpDescHyperLabel;
-
-
- public:
-
- ORoadmapHyperLabel( Window* _pParent, const ResId& _rId );
- ORoadmapHyperLabel( Window* _pParent, WinBits _nWinStyle = 0 );
- ~ORoadmapHyperLabel( );
-
- void SetID( sal_Int16 _ID );
- sal_Int16 GetID() const;
-
- void SetIndex( sal_Int32 _Index );
- sal_Int32 GetIndex() const;
-
- void SetLabel( ::rtl::OUString _rText );
- ::rtl::OUString GetLabel( );
-
- void SetLabelAndSize( ItemIndex _RMIndex, ::rtl::OUString _rText, const Size& rNewSize);
-
- void SetPosition( ORoadmapHyperLabel* OldHyperLabel );
- Point GetLogicalPosition();
-
- void ToggleBackgroundColor( const Color& _rGBColor );
- void SetInteractive( sal_Bool _bInteractive );
-
- void SetClickHdl( const Link& rLink );
- const Link& GetClickHdl() const;
- void SetZOrder( ORoadmapHyperLabel* pRefRoadmapHyperLabel, USHORT nFlags );
- void Enable( BOOL bEnable = TRUE);
- BOOL IsEnabled() const;
- void GrabFocus();
-
- void SetIDLabel(ORoadmapIDHyperLabel* _pIDLabel){mpIDLabel = _pIDLabel;};
- ORoadmapIDHyperLabel* GetIDLabel() const { return mpIDLabel;};
-
- HyperLabel* GetDescriptionHyperLabel() const { return mpDescHyperLabel;};
- void SetDescriptionHyperLabel(HyperLabel* _pDescriptionHyperLabel){mpDescHyperLabel = _pDescriptionHyperLabel;};
- };
-
-
+ class RoadmapItem;
//=====================================================================
//= Roadmap
@@ -135,7 +79,7 @@ namespace svt
void EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex = 0 );
sal_Bool IsRoadmapItemEnabled( ItemId _nItemId, ItemIndex _nStartIndex = 0 ) const;
- void ChangeRoadmapItemLabel( ItemId _nID, ::rtl::OUString sLabel, ItemIndex _nStartIndex = 0 );
+ void ChangeRoadmapItemLabel( ItemId _nID, const ::rtl::OUString& sLabel, ItemIndex _nStartIndex = 0 );
::rtl::OUString GetRoadmapItemLabel( ItemId _nID, ItemIndex _nStartIndex = 0 );
void ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex = 0 );
@@ -149,8 +93,8 @@ namespace svt
ItemId GetItemID( ItemIndex _nIndex ) const;
ItemIndex GetItemIndex( ItemId _nID ) const;
- void InsertRoadmapItem( ItemIndex _Index, ::rtl::OUString _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
- void ReplaceRoadmapItem( ItemIndex _Index, ::rtl::OUString _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
+ void InsertRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled = sal_True );
+ void ReplaceRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled );
void DeleteRoadmapItem( ItemIndex _nIndex );
ItemId GetCurrentRoadmapItemID() const;
@@ -172,22 +116,20 @@ namespace svt
private:
DECL_LINK(ImplClickHdl, HyperLabel*);
- ORoadmapHyperLabel* GetByIndex( ItemIndex _nItemIndex );
- const ORoadmapHyperLabel* GetByIndex( ItemIndex _nItemIndex ) const;
+ RoadmapItem* GetByIndex( ItemIndex _nItemIndex );
+ const RoadmapItem* GetByIndex( ItemIndex _nItemIndex ) const;
- ORoadmapHyperLabel* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
- const ORoadmapHyperLabel* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
- ORoadmapHyperLabel* GetPreviousHyperLabel( ItemIndex _Index);
+ RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 );
+ const RoadmapItem* GetByID( ItemId _nID, ItemIndex _nStartIndex = 0 ) const;
+ RoadmapItem* GetPreviousHyperLabel( ItemIndex _Index);
void DrawHeadline();
void DeselectOldRoadmapItems();
ItemId GetNextAvailableItemId( ItemIndex _NewIndex );
ItemId GetPreviousAvailableItemId( ItemIndex _NewIndex );
- ORoadmapHyperLabel* GetByPointer(Window* pWindow);
- void InitializeHyperLabelSize();
- ORoadmapHyperLabel* InsertHyperLabel( ItemIndex _Index, ::rtl::OUString _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True );
- void UpdatefollowingHyperLabels( ItemIndex _Index, sal_Int16 _nadd = 1);
- void SetRoadmapLabel(ORoadmapHyperLabel* CurHyperLabel, sal_Int32 _nPrefix, String _sDescription);
+ RoadmapItem* GetByPointer(Window* pWindow);
+ RoadmapItem* InsertHyperLabel( ItemIndex _Index, const ::rtl::OUString& _aStr, ItemId _RMID, sal_Bool _bEnabled = sal_True );
+ void UpdatefollowingHyperLabels( ItemIndex _Index );
};
//.........................................................................
diff --git a/svtools/inc/svtools/hyperlabel.hxx b/svtools/inc/svtools/hyperlabel.hxx
index c11568816158..939b1799c0de 100644
--- a/svtools/inc/svtools/hyperlabel.hxx
+++ b/svtools/inc/svtools/hyperlabel.hxx
@@ -75,26 +75,25 @@ namespace svt
void SetIndex( sal_Int32 _Index );
sal_Int32 GetIndex() const;
- void SetLabelAndSize( ::rtl::OUString _rText, const Size& rNewSize);
- void SetLabel( ::rtl::OUString _rText );
+ void SetLabel( const ::rtl::OUString& _rText );
sal_Int32 GetLogicWidth();
::rtl::OUString GetLabel( );
- void SetHyperLabelPosition(sal_uInt16 XPos, sal_uInt16 YPos);
- Point GetLogicalPosition();
-
void ToggleBackgroundColor( const Color& _rGBColor );
void SetInteractive( sal_Bool _bInteractive );
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
const Link& GetClickHdl() const { return maClickHdl; }
+ Size CalcMinimumSize( long nMaxWidth = 0 ) const;
+
private:
DECL_LINK(ImplClickHdl, HyperLabel*);
- sal_Bool ImplCalcMinimumSize(const Size& _rCompSize );
+ private:
+ using FixedText::CalcMinimumSize;
};
}
diff --git a/svtools/inc/svtools/solar.hrc b/svtools/inc/svtools/solar.hrc
index 348422ef6477..00211573f876 100644
--- a/svtools/inc/svtools/solar.hrc
+++ b/svtools/inc/svtools/solar.hrc
@@ -132,6 +132,8 @@
#define RID_FILTER_START (RID_LIB_START+10200)
#define RID_FILTER_END (RID_LIB_START+10299)
+// do *NOT* add more ranges here, RID_LIB_END is (RID_LIB_START + 10000)
+
#define RID_APP_START 20000
#define RID_APP_END 31999
@@ -144,12 +146,6 @@
#define RID_SD_START (27000)
#define RID_SD_END (27999)
-#define RID_Sa_START (28000)
-#define RID_Sa_END (28999)
-
-#define RID_Sb_START (29000)
-#define RID_Sb_END (29999)
-
#define RID_OBJ_START (30000)
#define RID_OBJ_END (32767)
@@ -191,8 +187,7 @@
#define HID_WIZARD_END (HID_LIB_START+999)
//please note: There is also HID_WIZARD2 below
-#define HID_EXTENSIONS_START (HID_LIB_START+1000)
-#define HID_EXTENSIONS_END (HID_LIB_START+1099)
+// FREE
#define HID_SO2_START (HID_LIB_START+1100)
#define HID_SO2_END (HID_LIB_START+1149)
@@ -308,5 +303,9 @@
#define HID_FORMULA_START (HID_OBJ_START+2081)
#define HID_FORMULA_END (HID_OBJ_START+2280)
+#define HID_EXTENSIONS_START (HID_OBJ_START+2281)
+#define HID_EXTENSIONS_END (HID_OBJ_START+2800)
+
+
#endif
diff --git a/svtools/source/control/hyperlabel.cxx b/svtools/source/control/hyperlabel.cxx
index ec8387ecb662..7d7477130e0d 100644
--- a/svtools/source/control/hyperlabel.cxx
+++ b/svtools/source/control/hyperlabel.cxx
@@ -107,35 +107,16 @@ namespace svt
}
- void HyperLabel::SetLabelAndSize(::rtl::OUString _rText, const Size& _rNewSize )
+ Size HyperLabel::CalcMinimumSize( long nMaxWidth ) const
{
- Size rLocSize = _rNewSize;
- Size rLogicLocSize = PixelToLogic( _rNewSize, MAP_APPFONT );
- SetLabel( _rText );
- ImplCalcMinimumSize( rLocSize );
- rLocSize.Height() = ( m_pImpl->m_aMinSize.Height());
-// else
-// rLocSize = LogicToPixel( Size( rLogicLocSize.Width(), LABELBASEMAPHEIGHT ), MAP_APPFONT );
- SetSizePixel( rLocSize );
- Show();
- }
-
- sal_Bool HyperLabel::ImplCalcMinimumSize(const Size& _rCompSize )
- {
- sal_Bool b_AdjustMinWidth = sal_False;
- m_pImpl->m_aMinSize = CalcMinimumSize( );
- if ( m_pImpl->m_aMinSize.Width() >= _rCompSize.Width() ) // the MinimumSize is used to size the FocusRectangle
- {
- m_pImpl->m_aMinSize.Width() = _rCompSize.Width(); // and for the MouseMove method
- m_pImpl->m_aMinSize = CalcMinimumSize(_rCompSize.Width() );
- b_AdjustMinWidth = sal_True;
- }
+ m_pImpl->m_aMinSize = FixedText::CalcMinimumSize( nMaxWidth );
+ // the MinimumSize is used to size the FocusRectangle
+ // and for the MouseMove method
m_pImpl->m_aMinSize.Height() += 2;
m_pImpl->m_aMinSize.Width() += 1;
- return b_AdjustMinWidth;
+ return m_pImpl->m_aMinSize;
}
-
void HyperLabel::implInit()
{
ToggleBackgroundColor( COL_TRANSPARENT );
@@ -234,17 +215,6 @@ namespace svt
m_pImpl->bInteractive = ( _bInteractive && IsEnabled() );
}
- void HyperLabel::SetHyperLabelPosition(sal_uInt16 XPos, sal_uInt16 YPos)
- {
- SetPosPixel( LogicToPixel( Point( XPos, YPos ), MAP_APPFONT ) );
- }
-
- Point HyperLabel::GetLogicalPosition()
- {
- Point aPoint = GetPosPixel( );
- return PixelToLogic( aPoint, MAP_APPFONT );
- }
-
sal_Int16 HyperLabel::GetID() const
{
return m_pImpl->ID;
@@ -270,10 +240,9 @@ namespace svt
return GetText();
}
- void HyperLabel::SetLabel( ::rtl::OUString _rText )
+ void HyperLabel::SetLabel( const ::rtl::OUString& _rText )
{
SetText(_rText);
- Show();
}
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index b0e178e631d9..693bca733813 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -49,11 +49,10 @@
#endif
#include <memory>
-#define RMENTRYPOINT_X 4
-#define RMENTRYPOINT_Y 27
-#define RMITEMDISTANCE_Y 6
+#define ROADMAP_INDENT_X 4
+#define ROADMAP_INDENT_Y 27
+#define ROADMAP_ITEM_DISTANCE_Y 6
#define RMINCOMPLETE -1
-#define NREMOVERMITEM -1
#define NADDITEM 1
#define INCOMPLETELABEL ::String::CreateFromAscii("...") // TODO: Cast to String
@@ -63,30 +62,18 @@ namespace svt
//.........................................................................
typedef std::vector< ::rtl::OUString > S_Vector;
- typedef std::vector< ORoadmapHyperLabel* > HL_Vector;
+ typedef std::vector< RoadmapItem* > HL_Vector;
//=====================================================================
- //= FontChanger
+ //= ColorChanger
//=====================================================================
-// class FontChanger
-// {
-// protected:
-// OutputDevice* m_pDev;
-//
-// public:
-// FontChanger( OutputDevice* _pDev, const Font& _rNewFont )
-// :m_pDev( _pDev )
-// {
-// m_pDev->Push( PUSH_FONT );
-// m_pDev->SetFont( _rNewFont );
-// }
-//
-// ~FontChanger()
-// {
-// m_pDev->Pop( );
-// }
-// };
-
+ class IDLabel : public FixedText
+ {
+ public:
+ IDLabel( Window* _pParent, WinBits _nWinStyle = 0 );
+ ~IDLabel( );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ };
//=====================================================================
//= ColorChanger
@@ -111,6 +98,51 @@ namespace svt
}
};
+ //=====================================================================
+ //= RoadmapItem
+ //=====================================================================
+ class RoadmapItem : public RoadmapTypes
+ {
+ private:
+ IDLabel* mpID;
+ HyperLabel* mpDescription;
+ const Size m_aItemPlayground;
+
+ public:
+ RoadmapItem( ORoadmap& _rParent, const Size& _rItemPlayground );
+ ~RoadmapItem( );
+
+ void SetID( sal_Int16 _ID );
+ sal_Int16 GetID() const;
+
+ void SetIndex( ItemIndex _Index );
+ ItemIndex GetIndex() const;
+
+ void SetLabel( const ::rtl::OUString& _rText );
+ ::rtl::OUString GetLabel( );
+
+ void Update( ItemIndex _RMIndex, const ::rtl::OUString& _rText );
+
+ void SetPosition( RoadmapItem* OldHyperLabel );
+
+ void ToggleBackgroundColor( const Color& _rGBColor );
+ void SetInteractive( sal_Bool _bInteractive );
+
+ void SetClickHdl( const Link& rLink );
+ const Link& GetClickHdl() const;
+ void SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags );
+ void Enable( BOOL bEnable = TRUE);
+ BOOL IsEnabled() const;
+ void GrabFocus();
+
+ bool Contains( const Window* _pWindow ) const;
+
+ HyperLabel* GetDescriptionHyperLabel() const { return mpDescription; }
+
+ private:
+ void ImplUpdateIndex( const ItemIndex _nIndex );
+ void ImplUpdatePosSize();
+ };
//=====================================================================
//= RoadmapImpl
@@ -118,27 +150,32 @@ namespace svt
class RoadmapImpl : public RoadmapTypes
{
protected:
+ const ORoadmap& m_rAntiImpl;
Link m_aSelectHdl;
BitmapEx m_aPicture;
HL_Vector m_aRoadmapSteps;
ItemId m_iCurItemID;
sal_Bool m_bInteractive;
sal_Bool m_bComplete;
+ Size m_aItemSizePixel;
public:
- RoadmapImpl() :
- m_bInteractive( sal_True ),
- m_bComplete( sal_True ) {}
+ RoadmapImpl( const ORoadmap& _rAntiImpl )
+ :m_rAntiImpl( _rAntiImpl )
+ ,m_iCurItemID( -1 )
+ ,m_bInteractive( sal_True )
+ ,m_bComplete( sal_True )
+ {
+ }
- Size aHyperLabelPixelSize;
- ORoadmapHyperLabel* InCompleteHyperLabel;
+ RoadmapItem* InCompleteHyperLabel;
- void addHyperLabel( ORoadmapHyperLabel* _rRoadmapStep ) { m_aRoadmapSteps.push_back(_rRoadmapStep); }
+ void addHyperLabel( RoadmapItem* _rRoadmapStep ) { m_aRoadmapSteps.push_back(_rRoadmapStep); }
HL_Vector& getHyperLabels() { return m_aRoadmapSteps; }
const HL_Vector& getHyperLabels() const { return m_aRoadmapSteps; }
- void insertHyperLabel( ItemIndex _Index, ORoadmapHyperLabel* _rRoadmapStep ) { m_aRoadmapSteps.insert( m_aRoadmapSteps.begin() + _Index, _rRoadmapStep ); }
+ void insertHyperLabel( ItemIndex _Index, RoadmapItem* _rRoadmapStep ) { m_aRoadmapSteps.insert( m_aRoadmapSteps.begin() + _Index, _rRoadmapStep ); }
ItemIndex getItemCount() const { return m_aRoadmapSteps.size();}
@@ -157,6 +194,9 @@ namespace svt
void setSelectHdl( const Link& _rHdl ) { m_aSelectHdl = _rHdl; }
const Link& getSelectHdl( ) const { return m_aSelectHdl; }
+ void initItemSize();
+ const Size& getItemSize() const { return m_aItemSizePixel; }
+
void removeHyperLabel( ItemIndex _Index )
{
if ( ( _Index > -1 ) && ( _Index < getItemCount() ) )
@@ -172,8 +212,21 @@ namespace svt
//= Roadmap
//=====================================================================
//---------------------------------------------------------------------
- ORoadmap::ORoadmap( Window* _pParent, const ResId& _rId ):Control( _pParent, _rId )
- ,m_pImpl( new RoadmapImpl() )
+ void RoadmapImpl::initItemSize()
+ {
+ Size aLabelSize( m_rAntiImpl.GetOutputSizePixel() );
+ aLabelSize.Height() = m_rAntiImpl.LogicToPixel( Size( 0, LABELBASEMAPHEIGHT ), MAP_APPFONT ).Height();
+ aLabelSize.Width() -= m_rAntiImpl.LogicToPixel( Size( 2 * ROADMAP_INDENT_X, 0 ), MAP_APPFONT ).Width();
+ m_aItemSizePixel = aLabelSize;
+ }
+
+ //=====================================================================
+ //= Roadmap
+ //=====================================================================
+ //---------------------------------------------------------------------
+ ORoadmap::ORoadmap( Window* _pParent, const ResId& _rId )
+ :Control( _pParent, _rId )
+ ,m_pImpl( new RoadmapImpl( *this ) )
{
implInit();
}
@@ -181,7 +234,7 @@ namespace svt
//---------------------------------------------------------------------
ORoadmap::ORoadmap( Window* _pParent, WinBits _nWinStyle )
:Control( _pParent, _nWinStyle )
- , m_pImpl( new RoadmapImpl() )
+ ,m_pImpl( new RoadmapImpl( *this ) )
{
implInit();
@@ -216,14 +269,15 @@ namespace svt
// on this with calculating a new bold font.
// Unfortunately, the OutputDevice does not offer a notify mechanism for a changed font.
// So settings the font from outside is simply a forbidded scenario at the moment
+ EnableMapMode( sal_False );
}
//---------------------------------------------------------------------
ORoadmap::~ORoadmap( )
{
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
+ HL_Vector aItemsCopy = m_pImpl->getHyperLabels();
m_pImpl->getHyperLabels().clear();
- for ( HL_Vector::iterator i = pLocRoadmapItems.begin(); i< pLocRoadmapItems.end(); i++)
+ for ( HL_Vector::iterator i = aItemsCopy.begin(); i< aItemsCopy.end(); ++i )
{
delete *i;
}
@@ -240,54 +294,43 @@ namespace svt
}
- void ORoadmap::InitializeHyperLabelSize()
+ RoadmapItem* ORoadmap::GetPreviousHyperLabel( ItemIndex _Index)
{
- Size aSize = GetSizePixel();
- Size aLogicSize = PixelToLogic( aSize, MAP_APPFONT );
- aLogicSize.Height() = LABELBASEMAPHEIGHT;
- aLogicSize.Width() -= (2*RMENTRYPOINT_X);
- m_pImpl->aHyperLabelPixelSize = LogicToPixel( aLogicSize, MAP_APPFONT );
- EnableMapMode( sal_False );
- }
-
-
- ORoadmapHyperLabel* ORoadmap::GetPreviousHyperLabel( ItemIndex _Index)
- {
- ORoadmapHyperLabel* OldHyperLabel = NULL;
- if (_Index > 0)
- OldHyperLabel = m_pImpl->getHyperLabels().at( _Index - 1 );
- return OldHyperLabel;
+ RoadmapItem* pOldItem = NULL;
+ if ( _Index > 0 )
+ pOldItem = m_pImpl->getHyperLabels().at( _Index - 1 );
+ return pOldItem;
}
//---------------------------------------------------------------------
- ORoadmapHyperLabel* ORoadmap::InsertHyperLabel( ItemIndex _Index, ::rtl::OUString _sLabel, ItemId _RMID, sal_Bool _bEnabled)
+ RoadmapItem* ORoadmap::InsertHyperLabel( ItemIndex _Index, const ::rtl::OUString& _sLabel, ItemId _RMID, sal_Bool _bEnabled)
{
- if (m_pImpl->getItemCount() == 0 )
- InitializeHyperLabelSize();
- ORoadmapHyperLabel* CurHyperLabel;
- ORoadmapHyperLabel* OldHyperLabel = GetPreviousHyperLabel( _Index);
+ if ( m_pImpl->getItemCount() == 0 )
+ m_pImpl->initItemSize();
+
+ RoadmapItem* pItem = NULL;
+ RoadmapItem* pOldItem = GetPreviousHyperLabel( _Index );
- if (_RMID != RMINCOMPLETE )
+ pItem = new RoadmapItem( *this, m_pImpl->getItemSize() );
+ if ( _RMID != RMINCOMPLETE )
{
- CurHyperLabel = new ORoadmapHyperLabel(this, WB_WORDBREAK);
- CurHyperLabel->SetInteractive( m_pImpl->isInteractive() );
- m_pImpl->insertHyperLabel(_Index, CurHyperLabel );
+ pItem->SetInteractive( m_pImpl->isInteractive() );
+ m_pImpl->insertHyperLabel( _Index, pItem );
}
else
{
- CurHyperLabel = new ORoadmapHyperLabel(this);
- CurHyperLabel->SetInteractive( sal_False );
+ pItem->SetInteractive( sal_False );
}
- CurHyperLabel->SetPosition( OldHyperLabel );
- CurHyperLabel->SetLabelAndSize( _Index, _sLabel, m_pImpl->aHyperLabelPixelSize );
- CurHyperLabel->SetClickHdl(LINK( this, ORoadmap, ImplClickHdl ) );
- CurHyperLabel->SetID( _RMID );
- CurHyperLabel->SetIndex( _Index );
+ pItem->SetPosition( pOldItem );
+ pItem->Update( _Index, _sLabel );
+ pItem->SetClickHdl(LINK( this, ORoadmap, ImplClickHdl ) );
+ pItem->SetID( _RMID );
+ pItem->SetIndex( _Index );
if (!_bEnabled)
- CurHyperLabel->Enable( _bEnabled );
- return CurHyperLabel;
+ pItem->Enable( _bEnabled );
+ return pItem;
}
//---------------------------------------------------------------------
@@ -308,12 +351,14 @@ namespace svt
void ORoadmap::SetRoadmapInteractive( sal_Bool _bInteractive )
{
m_pImpl->setInteractive( _bInteractive );
- ORoadmapHyperLabel* CurHyperLabel;
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
- for ( HL_Vector::iterator i = pLocRoadmapItems.begin(); i< pLocRoadmapItems.end(); i++)
+
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin();
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- CurHyperLabel->SetInteractive( _bInteractive );
+ (*i)->SetInteractive( _bInteractive );
}
}
@@ -326,76 +371,55 @@ namespace svt
//---------------------------------------------------------------------
void ORoadmap::SetRoadmapComplete( sal_Bool _bComplete )
{
- sal_Bool OldbComplete = m_pImpl->isComplete();
- m_pImpl->setComplete( _bComplete);
- if (_bComplete)
+ sal_Bool bWasComplete = m_pImpl->isComplete();
+ m_pImpl->setComplete( _bComplete );
+ if ( _bComplete )
{
if ( m_pImpl->InCompleteHyperLabel != NULL)
{
- if (m_pImpl->getItemCount() > 0)
- {
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
- pLocRoadmapItems.pop_back();
- delete m_pImpl->InCompleteHyperLabel;
- }
+ delete m_pImpl->InCompleteHyperLabel;
m_pImpl->InCompleteHyperLabel = NULL;
}
}
- else if (OldbComplete)
- m_pImpl->InCompleteHyperLabel = InsertHyperLabel( m_pImpl->getItemCount(), ::String::CreateFromAscii("..."), RMINCOMPLETE );
+ else if ( bWasComplete )
+ m_pImpl->InCompleteHyperLabel = InsertHyperLabel( m_pImpl->getItemCount(), ::String::CreateFromAscii( "..." ), RMINCOMPLETE );
}
//---------------------------------------------------------------------
- void ORoadmap::SetRoadmapLabel(ORoadmapHyperLabel* CurHyperLabel, sal_Int32 _nPrefix, String _sDescription)
+ void ORoadmap::UpdatefollowingHyperLabels( ItemIndex _nIndex )
{
- const xub_StrLen n_Pos = _sDescription.Search( String::CreateFromAscii(".") );
- if ( n_Pos != STRING_NOTFOUND )
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ if ( _nIndex < (ItemIndex)rItems.size() )
{
- const String sID = ::String::CreateFromInt32( _nPrefix );
- _sDescription.Replace(0 , n_Pos, sID );
- }
- CurHyperLabel->SetLabelAndSize( _nPrefix, _sDescription, m_pImpl->aHyperLabelPixelSize );
- }
-
- //---------------------------------------------------------------------
- void ORoadmap::UpdatefollowingHyperLabels( ItemIndex _Index, sal_Int16 )
- {
- if ( _Index < ( m_pImpl->getItemCount() ) )
- {
- Point aPos;
- String sLabel;
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
- ORoadmapHyperLabel* CurHyperLabel = NULL;
- ItemIndex n_CurPrefix = _Index + 1 ;
- for ( HL_Vector::iterator i = pLocRoadmapItems.begin()+ _Index; i< pLocRoadmapItems.end(); i++)
+ RoadmapItem* pItem = NULL;
+ for ( HL_Vector::const_iterator i = rItems.begin() + _nIndex;
+ i< rItems.end();
+ ++i, ++_nIndex
+ )
{
- CurHyperLabel = *i;
- aPos = CurHyperLabel->GetLogicalPosition();
- CurHyperLabel->SetIndex( n_CurPrefix - 1);
- sLabel = CurHyperLabel->GetLabel();
- SetRoadmapLabel(CurHyperLabel, n_CurPrefix, sLabel);
- ORoadmapHyperLabel* OldHyperLabel = GetPreviousHyperLabel( n_CurPrefix-1);
- CurHyperLabel->SetPosition( OldHyperLabel);
- n_CurPrefix++;
+ pItem = *i;
+
+ pItem->SetIndex( _nIndex );
+ pItem->SetPosition( GetPreviousHyperLabel( _nIndex ) );
}
}
if ( ! m_pImpl->isComplete() )
{
- ORoadmapHyperLabel* OldHyperLabel = GetPreviousHyperLabel( m_pImpl->getItemCount());
- m_pImpl->InCompleteHyperLabel->SetPosition( OldHyperLabel );
- m_pImpl->InCompleteHyperLabel->SetLabelAndSize( m_pImpl->getItemCount(), ::String::CreateFromAscii("..."), m_pImpl->aHyperLabelPixelSize );
+ RoadmapItem* pOldItem = GetPreviousHyperLabel( m_pImpl->getItemCount() );
+ m_pImpl->InCompleteHyperLabel->SetPosition( pOldItem );
+ m_pImpl->InCompleteHyperLabel->Update( m_pImpl->getItemCount(), ::String::CreateFromAscii("...") );
}
}
//---------------------------------------------------------------------
- void ORoadmap::ReplaceRoadmapItem( ItemIndex _Index, ::rtl::OUString _RoadmapItem, ItemId _RMID, sal_Bool _bEnabled )
+ void ORoadmap::ReplaceRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _RMID, sal_Bool _bEnabled )
{
- ORoadmapHyperLabel* CurHyperLabel = GetByIndex( _Index);
- if ( CurHyperLabel != NULL )
+ RoadmapItem* pItem = GetByIndex( _Index);
+ if ( pItem != NULL )
{
- CurHyperLabel->SetLabelAndSize( _Index, _RoadmapItem, m_pImpl->aHyperLabelPixelSize );
- CurHyperLabel->SetID( _RMID );
- CurHyperLabel->Enable( _bEnabled );
+ pItem->Update( _Index, _RoadmapItem );
+ pItem->SetID( _RMID );
+ pItem->Enable( _bEnabled );
}
}
@@ -408,7 +432,7 @@ namespace svt
//---------------------------------------------------------------------
RoadmapTypes::ItemId ORoadmap::GetItemID( ItemIndex _nIndex ) const
{
- const ORoadmapHyperLabel* pHyperLabel = GetByIndex( _nIndex );
+ const RoadmapItem* pHyperLabel = GetByIndex( _nIndex );
if ( pHyperLabel )
return pHyperLabel->GetID();
return -1;
@@ -417,28 +441,26 @@ namespace svt
//---------------------------------------------------------------------
RoadmapTypes::ItemIndex ORoadmap::GetItemIndex( ItemId _nID ) const
{
- ORoadmapHyperLabel* CurHyperLabel;
ItemId nLocID = 0;
- HL_Vector &LocHyperLabels = m_pImpl->getHyperLabels();
- ItemIndex nResult = 0;
- for ( HL_Vector::iterator i = LocHyperLabels.begin(); i< LocHyperLabels.end(); i++)
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin();
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- nLocID = CurHyperLabel->GetID();
+ nLocID = (*i)->GetID();
if ( nLocID == _nID )
- return nResult;
- nResult++;
+ return ItemIndex( i - rItems.begin() );
}
return -1;
}
//---------------------------------------------------------------------
- void ORoadmap::InsertRoadmapItem( ItemIndex _Index, ::rtl::OUString _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled )
+ void ORoadmap::InsertRoadmapItem( ItemIndex _Index, const ::rtl::OUString& _RoadmapItem, ItemId _nUniqueId, sal_Bool _bEnabled )
{
- ORoadmapHyperLabel* CurHyperLabel;
- CurHyperLabel = InsertHyperLabel(_Index, _RoadmapItem, _nUniqueId, _bEnabled);
+ InsertHyperLabel( _Index, _RoadmapItem, _nUniqueId, _bEnabled );
// Todo: YPos is superfluous, if items are always appended
- UpdatefollowingHyperLabels( _Index + 1);
+ UpdatefollowingHyperLabels( _Index + 1 );
}
//---------------------------------------------------------------------
@@ -447,7 +469,7 @@ namespace svt
if ( m_pImpl->getItemCount() > 0 && ( _Index > -1) && ( _Index < m_pImpl->getItemCount() ) )
{
m_pImpl->removeHyperLabel( _Index );
- UpdatefollowingHyperLabels( _Index, NREMOVERMITEM);
+ UpdatefollowingHyperLabels( _Index );
}
}
@@ -460,33 +482,33 @@ namespace svt
//---------------------------------------------------------------------
sal_Bool ORoadmap::IsRoadmapItemEnabled( ItemId _nItemId, ItemIndex _nStartIndex ) const
{
- const ORoadmapHyperLabel* _pLabelItem = GetByID( _nItemId, _nStartIndex );
+ const RoadmapItem* _pLabelItem = GetByID( _nItemId, _nStartIndex );
return _pLabelItem ? _pLabelItem->IsEnabled() : sal_False;
}
//---------------------------------------------------------------------
void ORoadmap::EnableRoadmapItem( ItemId _nItemId, sal_Bool _bEnable, ItemIndex _nStartIndex )
{
- ORoadmapHyperLabel* CurHyperLabel = GetByID( _nItemId, _nStartIndex );
- if ( CurHyperLabel != NULL )
- CurHyperLabel->Enable( _bEnable );
+ RoadmapItem* pItem = GetByID( _nItemId, _nStartIndex );
+ if ( pItem != NULL )
+ pItem->Enable( _bEnable );
}
//---------------------------------------------------------------------
- void ORoadmap::ChangeRoadmapItemLabel( ItemId _nID, ::rtl::OUString _sLabel, ItemIndex _nStartIndex )
+ void ORoadmap::ChangeRoadmapItemLabel( ItemId _nID, const ::rtl::OUString& _sLabel, ItemIndex _nStartIndex )
{
- ORoadmapHyperLabel* CurHyperLabel = GetByID( _nID, _nStartIndex );
- if ( CurHyperLabel != NULL )
+ RoadmapItem* pItem = GetByID( _nID, _nStartIndex );
+ if ( pItem != NULL )
{
- CurHyperLabel->SetLabelAndSize( CurHyperLabel->GetIndex(), _sLabel, m_pImpl->aHyperLabelPixelSize );
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
- ItemIndex Index = _nStartIndex;
- for ( HL_Vector::iterator i = pLocRoadmapItems.begin()+ Index; i< pLocRoadmapItems.end(); i++)
+ pItem->Update( pItem->GetIndex(), _sLabel );
+
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin() + _nStartIndex;
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- ORoadmapHyperLabel* OldHyperLabel = GetPreviousHyperLabel( Index );
- CurHyperLabel->SetPosition( OldHyperLabel);
- Index++;
+ (*i)->SetPosition( GetPreviousHyperLabel( i - rItems.begin() ) );
}
}
}
@@ -495,9 +517,9 @@ namespace svt
::rtl::OUString ORoadmap::GetRoadmapItemLabel( ItemId _nID, ItemIndex _nStartIndex )
{
- ORoadmapHyperLabel* CurHyperLabel = GetByID( _nID, _nStartIndex );
- if ( CurHyperLabel != NULL )
- return CurHyperLabel->GetLabel();
+ RoadmapItem* pItem = GetByID( _nID, _nStartIndex );
+ if ( pItem != NULL )
+ return pItem->GetLabel();
else
return ::rtl::OUString();
}
@@ -505,47 +527,47 @@ namespace svt
//---------------------------------------------------------------------
void ORoadmap::ChangeRoadmapItemID( ItemId _nID, ItemId _NewID, ItemIndex _nStartIndex )
{
- ORoadmapHyperLabel* CurHyperLabel = GetByID( _nID, _nStartIndex );
- if ( CurHyperLabel != NULL )
- CurHyperLabel->SetID( _NewID );
+ RoadmapItem* pItem = GetByID( _nID, _nStartIndex );
+ if ( pItem != NULL )
+ pItem->SetID( _NewID );
}
//---------------------------------------------------------------------
- ORoadmapHyperLabel* ORoadmap::GetByID( ItemId _nID, ItemIndex _nStartIndex)
+ RoadmapItem* ORoadmap::GetByID( ItemId _nID, ItemIndex _nStartIndex)
{
- ORoadmapHyperLabel* CurHyperLabel;
ItemId nLocID = 0;
- HL_Vector &LocHyperLabels = m_pImpl->getHyperLabels();
- for ( HL_Vector::iterator i = LocHyperLabels.begin()+ _nStartIndex; i< LocHyperLabels.end(); i++)
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin() + _nStartIndex;
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- nLocID = CurHyperLabel->GetID();
+ nLocID = (*i)->GetID();
if ( nLocID == _nID )
- return CurHyperLabel;
+ return *i;
}
return NULL;
}
//---------------------------------------------------------------------
- const ORoadmapHyperLabel* ORoadmap::GetByID( ItemId _nID, ItemIndex _nStartIndex ) const
+ const RoadmapItem* ORoadmap::GetByID( ItemId _nID, ItemIndex _nStartIndex ) const
{
return const_cast< ORoadmap* >( this )->GetByID( _nID, _nStartIndex );
}
//---------------------------------------------------------------------
- ORoadmapHyperLabel* ORoadmap::GetByIndex( ItemIndex _nItemIndex)
+ RoadmapItem* ORoadmap::GetByIndex( ItemIndex _nItemIndex)
{
- HL_Vector &LocHyperLabels = m_pImpl->getHyperLabels();
- if ((_nItemIndex > -1) && (_nItemIndex < m_pImpl->getItemCount( ) ) )
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ if ( ( _nItemIndex > -1 ) && ( _nItemIndex < (ItemIndex)rItems.size() ) )
{
- ORoadmapHyperLabel* CurHyperLabel = LocHyperLabels.at(_nItemIndex); // Vectors are one-based
- return CurHyperLabel;
+ return rItems.at( _nItemIndex );
}
return NULL;
}
//---------------------------------------------------------------------
- const ORoadmapHyperLabel* ORoadmap::GetByIndex( ItemIndex _nItemIndex ) const
+ const RoadmapItem* ORoadmap::GetByIndex( ItemIndex _nItemIndex ) const
{
return const_cast< ORoadmap* >( this )->GetByIndex( _nItemIndex );
}
@@ -553,14 +575,14 @@ namespace svt
//---------------------------------------------------------------------
RoadmapTypes::ItemId ORoadmap::GetNextAvailableItemId( ItemIndex _nNewIndex )
{
- ORoadmapHyperLabel* CurHyperLabel;
+ RoadmapItem* pItem = NULL;
ItemIndex searchIndex = ++_nNewIndex;
while ( searchIndex < m_pImpl->getItemCount() )
{
- CurHyperLabel = GetByIndex( searchIndex );
- if ( CurHyperLabel->IsEnabled() )
- return CurHyperLabel->GetID( );
+ pItem = GetByIndex( searchIndex );
+ if ( pItem->IsEnabled() )
+ return pItem->GetID( );
++searchIndex;
}
@@ -570,13 +592,13 @@ namespace svt
//---------------------------------------------------------------------
RoadmapTypes::ItemId ORoadmap::GetPreviousAvailableItemId( ItemIndex _nNewIndex )
{
- ORoadmapHyperLabel* CurHyperLabel;
+ RoadmapItem* pItem = NULL;
ItemIndex searchIndex = --_nNewIndex;
while ( searchIndex > -1 )
{
- CurHyperLabel = GetByIndex( searchIndex );
- if ( CurHyperLabel->IsEnabled() )
- return CurHyperLabel->GetID( );
+ pItem = GetByIndex( searchIndex );
+ if ( pItem->IsEnabled() )
+ return pItem->GetID( );
searchIndex--;
}
@@ -586,12 +608,13 @@ namespace svt
//---------------------------------------------------------------------
void ORoadmap::DeselectOldRoadmapItems()
{
- HL_Vector pLocRoadmapItems = m_pImpl->getHyperLabels();
- ORoadmapHyperLabel* CurHyperLabel = NULL;
- for ( HL_Vector::iterator i = pLocRoadmapItems.begin(); i< pLocRoadmapItems.end(); i++)
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin();
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- CurHyperLabel->ToggleBackgroundColor( COL_TRANSPARENT );
+ (*i)->ToggleBackgroundColor( COL_TRANSPARENT );
}
}
@@ -617,7 +640,7 @@ namespace svt
//---------------------------------------------------------------------
void ORoadmap::GetFocus()
{
- ORoadmapHyperLabel* pCurHyperLabel = GetByID( GetCurrentRoadmapItemID() );
+ RoadmapItem* pCurHyperLabel = GetByID( GetCurrentRoadmapItemID() );
if ( pCurHyperLabel != NULL )
pCurHyperLabel->GrabFocus();
}
@@ -626,15 +649,15 @@ namespace svt
sal_Bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID )
{
DeselectOldRoadmapItems();
- ORoadmapHyperLabel* CurHyperLabel = GetByID( _nNewID );
- if (CurHyperLabel != NULL)
+ RoadmapItem* pItem = GetByID( _nNewID );
+ if ( pItem != NULL )
{
- if (CurHyperLabel->IsEnabled())
+ if ( pItem->IsEnabled() )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- CurHyperLabel->ToggleBackgroundColor( rStyleSettings.GetHighlightColor() ); //HighlightColor
+ pItem->ToggleBackgroundColor( rStyleSettings.GetHighlightColor() ); //HighlightColor
- CurHyperLabel->GrabFocus();
+ pItem->GrabFocus();
m_pImpl->setCurItemID(_nNewID);
Select();
@@ -670,7 +693,7 @@ namespace svt
//---------------------------------------------------------------------
void ORoadmap::DrawHeadline()
{
- Point aTextPos = LogicToPixel( Point( RMENTRYPOINT_X, 8 ), MAP_APPFONT );
+ Point aTextPos = LogicToPixel( Point( ROADMAP_INDENT_X, 8 ), MAP_APPFONT );
Size aOutputSize( GetOutputSizePixel() );
@@ -683,15 +706,16 @@ namespace svt
}
//---------------------------------------------------------------------
- ORoadmapHyperLabel* ORoadmap::GetByPointer(Window* pWindow)
+ RoadmapItem* ORoadmap::GetByPointer(Window* pWindow)
{
- ORoadmapHyperLabel* CurHyperLabel;
- HL_Vector &LocHyperLabels = m_pImpl->getHyperLabels();
- for ( HL_Vector::iterator i = LocHyperLabels.begin(); i< LocHyperLabels.end(); i++)
+ const HL_Vector& rItems = m_pImpl->getHyperLabels();
+ for ( HL_Vector::const_iterator i = rItems.begin();
+ i < rItems.end();
+ ++i
+ )
{
- CurHyperLabel = *i;
- if ( (CurHyperLabel->GetIDLabel() == pWindow) || (CurHyperLabel->GetDescriptionHyperLabel() == pWindow) )
- return CurHyperLabel;
+ if ( (*i)->Contains( pWindow ) )
+ return *i;
}
return NULL;
}
@@ -703,30 +727,30 @@ namespace svt
if ( _rNEvt.GetType() == EVENT_KEYINPUT )
{
Window* pWindow = _rNEvt.GetWindow();
- ORoadmapHyperLabel* CurHyperLabel = GetByPointer( pWindow );
- if ( CurHyperLabel != NULL )
+ RoadmapItem* pItem = GetByPointer( pWindow );
+ if ( pItem != NULL )
{
sal_Int16 nKeyCode = _rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
switch( nKeyCode )
{
case KEY_UP:
- { // Note: Performancewhise this is not optimal, because we search for an ID in the labels
+ { // Note: Performancewise this is not optimal, because we search for an ID in the labels
// and afterwards we search again for a label with the appropriate ID ->
// unnecessarily we search twice!!!
- ItemId nPrevItemID = GetPreviousAvailableItemId( CurHyperLabel->GetIndex() );
+ ItemId nPrevItemID = GetPreviousAvailableItemId( pItem->GetIndex() );
if ( nPrevItemID != -1 )
return SelectRoadmapItemByID( nPrevItemID );
}
break;
case KEY_DOWN:
{
- ItemId nNextItemID = GetNextAvailableItemId( CurHyperLabel->GetIndex() );
+ ItemId nNextItemID = GetNextAvailableItemId( pItem->GetIndex() );
if ( nNextItemID != -1 )
return SelectRoadmapItemByID( nNextItemID );
}
break;
case KEY_SPACE:
- return SelectRoadmapItemByID( CurHyperLabel->GetID() );
+ return SelectRoadmapItemByID( pItem->GetID() );
}
}
}
@@ -736,9 +760,12 @@ namespace svt
//---------------------------------------------------------------------
IMPL_LINK(ORoadmap, ImplClickHdl, HyperLabel*, _CurHyperLabel)
{
- return SelectRoadmapItemByID( _CurHyperLabel->GetID() );
+ return SelectRoadmapItemByID( _CurHyperLabel->GetID() );
}
+
+
+ //---------------------------------------------------------------------
void ORoadmap::DataChanged( const DataChangedEvent& rDCEvt )
{
if ((( rDCEvt.GetType() == DATACHANGED_SETTINGS ) ||
@@ -752,216 +779,228 @@ namespace svt
aFont.SetColor( aTextColor );
SetFont( aFont );
RoadmapTypes::ItemId curItemID = GetCurrentRoadmapItemID();
- ORoadmapHyperLabel* pLabelItem = GetByID( curItemID );
+ RoadmapItem* pLabelItem = GetByID( curItemID );
pLabelItem->ToggleBackgroundColor(rStyleSettings.GetHighlightColor());
Invalidate();
}
}
- ORoadmapHyperLabel::ORoadmapHyperLabel( Window* _pParent, const ResId& )
+ //---------------------------------------------------------------------
+ RoadmapItem::RoadmapItem( ORoadmap& _rParent, const Size& _rItemPlayground )
+ :m_aItemPlayground( _rItemPlayground )
{
- mpIDLabel = new ORoadmapIDHyperLabel(_pParent, WB_WORDBREAK);
- mpDescHyperLabel = new HyperLabel(_pParent, WB_NOTABSTOP | WB_WORDBREAK);
+ mpID = new IDLabel( &_rParent, WB_WORDBREAK );
+ mpID->SetTextColor( mpID->GetSettings().GetStyleSettings().GetFieldTextColor( ) );
+ mpID->Show();
+ mpDescription = new HyperLabel( &_rParent, WB_NOTABSTOP | WB_WORDBREAK );
+ mpDescription->Show();
}
-
- ORoadmapHyperLabel::ORoadmapHyperLabel( Window* _pParent, WinBits )
+ //---------------------------------------------------------------------
+ bool RoadmapItem::Contains( const Window* _pWindow ) const
{
- mpIDLabel = new ORoadmapIDHyperLabel(_pParent, WB_WORDBREAK);
- mpIDLabel->SetTextColor( mpIDLabel->GetSettings().GetStyleSettings().GetFieldTextColor( ) );
- mpDescHyperLabel = new HyperLabel(_pParent, WB_NOTABSTOP | WB_WORDBREAK);
+ return ( mpID == _pWindow ) || ( mpDescription == _pWindow );
}
//---------------------------------------------------------------------
- void ORoadmapHyperLabel::GrabFocus()
+ void RoadmapItem::GrabFocus()
{
- if ( mpDescHyperLabel )
- mpDescHyperLabel->GrabFocus();
+ if ( mpDescription )
+ mpDescription->GrabFocus();
}
-
- void ORoadmapHyperLabel::SetInteractive( sal_Bool _bInteractive )
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetInteractive( sal_Bool _bInteractive )
{
- if ( mpDescHyperLabel )
- mpDescHyperLabel->SetInteractive(_bInteractive);
+ if ( mpDescription )
+ mpDescription->SetInteractive(_bInteractive);
}
- void ORoadmapHyperLabel::SetID( sal_Int16 _ID )
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetID( sal_Int16 _ID )
{
- if ( mpDescHyperLabel )
- mpDescHyperLabel->SetID(_ID);
+ if ( mpDescription )
+ mpDescription->SetID(_ID);
}
- sal_Int16 ORoadmapHyperLabel::GetID() const
+ //---------------------------------------------------------------------
+ sal_Int16 RoadmapItem::GetID() const
{
- return mpDescHyperLabel ? mpDescHyperLabel->GetID() : sal_Int16(-1);
+ return mpDescription ? mpDescription->GetID() : sal_Int16(-1);
}
- void ORoadmapHyperLabel::SetIndex( sal_Int32 _Index )
+ //---------------------------------------------------------------------
+ void RoadmapItem::ImplUpdateIndex( const ItemIndex _nIndex )
{
- if ( mpDescHyperLabel )
- mpDescHyperLabel->SetIndex(_Index);
- }
+ if ( mpDescription )
+ mpDescription->SetIndex( _nIndex );
+ if ( mpID )
+ {
+ ::rtl::OUString aIDText = ::rtl::OUString::valueOf( (sal_Int32)( _nIndex + 1 ) ) + ::rtl::OUString::createFromAscii( "." );
+ mpID->SetText( aIDText );
+ }
- sal_Int32 ORoadmapHyperLabel::GetIndex() const
- {
- return mpDescHyperLabel ? mpDescHyperLabel->GetIndex() : sal_Int32(-1);
+ // update the geometry of both controls
+ ImplUpdatePosSize();
}
-
- void ORoadmapHyperLabel::SetLabel( ::rtl::OUString _rText )
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetIndex( ItemIndex _Index )
{
- if ( mpDescHyperLabel )
- mpDescHyperLabel->SetText(_rText);
+ ImplUpdateIndex( _Index );
}
+ //---------------------------------------------------------------------
+ RoadmapTypes::ItemIndex RoadmapItem::GetIndex() const
+ {
+ return mpDescription ? mpDescription->GetIndex() : ItemIndex(-1);
+ }
- ::rtl::OUString ORoadmapHyperLabel::GetLabel( )
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetLabel( const ::rtl::OUString& _rText )
{
- return mpDescHyperLabel ? mpDescHyperLabel->GetText() : String();
+ if ( mpDescription )
+ mpDescription->SetText(_rText);
}
+ //---------------------------------------------------------------------
+ ::rtl::OUString RoadmapItem::GetLabel( )
+ {
+ return mpDescription ? mpDescription->GetText() : String();
+ }
- void ORoadmapHyperLabel::SetPosition(ORoadmapHyperLabel* OldHyperLabel)
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetPosition( RoadmapItem* _pOldItem )
{
- Point aNewLogicalPoint;
- Point aNewPoint;
- if (OldHyperLabel == NULL)
+ Point aIDPos;
+ if ( _pOldItem == NULL )
{
- aNewLogicalPoint = Point( RMENTRYPOINT_X, RMENTRYPOINT_Y);
- aNewPoint = mpIDLabel->LogicToPixel(aNewLogicalPoint, MAP_APPFONT );
+ aIDPos = mpID->LogicToPixel( Point( ROADMAP_INDENT_X, ROADMAP_INDENT_Y ), MAP_APPFONT );
}
else
{
- Size aOldSize = OldHyperLabel->GetDescriptionHyperLabel()->GetSizePixel();
- Point aOldLogicalPoint = OldHyperLabel->GetLogicalPosition();
- aNewLogicalPoint = Point(aOldLogicalPoint.X(), (aOldLogicalPoint.Y() + RMITEMDISTANCE_Y));
- aNewPoint = mpIDLabel->LogicToPixel(aNewLogicalPoint, MAP_APPFONT );
- aNewPoint = Point(aNewPoint.X(),aNewPoint.Y() + aOldSize.Height());
+ Size aOldSize = _pOldItem->GetDescriptionHyperLabel()->GetSizePixel();
+
+ aIDPos = _pOldItem->mpID->GetPosPixel();
+ aIDPos.Y() += aOldSize.Height();
+ aIDPos.Y() += mpID->GetParent()->LogicToPixel( Size( 0, ROADMAP_ITEM_DISTANCE_Y ) ).Height();
}
- mpIDLabel->SetPosPixel( aNewPoint );
- sal_Int32 xDescPos = aNewPoint.X() + mpIDLabel->GetSizePixel().Width();
- mpDescHyperLabel->SetPosPixel( Point(xDescPos, aNewPoint.Y()) );
- }
+ mpID->SetPosPixel( aIDPos );
+ sal_Int32 nDescPos = aIDPos.X() + mpID->GetSizePixel().Width();
+ mpDescription->SetPosPixel( Point( nDescPos, aIDPos.Y() ) );
+ }
- void ORoadmapHyperLabel::SetZOrder( ORoadmapHyperLabel* pRefRoadmapHyperLabel, USHORT nFlags )
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetZOrder( RoadmapItem* pRefRoadmapHyperLabel, USHORT nFlags )
{
if (pRefRoadmapHyperLabel == NULL)
- mpDescHyperLabel->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST );
+ mpDescription->SetZOrder( NULL, nFlags); //WINDOW_ZORDER_FIRST );
else
- mpDescHyperLabel->SetZOrder( pRefRoadmapHyperLabel->mpDescHyperLabel, nFlags); //, WINDOW_ZORDER_BEHIND );
+ mpDescription->SetZOrder( pRefRoadmapHyperLabel->mpDescription, nFlags); //, WINDOW_ZORDER_BEHIND );
}
-
- void ORoadmapHyperLabel::Enable( BOOL _bEnable)
+ //---------------------------------------------------------------------
+ void RoadmapItem::Enable( BOOL _bEnable)
{
- mpIDLabel->Enable(_bEnable);
- mpDescHyperLabel->Enable(_bEnable);
+ mpID->Enable(_bEnable);
+ mpDescription->Enable(_bEnable);
}
- BOOL ORoadmapHyperLabel::IsEnabled() const
+ //---------------------------------------------------------------------
+ BOOL RoadmapItem::IsEnabled() const
{
- return mpIDLabel->IsEnabled();
+ return mpID->IsEnabled();
}
-// void ORoadmapHyperLabel::GrabFocus()
-// {
-// mpDescHyperLabel->GrabFocus();
-//
-// }
-
- void ORoadmapHyperLabel::ToggleBackgroundColor( const Color& _rGBColor )
+ //---------------------------------------------------------------------
+ void RoadmapItem::ToggleBackgroundColor( const Color& _rGBColor )
{
if (_rGBColor == COL_TRANSPARENT)
{
- mpIDLabel->SetTextColor( mpIDLabel->GetSettings().GetStyleSettings().GetFieldTextColor( ) );
- mpIDLabel->SetControlBackground( COL_TRANSPARENT );
+ mpID->SetTextColor( mpID->GetSettings().GetStyleSettings().GetFieldTextColor( ) );
+ mpID->SetControlBackground( COL_TRANSPARENT );
}
else
{
- mpIDLabel->SetControlBackground( mpIDLabel->GetSettings().GetStyleSettings().GetHighlightColor() );
- mpIDLabel->SetTextColor( mpIDLabel->GetSettings().GetStyleSettings().GetHighlightTextColor( ) );
+ mpID->SetControlBackground( mpID->GetSettings().GetStyleSettings().GetHighlightColor() );
+ mpID->SetTextColor( mpID->GetSettings().GetStyleSettings().GetHighlightTextColor( ) );
}
- mpDescHyperLabel->ToggleBackgroundColor(_rGBColor);
+ mpDescription->ToggleBackgroundColor(_rGBColor);
}
-
- Point ORoadmapHyperLabel::GetLogicalPosition()
+ //---------------------------------------------------------------------
+ void RoadmapItem::ImplUpdatePosSize()
{
- Point aPoint = mpIDLabel->GetPosPixel( );
- Size aSize = Size(aPoint.X(), aPoint.Y());
- aSize = mpIDLabel->PixelToLogic( aSize, MAP_APPFONT );
- aPoint = Point(aSize.Width(), aSize.Height());
- return aPoint;
- }
+ // calculate widths
+ long nIDWidth = mpID->GetTextWidth( mpID->GetText() );
+ long nMaxIDWidth = mpID->GetTextWidth( ::rtl::OUString::createFromAscii( "100." ) );
+ nIDWidth = ::std::min( nIDWidth, nMaxIDWidth );
+
+ // check how many space the description would need
+ Size aDescriptionSize = mpDescription->CalcMinimumSize( m_aItemPlayground.Width() - nIDWidth );
+
+ // position and size both controls
+ Size aIDSize( nIDWidth, aDescriptionSize.Height() );
+ mpID->SetSizePixel( aIDSize );
+ Point aIDPos = mpID->GetPosPixel();
+ mpDescription->SetPosPixel( Point( aIDPos.X() + nIDWidth, aIDPos.Y() ) );
+ mpDescription->SetSizePixel( aDescriptionSize );
+ }
- void ORoadmapHyperLabel::SetLabelAndSize( ItemIndex _RMIndex, ::rtl::OUString _rText, const Size& _rNewSize)
+ //---------------------------------------------------------------------
+ void RoadmapItem::Update( ItemIndex _RMIndex, const ::rtl::OUString& _rText )
{
- Size rIDSize = _rNewSize;
- ::rtl::OUString aStr = ::rtl::OUString::valueOf( (sal_Int32)( _RMIndex + 1 ) ) + ::rtl::OUString::createFromAscii( "." );
- rIDSize.Width() = (sal_Int32) mpIDLabel->GetTextWidth( aStr );
- long nMaxWidth = mpIDLabel->GetTextWidth( ::rtl::OUString::createFromAscii("100.") );
- rIDSize.Width() = ::std::min( rIDSize.getWidth(),nMaxWidth );
- mpIDLabel->SetSizePixel(mpIDLabel->LogicToPixel( rIDSize));
- mpIDLabel->SetText( aStr);
- mpIDLabel->Show();
- Size rDescSize = _rNewSize;
- rDescSize.Width() -= rIDSize.Width();
- sal_Int32 xDescPos = mpIDLabel->GetPosPixel().X() + mpIDLabel->GetSizePixel().Width();
- sal_Int32 yDescPos = mpIDLabel->GetPosPixel().Y();
- Point aPoint = Point(xDescPos, yDescPos);
- mpDescHyperLabel->SetPosPixel( aPoint );
- mpDescHyperLabel->SetLabelAndSize(_rText, rDescSize);
- mpIDLabel->SetSizePixel( Size( mpIDLabel->GetSizePixel().Width(), mpDescHyperLabel->GetSizePixel().Height() ) );
+ // update description label
+ mpDescription->SetLabel( _rText );
+
+ // update the index in both controls, which triggers updating the geometry of both
+ ImplUpdateIndex( _RMIndex );
}
- ORoadmapHyperLabel::~ORoadmapHyperLabel( )
+ //---------------------------------------------------------------------
+ RoadmapItem::~RoadmapItem( )
{
{
- ::std::auto_ptr<Control> aTemp(mpIDLabel);
- mpIDLabel = NULL;
+ ::std::auto_ptr<Control> aTemp(mpID);
+ mpID = NULL;
}
{
- ::std::auto_ptr<Control> aTemp(mpDescHyperLabel);
- mpDescHyperLabel = NULL;
+ ::std::auto_ptr<Control> aTemp(mpDescription);
+ mpDescription = NULL;
}
}
-
- void ORoadmapHyperLabel::SetClickHdl( const Link& rLink )
- {
- if ( mpDescHyperLabel )
- mpDescHyperLabel->SetClickHdl( rLink);
- }
-
- const Link& ORoadmapHyperLabel::GetClickHdl( ) const
+ //---------------------------------------------------------------------
+ void RoadmapItem::SetClickHdl( const Link& rLink )
{
- return mpDescHyperLabel->GetClickHdl();
+ if ( mpDescription )
+ mpDescription->SetClickHdl( rLink);
}
-
- ORoadmapIDHyperLabel::ORoadmapIDHyperLabel( Window* _pParent, const ResId& _rId )
- :FixedText( _pParent, _rId )
+ //---------------------------------------------------------------------
+ const Link& RoadmapItem::GetClickHdl( ) const
{
+ return mpDescription->GetClickHdl();
}
- ORoadmapIDHyperLabel::ORoadmapIDHyperLabel( Window* _pParent, WinBits _nWinStyle )
+ //---------------------------------------------------------------------
+ IDLabel::IDLabel( Window* _pParent, WinBits _nWinStyle )
:FixedText( _pParent, _nWinStyle )
{
}
-
- ORoadmapIDHyperLabel::~ORoadmapIDHyperLabel( )
+ //---------------------------------------------------------------------
+ IDLabel::~IDLabel( )
{
}
-
- void ORoadmapIDHyperLabel::DataChanged( const DataChangedEvent& rDCEvt )
+ //---------------------------------------------------------------------
+ void IDLabel::DataChanged( const DataChangedEvent& rDCEvt )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
FixedText::DataChanged( rDCEvt );