[Igarden-commit] CommonSource/YAAFExtensions RGHypertext.cpp, 1.24.2.2, 1.24.2.3 RGHypertext.h, 1.1
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2007-01-11 01:34:11
|
Update of /cvsroot/igarden/CommonSource/YAAFExtensions In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26147 Modified Files: Tag: Release_branch_v1 RGHypertext.cpp RGHypertext.h RGHypertextView.cpp Log Message: Allow highlight of links which have been clicked Index: RGHypertextView.cpp =================================================================== RCS file: /cvsroot/igarden/CommonSource/YAAFExtensions/RGHypertextView.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** RGHypertextView.cpp 22 Jan 2006 02:55:08 -0000 1.7 --- RGHypertextView.cpp 11 Jan 2007 01:34:07 -0000 1.7.2.1 *************** *** 157,160 **** --- 157,162 ---- hit = true; XGBroadcast::SendBroadcast(KXGHyperlinkHit,GetViewID(),(void*)_anchorMap[n].link.c_str()); + TouchAnchor(_anchorMap[n].link); + InvalView(); break; } Index: RGHypertext.cpp =================================================================== RCS file: /cvsroot/igarden/CommonSource/YAAFExtensions/RGHypertext.cpp,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -C2 -d -r1.24.2.2 -r1.24.2.3 *** RGHypertext.cpp 19 Dec 2006 12:57:13 -0000 1.24.2.2 --- RGHypertext.cpp 11 Jan 2007 01:34:07 -0000 1.24.2.3 *************** *** 145,148 **** --- 145,153 ---- } + void RGHypertext::TouchAnchor(String &str) + { + _selectedAnchors[str] = 1; + } + void RGHypertext::FontFlags(bool enable, long flags) { *************** *** 591,595 **** void RGHypertext::StartAnchor() { ! doublePoint_t pos; PRECONDITION(!_inAnchor); --- 596,601 ---- void RGHypertext::StartAnchor() { ! doublePoint_t pos; ! selectedAnchors_t::iterator iter; PRECONDITION(!_inAnchor); *************** *** 610,614 **** DuplicateFont(); FontFlags(true, KXGFontUnderline); ! SetColor(RGB(0, 0, 255)); } --- 616,623 ---- DuplicateFont(); FontFlags(true, KXGFontUnderline); ! if(_selectedAnchors.find(_anchorKey) != _selectedAnchors.end()) ! SetColor(RGB(255, 0, 128)); ! else ! SetColor(RGB(0, 0, 255)); } Index: RGHypertext.h =================================================================== RCS file: /cvsroot/igarden/CommonSource/YAAFExtensions/RGHypertext.h,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** RGHypertext.h 2 Feb 2006 00:10:02 -0000 1.13 --- RGHypertext.h 11 Jan 2007 01:34:07 -0000 1.13.2.1 *************** *** 32,35 **** --- 32,36 ---- #define YAAF_XGHypertext + #include <map.h> #include <XConfig.h> #include <XGView.h> *************** *** 162,165 **** --- 163,168 ---- } lineEntry_t; + typedef std::map<String, long> selectedAnchors_t; + /************************************************************************/ /* */ *************** *** 252,255 **** --- 255,260 ---- protected: + void TouchAnchor(String &str); + double _x; double _y; *************** *** 284,287 **** --- 289,293 ---- short _scaleByPercent; XGDynArray<lineEntry_t> _entries; + selectedAnchors_t _selectedAnchors; }; |