PDA

View Full Version : Position der Trennlinie des Spittercontainers merken



Roman Köhler
23-Jun-2016, 10:30 AM
Hallo allerseits,

heute habe ich gleich zwei Fragen.
Ich würde gerne die letzte Position des Splittercontainers in der Registrierung speichern. D.h. wird die Trennlinie mit der Maus verschoben, soll der neue Wert gespeichert und beim nächsten Aufruf benutzt werden.

Ich habe jetzt schon an allen möglichen Stellen mit dem Debugger Breakpoints angelegt und versucht die vermeintlichen Methoden in eine eigene Klasse zu packn und zu erweitern, aber ich finde scheinbar nicht die richtige.

Hat jemand eine Idee, welche Klasse ich wie verändern müsste?

Danke
Roman

FrankValcarcel
23-Jun-2016, 11:23 AM
Ich habe momentar nicht viel zeit aber hier is was wir benuetzen,


//************************************************** *************************
//*
//* Class: cCovedbSplitterContainer
//* Package Name: cCovedbSplitterContainer.pkg
//*
//************************************************** *************************
Use Windows.pkg
Use cdbSplitterContainer.pkg
Use CoveTextEdit.pkg
Property String psLineDetailForumla
Register_Object oTextDataDetail
Class cCoveLineDetailtextEdit is a CoveTextEdit
Procedure Construct_Object
Forward Send Construct_Object
Property String psCode
Property String psLineDetailFormula
Set peAnchors to anAll
Set Read_Only_State to True
On_Key Key_F3 Send EditTextData
End_Procedure
Procedure CoveClear
Set Value to ""
End_Procedure
Procedure CoveRefresh
String sHold
Get psLineDetailFormula to sHold
If (sHold < bang) Begin
Send locate_textdata_record_for_userid "SCR" (psCode(Self)) "LINEDETL" ""
Set psLineDetailFormula to (Trim(TextData.Text))
Trim textdata.text to sHold
End
[sysop] If (sHold < bang) Move ("Formula in Textdata:SCR:" - (psCode(Self)) - ":LINEDETL -F3") to sHold
If "(" IN sHold Move (Eval(sHold)) to sHold
Set Value to sHold
End_Procedure

Procedure EditTextData
Send locate_textdata_record_for_userid_no_Clear "SCR"(psCode(Self)) "LINEDETL" ""
If (TextData.Recnum = 0) Begin
FVTIMESTAMP Textdata
FVSAVERECORD Textdata // create
End
fvpopup oTextdataDetail Textdata.recnum
Send locate_textdata_record "SCR" (psCode(Self)) "LINEDETL"
Set psLineDetailFormula to (Trim(TextData.Text))
End_Procedure
End_Class

Class cCovedbSplitterContainer is a cdbSplitterContainer
// Construct_Object: Object constructor.
Procedure Construct_object
Integer iSize
Forward Send Construct_Object
Property Boolean pbRememberSplitterLocation True
Property String psLineDetailFormula
Set piSplitterColor to clDkGray
Set pbSplitVertical to False
Set peFixedPanel to fpFixLastPanel
End_Procedure

// Procedure Add_focus Handle hoParent Returns Integer
Procedure SizeSplitter
Integer iRetval
Integer iSize
String sHold
[debug] Showln "Restoring Splitter Position"
If (pbRememberSplitterLocation(Self)) Begin
Get StringField (name(Self)) "." 3 to sHold
Append sHold "\" (Object_Label(Self))
Clear TranData
Move "SPLITPOS" to TranData.Codeset
Move sHold to TranData.Code1
Move "SplitterLocation" to TranData.Code2
Move gsOperator to TranData.Code3
Find EQ TranData by Index.1
[Found] Begin
Set piSplitterLocation to TranData.Description
Send Paint
//Set piSplitterLocation to 80
[debug] Showln "Splitter: " (piSplitterLocation(Self))
End
End
End_Procedure

//
// Modified to store splitter location and redraw browses.
//
Procedure MoveSplitter Integer iGuiTrack
Integer cxy
Integer iFirstSize
Handle hoFirstPanel
Boolean bVertical
String sHold

Get pbSplitVertical to bVertical

Get phoFirstPanel to hoFirstPanel
Get GuiSize of hoFirstPanel to cxy
If bVertical Begin
Move (Low(cxy) + iGuiTrack) to iFirstSize
End
Else Begin
Move (Hi(cxy) + iGuiTrack) to iFirstSize
End

Set piGuiSplitterLocation to iFirstSize
If (pbRememberSplitterLocation(Self)) Begin
Get piSplitterLocation to iFirstSize
Get StringField (name(Self)) "." 3 to sHold
Append sHold "\" (Object_Label(Self))
Clear TranData
Move "SPLITPOS" to TranData.Codeset
Move sHold to TranData.Code1
Move "SplitterLocation" to TranData.Code2
Move gsOperator to TranData.Code3
Find EQ TranData by Index.1
If [Found] Reread Trandata
Else Lock
Move iFirstSize to TranData.Description
If (TranData.Doc_no = 0) FV_PAR_COUNTER "#TRANDAT" Trandata.doc_no
FVSAVERECORD Trandata
Unlock
[debug] Showln "Saved splitter loc: " iFirstSize
End
//
// Force any browses to redraw
//
Broadcast Recursive Send OnResize
Broadcast Recursive Send DoResize
End_Procedure

End_Class // CoveButton

Roman Köhler
24-Jun-2016, 05:03 AM
Hallo Frank,

als erstes einmal vielen Dank für Deine schnelle und sehr umfangeiche Hilfe.
Als zweites: Ich habe jetzt 3 Wochen Urlaub und kann die Vorschläge auch erst in 3 Wochen ausprobieren.
Ich gebe dann Bescheid.

Danke