[Igarden-commit] Garden/source/PlanTool ActiveMaterial.h, 1.10.2.4, 1.10.2.5 ActiveMaterial.cpp, 1.
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2007-02-09 01:13:16
|
Update of /cvsroot/igarden/Garden/source/PlanTool In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20411 Modified Files: Tag: Release_branch_v1 ActiveMaterial.h ActiveMaterial.cpp Log Message: Add copyright annotations for Creative Commons compliance Index: ActiveMaterial.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/ActiveMaterial.cpp,v retrieving revision 1.45.2.14 retrieving revision 1.45.2.15 diff -C2 -d -r1.45.2.14 -r1.45.2.15 *** ActiveMaterial.cpp 28 Jan 2007 14:22:39 -0000 1.45.2.14 --- ActiveMaterial.cpp 9 Feb 2007 01:13:06 -0000 1.45.2.15 *************** *** 44,53 **** #include "CPlanPanel.h" #include "SourceQuery.h" using yaaf::XGBroadcast; #define POPUP_HEIGHT 20 ! #define NAME_HEIGHT 34 ! #define WARNING_HEIGHT 13 #define BORDER_WIDTH 2 --- 44,54 ---- #include "CPlanPanel.h" #include "SourceQuery.h" + #include "CInternetConfig.h" using yaaf::XGBroadcast; #define POPUP_HEIGHT 20 ! #define NAME_HEIGHT 26 ! #define WARNING_HEIGHT 12 #define BORDER_WIDTH 2 *************** *** 64,67 **** --- 65,69 ---- const long kPaletteSelectMenu = 106; const long kCategorySelectMenu = 107; + const long kMaterialCopyrightText = 108; const long kActiveMenuFont = 139; *************** *** 85,88 **** --- 87,91 ---- DISPATCHTABLE(kPaletteAddMsg,ActiveMaterial::DoHandleNewElement) DISPATCHTABLE(kDBChangeMaterialID,ActiveMaterial::DoMaterialChangeID) + DISPATCHTABLE(KXGHyperlinkHit,ActiveMaterial::DoHyperlinkHit) ENDDISPATCH *************** *** 97,100 **** --- 100,104 ---- XGSViewInitRecord popupInfo, imageInfo, catPopInfo; struct XGSTextInitRecord staticInfo, nameInfo, warningInfo; + RGHTextInitRecord copyrightInfo; Point myPaneSize; long messageType, nameType, buttonType; *************** *** 181,185 **** _warningText = new XGStaticText(this, warningInfo); _warningText->HideView(); ! nameInfo.v = popupInfo; nameInfo.v.fViewID = kMaterialNameText; --- 185,203 ---- _warningText = new XGStaticText(this, warningInfo); _warningText->HideView(); ! ! copyrightInfo.v = popupInfo; ! copyrightInfo.v.fViewID = kMaterialCopyrightText; ! copyrightInfo.v.fVisible = true; ! copyrightInfo.v.fEnabled = true; ! copyrightInfo.v.fAutoLeft = BORDER_WIDTH; ! copyrightInfo.v.fViewID = 'AmSt'; ! copyrightInfo.font = 146; ! copyrightInfo.color = -1; ! copyrightInfo.v.fAutoTop = warningInfo.v.fAutoTop - (WARNING_HEIGHT*3); ! copyrightInfo.v.fAutoBottom = copyrightInfo.v.fAutoTop + (WARNING_HEIGHT*3); ! strcpy(nameInfo.text, ""); ! _copyrightText = new RGHypertextView(this, copyrightInfo); ! _copyrightText->ShowView(); ! nameInfo.v = popupInfo; nameInfo.v.fViewID = kMaterialNameText; *************** *** 189,193 **** nameInfo.v.fViewID = 'AmSt'; nameInfo.font = nameType; ! nameInfo.v.fAutoTop = warningInfo.v.fAutoTop - NAME_HEIGHT; nameInfo.v.fAutoBottom = nameInfo.v.fAutoTop + NAME_HEIGHT; strcpy(nameInfo.text, ""); --- 207,211 ---- nameInfo.v.fViewID = 'AmSt'; nameInfo.font = nameType; ! nameInfo.v.fAutoTop = copyrightInfo.v.fAutoTop - NAME_HEIGHT; nameInfo.v.fAutoBottom = nameInfo.v.fAutoTop + NAME_HEIGHT; strcpy(nameInfo.text, ""); *************** *** 388,392 **** if(_popup->GetValue() != index) _popup->SetValue(index); ! material = GetIndexedMaterial(_currentItem); if(material != NULL) --- 406,410 ---- if(_popup->GetValue() != index) _popup->SetValue(index); ! material = GetIndexedMaterial(_currentItem); if(material != NULL) *************** *** 394,398 **** String fullName = material->GetFullCanonicalName(); SourceQuery query(SourceMaterialFile::GetSourceDatabase()); ! if(material->GetPictureFileSpec(fileSpec)) material->GetPictureRelativePath(fileName); --- 412,419 ---- String fullName = material->GetFullCanonicalName(); SourceQuery query(SourceMaterialFile::GetSourceDatabase()); ! PictureInfo info; ! const char *copyright, *by; ! String copyrightStr; ! if(material->GetPictureFileSpec(fileSpec)) material->GetPictureRelativePath(fileName); *************** *** 408,411 **** --- 429,448 ---- isSVG = true; } + + material->GetDefaultPictureTag(info); + copyrightStr.SetCString(""); + by = info.GetCreatedBy(); + if(by) + { + copyrightStr += "Picture: "; + copyrightStr += by; + } + copyright = info.GetCopyright(); + if(copyright) + { + copyrightStr += " using "; + copyrightStr += copyright; + } + _copyrightText->SetText(copyrightStr.c_str()); if(fileName.Length() != 0) *************** *** 757,760 **** --- 794,808 ---- // --------------------------------------------------------------------------- + /// DoPlantDrag + // + void ActiveMaterial::DoMouseMove(Point pt, short mod) + { + ViewToScreen (&pt); + // _drawing->ScreenToView(&pt); + // _drawing->DoMouseMove(pt, mod); + } + + + // --------------------------------------------------------------------------- /// UseIdleTime // *************** *** 1074,1075 **** --- 1122,1149 ---- } + // --------------------------------------------------------------------------- + /// DoHyperlinkHit + // + long ActiveMaterial::DoHyperlinkHit( long arg, void* parg ) + { + #pragma unused(arg) + char linkCopy[512]; + char *src = static_cast<char*>(parg); + CInternetConfig *url; + + if(CIstrncmp(src, "http://", 7) == 0) + strcpy(linkCopy, src); + else + { + strcpy(linkCopy, "http://"); + strcat(linkCopy, src); + } + url = new CInternetConfig(RSGrdenCreator); // test application signature + url->Start(); + yaaf::cvtc2p(linkCopy); + (void)url->DoURL((unsigned char*)linkCopy); + delete url; + + return 0; + } + Index: ActiveMaterial.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/ActiveMaterial.h,v retrieving revision 1.10.2.4 retrieving revision 1.10.2.5 diff -C2 -d -r1.10.2.4 -r1.10.2.5 *** ActiveMaterial.h 29 Dec 2006 21:19:26 -0000 1.10.2.4 --- ActiveMaterial.h 9 Feb 2007 01:13:06 -0000 1.10.2.5 *************** *** 34,37 **** --- 34,39 ---- #include <XGPopControl.h> #include <XGStaticText.h> + #include "RGHypertextView.h" + const long kActiveMaterialPaneID = 'AcMt'; *************** *** 84,87 **** --- 86,90 ---- virtual long DoPopValue(long arg, void* parg); virtual long DoHandleNewElement(long arg, void* parg); + virtual void DoMouseMove(Point,short); virtual bool Accept(long modifiers, long itemRef, long flavor); virtual void Track(Point where, long modifiers); *************** *** 91,94 **** --- 94,98 ---- long DoMaterialChangeID(long arg, void* parg); long DoPlantDrag(long arg, void* parg); + long DoHyperlinkHit( long arg, void* parg ); protected: *************** *** 109,112 **** --- 113,117 ---- XGStaticText* _nameText; XGStaticText* _warningText; + RGHypertextView* _copyrightText; materialArray_t _currentPlotItems; UInt32 _currentItem; |