//============================================================================= // Project : SigCj - VDF Classes for Codejock // File : SigCjCalendar_Icons.dg // Description : VDF Class for Codejock control // // Revision : $Rev: $ // $Date: $ // $Author: $ // // Requirements : Visual DataFlex 14.1+ // Codejock SuitePro - Version 13.4.0+ // // Copyright : Copyright © 2009-2012 VDF SIG UK, All rights reserved. // Visual DataFlex Special Interest Group UK. // http://www.vdfsig.co.uk/ // // This file is part of SigCj. // // SigCj is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, either version // 2.1 of the License, or (at your option) any later version. // // SigCj is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // If you have the complete SigCj workspace then a copy of the // GNU Lesser General Public License is in the Docs folder. If // not, see . // //============================================================================= Use Windows.pkg Use cCJGrid.pkg Use cCJGridColumn.pkg Use cSigCjCalendar_Public.pkg Object oSigCjCalendar_CustomIcons_Panel is a ModalPanel Set Size to 185 156 Set Label to "Custom Icons" Set piMinSize to 89 156 Set Location to 2 2 Set Border_Style To Border_Thick Property tdSigCjCal_Dialog_CustomIcon ptDialog_CustomIcons Object oCJGrid1 is a cCJGrid Set Size to 149 137 Set Location to 7 10 Object oID is a cCJGridColumn Set piWidth to 55 Set psCaption to "ID" Set pbEditable to False Set pbResizable to False Set pbFocusable to False End_Object Object oImage is a cCJGridColumn Set piWidth to 56 Set psCaption to "" Set peIconAlignment to xtpAlignmentIconCenter Set pbResizable to False Set pbFocusable to False Set pbEditable to False Procedure OnSetDisplayMetrics Handle hoGridItemMetrics Integer iRow String sValue Integer iImage Get RowValue of oIndex iRow to iImage Set ComItemIcon of hoGridItemMetrics to iImage End_Procedure End_Object Object oAdd is a cCJGridColumn Set piWidth to 94 Set psCaption to "" Set pbCheckbox to True Set peIconAlignment to xtpAlignmentIconCenter End_Object Object oIndex is a cCJGridColumn Set piWidth to 100 Set psCaption to "hidden" Set pbShowInFieldChooser to False Set pbVisible to False End_Object Procedure Activating Integer iLoop iCount tDataSourceRow[] tDataSource tdSigCjCal_Dialog_CustomIcon tDialog_CustomIcons Forward Send Activating Get ptDialog_CustomIcons to tDialog_CustomIcons Move (SizeOfArray( tDialog_CustomIcons.tCustomIcons) - 1) to iCount For iLoop from 0 to iCount Move tDialog_CustomIcons.tCustomIcons[iLoop].iId to tDataSource[iLoop].sValue[0] Move (tDialog_CustomIcons.tCustomIcons[iLoop].eAction = eCal_Dialog_Action_Exists) to tDataSource[iLoop].sValue[2] // Add images to image manager.... Get AddImage tDialog_CustomIcons.tCustomIcons[iLoop].sFileName 0 to tDataSource[iLoop].sValue[3] Loop Send InitializeData tDataSource End_Procedure Procedure Retrieve_Data Integer iLoop iCount tDataSourceRow[] tDataSource tdSigCjCal_Dialog_CustomIcon tDialog_CustomIcons Get ptDialog_CustomIcons to tDialog_CustomIcons Get DataSource of (phoDataSource(Self)) to tDataSource Move (SizeOfArray(tDataSource) - 1) to iCount For iLoop from 0 to iCount If (tDataSource[iLoop].sValue[2] = "1") Begin Move eCal_Dialog_Action_Create to tDialog_CustomIcons.tCustomIcons[iLoop].eAction End Else Begin Move eCal_Dialog_Action_Delete to tDialog_CustomIcons.tCustomIcons[iLoop].eAction End Loop Move eCal_Dialog_Action_Edit to tDialog_CustomIcons.eAction Set ptDialog_CustomIcons to tDialog_CustomIcons End_Procedure End_Object Object oOK_Btn is a Button Set Label to "&OK" Set Location to 167 47 Set peAnchors To anBottomRight Procedure OnClick tdSigCjCal_Dialog_CustomIcon tDialog_CustomIcons Send Retrieve_Data of oCJGrid1 Get ptDialog_CustomIcons to tDialog_CustomIcons Move eCal_Dialog_Action_Edit to tDialog_CustomIcons.eAction Set ptDialog_CustomIcons to tDialog_CustomIcons Send Close_Panel End_Procedure End_Object Object oCancel_Btn is a Button Set Label to "&Cancel" Set Location to 167 102 Set peAnchors to anBottomRight Procedure OnClick tdSigCjCal_Dialog_CustomIcon tDialog_CustomIcons Get ptDialog_CustomIcons to tDialog_CustomIcons Move eCal_Dialog_Action_None to tDialog_CustomIcons.eAction Set ptDialog_CustomIcons to tDialog_CustomIcons Send Close_Panel End_Procedure End_Object On_Key Key_Alt+Key_O Send KeyAction of oOK_Btn On_Key Key_Alt+Key_C Send KeyAction of oCancel_Btn Function Show_Dialog tdSigCjCal_Dialog_CustomIcon tDialog_CustomIcons Returns tdSigCjCal_Dialog_CustomIcon Set ptDialog_CustomIcons of oSigCjCalendar_CustomIcons_Panel to tDialog_CustomIcons Send Popup of oSigCjCalendar_CustomIcons_Panel Get ptDialog_CustomIcons of oSigCjCalendar_CustomIcons_Panel to tDialog_CustomIcons Function_Return tDialog_CustomIcons End_Function End_Object