[Igarden-commit] Garden/source/PlanTool ActiveMaterial.h, 1.10.2.3, 1.10.2.4 ActiveMaterial.cpp, 1.
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-12-29 21:19:28
|
Update of /cvsroot/igarden/Garden/source/PlanTool In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15025 Modified Files: Tag: Release_branch_v1 ActiveMaterial.h ActiveMaterial.cpp Log Message: Add extra note that picture may differ Index: ActiveMaterial.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/ActiveMaterial.cpp,v retrieving revision 1.45.2.9 retrieving revision 1.45.2.10 diff -C2 -d -r1.45.2.9 -r1.45.2.10 *** ActiveMaterial.cpp 29 Dec 2006 15:47:35 -0000 1.45.2.9 --- ActiveMaterial.cpp 29 Dec 2006 21:19:26 -0000 1.45.2.10 *************** *** 47,52 **** using yaaf::XGBroadcast; ! #define POPUP_HEIGHT 22 ! #define NAME_HEIGHT 40 #define BORDER_WIDTH 2 --- 47,53 ---- using yaaf::XGBroadcast; ! #define POPUP_HEIGHT 20 ! #define NAME_HEIGHT 34 ! #define WARNING_HEIGHT 13 #define BORDER_WIDTH 2 *************** *** 58,61 **** --- 59,63 ---- const long kMaterialSelectMenu = 101; const long kMaterialNameText = 102; + const long kMaterialWarningText = 103; const long kMaterialImage = 104; const long kMaterialErrText = 105; *************** *** 94,98 **** XGSViewInitRecord popupInfo, imageInfo, catPopInfo; ! struct XGSTextInitRecord staticInfo, nameInfo; Point myPaneSize; long messageType, nameType, buttonType; --- 96,100 ---- XGSViewInitRecord popupInfo, imageInfo, catPopInfo; ! struct XGSTextInitRecord staticInfo, nameInfo, warningInfo; Point myPaneSize; long messageType, nameType, buttonType; *************** *** 164,167 **** --- 166,185 ---- _popup = new XGPopControl(this, popupInfo, kActiveMenuFont); + + warningInfo.v = popupInfo; + warningInfo.v.fViewID = kMaterialWarningText; + warningInfo.v.fVisible = true; + warningInfo.v.fEnabled = true; + warningInfo.v.fAutoLeft = BORDER_WIDTH; + warningInfo.v.fViewID = 'AmSt'; + warningInfo.font = 134; + warningInfo.v.fAutoLeft = 5; + warningInfo.v.fAutoTop = popupInfo.fAutoTop - WARNING_HEIGHT; + warningInfo.v.fAutoRight = -5; + warningInfo.v.fAutoBottom = warningInfo.v.fAutoTop + WARNING_HEIGHT; + strcpy(nameInfo.text, ""); + _warningText = new XGStaticText(this, warningInfo); + _warningText->HideView(); + nameInfo.v = popupInfo; nameInfo.v.fViewID = kMaterialNameText; *************** *** 171,175 **** nameInfo.v.fViewID = 'AmSt'; nameInfo.font = nameType; ! nameInfo.v.fAutoTop -= NAME_HEIGHT; nameInfo.v.fAutoBottom = nameInfo.v.fAutoTop + NAME_HEIGHT; strcpy(nameInfo.text, ""); --- 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, ""); *************** *** 426,429 **** --- 444,448 ---- _drawing->Deactivate(); _drawing->HideView(); + _warningText->HideView(); if(_image->SetSource(fileSpec) == noErr) { *************** *** 442,445 **** --- 461,465 ---- { DisplayMessage("No image available"); + _warningText->HideView(); _drawing->Deactivate(); _image->ShowView(); *************** *** 447,455 **** _image->InvalView(); } ! DisplayName(material->GetPictureTitle(kUsePreferencesSetting, kNameAsText)); } else { ! DisplayName(""); XGDirectory mkdir; _drawing->Deactivate(); --- 467,480 ---- _image->InvalView(); } ! ! String name; ! pictureLikeness_t likeness; ! ! name = material->GetPictureTitle(kUsePreferencesSetting, kNameAsText, likeness); ! DisplayName(name, likeness); } else { ! DisplayName("", kPictureExact); XGDirectory mkdir; _drawing->Deactivate(); *************** *** 503,509 **** /// DisplayName // ! void ActiveMaterial::DisplayName( const String& name ) ! { _nameText->SetTitle(name.c_str()); } --- 528,541 ---- /// DisplayName // ! void ActiveMaterial::DisplayName( const String& name, pictureLikeness_t likeness ) ! { _nameText->SetTitle(name.c_str()); + if(likeness == kPictureMayDiffer) + { + _warningText->SetTitle("May not be an exact match."); + _warningText->ShowView(); + } + else + _warningText->HideView(); } *************** *** 614,618 **** else { ! DisplayName(""); _message->SetTitle("Nothing Loaded"); _message->ShowView(); --- 646,650 ---- else { ! DisplayName("", kPictureExact); _message->SetTitle("Nothing Loaded"); _message->ShowView(); *************** *** 664,668 **** // --------------------------------------------------------------------------- ! /// RebuildPlotPalette // long ActiveMaterial::DoMaterialChangeID( long arg, void* parg ) --- 696,700 ---- // --------------------------------------------------------------------------- ! /// DoMaterialChangeID // long ActiveMaterial::DoMaterialChangeID( long arg, void* parg ) *************** *** 678,682 **** if(current != NULL) { ! DisplayName(current->GetDisplayName(kUsePreferencesSetting)); return 0; } --- 710,718 ---- if(current != NULL) { ! String name; ! pictureLikeness_t likeness; ! ! name = current->GetPictureTitle(kUsePreferencesSetting, kNameAsText, likeness); ! DisplayName(name, likeness); return 0; } *************** *** 687,691 **** // --------------------------------------------------------------------------- ! /// RebuildPlotPalette // long ActiveMaterial::DoPlantDrag( long arg, void* parg ) --- 723,727 ---- // --------------------------------------------------------------------------- ! /// DoPlantDrag // long ActiveMaterial::DoPlantDrag( long arg, void* parg ) *************** *** 791,795 **** { _image->ClearSource(); ! DisplayName(""); } --- 827,831 ---- { _image->ClearSource(); ! DisplayName("", kPictureExact); } *************** *** 813,817 **** { _image->ClearSource(); ! DisplayName(""); } InvalView(); --- 849,853 ---- { _image->ClearSource(); ! DisplayName("", kPictureExact); } InvalView(); Index: ActiveMaterial.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/ActiveMaterial.h,v retrieving revision 1.10.2.3 retrieving revision 1.10.2.4 diff -C2 -d -r1.10.2.3 -r1.10.2.4 *** ActiveMaterial.h 26 Nov 2006 01:25:40 -0000 1.10.2.3 --- ActiveMaterial.h 29 Dec 2006 21:19:26 -0000 1.10.2.4 *************** *** 79,83 **** Material* CurrentMaterial(); void DisplayMessage(char* message); ! void DisplayName(const String& name); virtual long DoGetMenuStatus(long arg, void* parg); virtual long DoMenuCommand(long arg, void* parg); --- 79,83 ---- Material* CurrentMaterial(); void DisplayMessage(char* message); ! void DisplayName(const String& name, pictureLikeness_t likeness); virtual long DoGetMenuStatus(long arg, void* parg); virtual long DoMenuCommand(long arg, void* parg); *************** *** 107,111 **** CQTImagePane* _image; XGStaticText* _message; ! XGStaticText* _nameText; materialArray_t _currentPlotItems; UInt32 _currentItem; --- 107,112 ---- CQTImagePane* _image; XGStaticText* _message; ! XGStaticText* _nameText; ! XGStaticText* _warningText; materialArray_t _currentPlotItems; UInt32 _currentItem; |