//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : TodoLst.dg // $ProjectName : The Hammer 2.0 // $Authors : Wil van Antwerpen, Michael Kurz, Sergey V. Natarov, Bernhard Ponemayr // $Created : 01.25.2014 01:08 // $Type : LGPL // // Contents: TODO List // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd Use cToolBar Use THTODO.DD Object oTODOLST Is a dbModalPanel #IF (!@ >= 140) Set pbSizeToClientArea to False #ENDIF Property Integer piEditView public 0 Set locate_mode To NO_LOCATE Set Label To "TODO List" Set Size To 234 151 Set Location To 2 229 Object Thtodo_DD Is a Thtodo_DataDictionary End_Object // Thtodo_DD Set Main_DD To (Thtodo_DD(Self)) Set Server To (Thtodo_DD(Self)) Object oMenu Is a cToolBar Set pbShowLabels To True // display the psLabel property on the button Set pbList To True // show the psLapel property to the right of the image Set pbNoDivider To True Set pbInMdiPanel To False Object oAdd Is a cToolbarButton Set pbAutoSize To True Set psLabel To 'Add' Set psTooltip To 'Creates new record' Set piImage To iiNoImage Procedure OnClick Integer iEdit Delegate Get piEditView To iEdit Send Popup To (oToDo(Self)) 0 iEdit End_Procedure End_Object Object oEdit Is a cToolbarButton Set pbAutoSize To True Set psLabel To 'Edit' Set psTooltip To 'Edit existent record' Set piImage To iiNoImage Procedure OnClick Delegate Send MaintainToDo End_Procedure End_Object Object oDelete Is a cToolbarButton Set pbAutoSize To True Set psLabel To 'Delete' Set psTooltip To 'Deletes existent record' Set piImage To iiNoImage Procedure OnClick Delegate Send Request_Delete Delegate Send Beginning_Of_Data End_Procedure End_Object Object oGoto Is a cToolbarButton Set pbAutoSize To True Set psLabel To 'DoIt!' Set psTooltip To 'Opens associated file' Set piImage To iiNoImage Set pbEnabled To False Procedure OnClick Send CAOpenFile To (oClientArea(Self)) (Trim(THTODO.File)) Delegate Send Close_Panel End_Procedure End_Object End_Object Procedure MaintainToDo Integer iRec Get Current_Record Of (Thtodo_DD(Self)) To iRec Send Popup To (oToDo(Self)) iRec (piEditView(Self)) End_Procedure Object oDbGrid1 Is a dbGrid Set Autosize_height_state To False Set read_only_state To true Set GridLine_Mode To 2 Set Main_File To Thtodo.File_Number Set Ordering To 1 Set Size To 209 148 Set Location To 15 -1 Set Wrap_State To TRUE Set Resize_Column_State To False On_Key KEY_ENTER Send MaintainToDo Procedure mouse_click Integer iPara0 Send MaintainToDo End_Procedure Begin_Row Entry_Item Thtodo.Completed Entry_Item ("") Entry_Item Thtodo.Title End_Row Set Form_Width Item 0 To 14 Set Header_Label Item 0 To "" Set Column_Checkbox_State Item 0 To True Set Form_Width Item 1 To 14 Set Header_Label Item 1 To "" Set Form_Width Item 2 To 112 Set Header_Label Item 2 To "Description" Procedure item_change Integer iFrom Integer iTo Returns Integer Integer iRet iClr Forward Get Msg_item_change iFrom iTo To iRet Get ItemTextColor Item iRet To iClr Set CurrentCellTextColor To iClr Set CurrentRowTextColor To iClr Set CurrentCellColor To (rgb(230,230,255)) //Set CurrentRowColor To (rgb(230,230,255)) Procedure_Return iRet End_Procedure Procedure Change_Row_Color Integer iColor Integer iBase iItem iItems Get Base_Item To iBase // first item of current row Get Item_Limit To iItems // items per row Move (iBase +iItems -1) To iItems // last item in the current row For iItem From iBase To iItems // set all items in row to color Set ItemTextColor Item iItem To iColor Set Entry_State Item iItem To False Loop End_Procedure // Change_Row_Color Procedure Entry_Display Integer iFile Integer iType Integer iClr iItem Move clNavy To iClr Set pbEnabled Of (oGoto(oMenu(Self))) To False If (thtodo.type="FILE") Begin Set Form_Bitmap Item (Base_Item(Self)+1) To "todo_file.bmp" If (thtodo.file<>"") Set pbEnabled Of (oGoto(oMenu(Self))) To True End If (thtodo.type="GLOBAL") Begin Set Form_Bitmap Item (Base_Item(Self)+1) To "todo_global.bmp" Set pbEnabled Of (oGoto(oMenu(Self))) To False End If (thtodo.type="PROJECT") Begin Set Form_Bitmap Item (Base_Item(Self)+1) To "todo_ws.bmp" Set pbEnabled Of (oGoto(oMenu(Self))) To False End If (thtodo.type="NOTE") Begin Set Form_Bitmap Item (Base_Item(Self)+1) To "Notes.bmp" Set pbEnabled Of (oGoto(oMenu(Self))) To False End Send Change_Row_Color iClr Forward Send Entry_Display iFile iType End_Procedure // Entry_Display Procedure OnResize Integer cyx cb ca Delegate Get GUISize To cyx Get Size To cb Set GUISize To (hi(cyx)-46) (low(cyx)-5) Send Adjust_Logicals Get Size To ca Send Resize_Columns (Low(ca)-low(cb)) End_Procedure Procedure Activate Returns Integer Integer iRet Forward Get Msg_Activate To iRet Send Beginning_Of_Data Procedure_Return iRet End_Procedure Procedure Resize_Columns Integer iDelta Integer iCols Get line_size To iCols Set form_width (iCols-1) To (form_width(Self,iCols-1)+iDelta) End_Procedure End_Object // oDbGrid1 Procedure Set GUISize Integer iY Integer iX Forward Set GUISize To iY iX Broadcast Send OnResize End_Procedure Procedure popup Integer cyx cyxs lyx Integer hoID Move (Focus(Desktop)) To hoID If (hoID) Begin // changed the check since only object's of class cEditorEditView understands the // function GetEditViewID and all object's created on this class always have the name // OFILE ;-) // not a very clean solution but very effective // 28.03.2003 BP If (Pos(".OFILE.",(uppercase(name(hoID))))) Ne 0 Begin //If (Name(hoID)<>"oMain.oClientArea") Begin // If (Popup_State(hoID)=False) Begin // **WvA: 06-05-2002, check for toolpanels such Get GetEditViewID Of hoID To hoID // as the systemparamter and customize menu Set piEditView To hoID //End End End Get GuiSize Of (oClientArea(Self)) To cyx Get GUILocation Of (oMain(Self)) To lyx Get GUISize To cyxs Set GUILocation To (hi(lyx)+81) (low(lyx)+low(cyx)-low(cyxs)+2) Set GUISize To (hi(cyx)-3) (low(cyxs)) Forward Send popup End_Procedure End_Object // oTODOLST