File indexing completed on 2023-10-25 09:46:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "TGPicture.h"
0015 #include "TGClient.h"
0016 #include "TSystem.h"
0017 #include <cassert>
0018
0019
0020 #include "Fireworks/Core/src/FWCheckBoxIcon.h"
0021
0022
0023
0024
0025
0026
0027
0028
0029 static const TGPicture* checkImage() {
0030 static const TGPicture* s_picture = gClient->GetPicture(FWCheckBoxIcon::coreIcondir() + "check-mark.png");
0031 return s_picture;
0032 }
0033
0034
0035
0036
0037 FWCheckBoxIcon::FWCheckBoxIcon(unsigned int iEdgeLength) : FWBoxIconBase(iEdgeLength), m_checked(false) {}
0038
0039
0040
0041
0042
0043
0044 FWCheckBoxIcon::~FWCheckBoxIcon() {}
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 void FWCheckBoxIcon::drawInsideBox(Drawable_t iID, GContext_t iContext, int iX, int iY, unsigned int iSize) const {
0066 if (m_checked) {
0067 int xOffset = (iSize - checkImage()->GetWidth()) / 2;
0068 int yOffset = (iSize - checkImage()->GetHeight()) / 2;
0069 checkImage()->Draw(iID, iContext, iX + xOffset, iY + yOffset);
0070 }
0071 }
0072
0073
0074
0075
0076 const TString& FWCheckBoxIcon::coreIcondir() {
0077 static TString path = Form("%s/src/Fireworks/Core/icons/", gSystem->Getenv("CMSSW_BASE"));
0078 if (gSystem->AccessPathName(path.Data())) {
0079 assert(gSystem->Getenv("CMSSW_RELEASE_BASE"));
0080 path = Form("%s/src/Fireworks/Core/icons/", gSystem->Getenv("CMSSW_RELEASE_BASE"));
0081 }
0082
0083 return path;
0084 }