22. Juli 2008 14:16
22. Juli 2008 14:42
22. Juli 2008 14:59
22. Juli 2008 15:14
22. Juli 2008 15:20
22. Juli 2008 16:01
22. Juli 2008 16:09
Compact := NOT Compact;
Modify;
23. Juli 2008 08:19
23. Juli 2008 09:07
23. Juli 2008 09:50
//Transfer actual Record to global Record-Variable
G_SoruceRec.RESET;
G_SoruceRec.COPYFILTERS(Rec);
G_SoruceRec.SETCURRENTKEY(ItemNo, Level, ArticleNo); //Hier wird ein Sortierkriterium benötigt. Bei mir zuerst nach der ItemNo, dann nach der Level und zuletzt nach ArticleNo sortiert. Sortiert man nur nach Level, kann das ganze logischerweise nicht klappen.
//Delete all actual Records and end the current write transaction
DELETEALL;
COMMIT;
//Insert Records from global Record-Variable
IF G_SoruceRec.FINDSET THEN BEGIN
REPEAT
IF (G_SoruceRec.Level = 0) THEN BEGIN
TRANSFERFIELDS(G_SoruceRec);
INSERT;
END;
UNTIL G_SoruceRec.NEXT = 0;
END;
SETCURRENTKEY(ItemNo, Level, ArticleNo);
//Transfer actual Record to global and local Record-Variable
G_SourceRec.RESET;
G_SourceRec.COPYFILTERS(Rec);
G_SourceRec.SETCURRENTKEY(ItemNo, Level, ArticleNo);
G_SourceRec.TRANSFERFIELDS(Rec);
//Es wird eine lokale Record-Variable benötigt, um sich zu merken, an welcher Stelle man sich vorher befunden hat.
L_Rec.COPYFILTERS(Rec);
L_Rec.SETCURRENTKEY(ItemNo, Level, ArticleNo);
L_Rec.TRANSFERFIELDS(Rec);
//Check actual expansion status to expand or collapse Table-Lines
IF G_ActualExpansionStatus = G_ActualExpansionStatus::"Has Children" THEN BEGIN
IF G_SourceRec.NEXT <> 0 THEN BEGIN
REPEAT
IF G_SourceRec.Level > L_Rec.Level THEN BEGIN
TRANSFERFIELDS(G_SourceRec);
INSERT;
END;
UNTIL (G_SourceRec.NEXT = 0) OR (G_SourceRec.Level = L_Rec.Level);
END;
END ELSE
IF G_ActualExpansionStatus = G_ActualExpansionStatus::Expanded THEN BEGIN
WHILE (NEXT <> 0) AND (Level > L_Rec.Level) DO
DELETE;
END;
//Transfer local Record to actual Record and update CurrentForm
TRANSFERFIELDS(L_Rec);
CurrForm.UPDATE;
//Set expansion status on the basis of current Level
IF Level > 0 THEN BEGIN
G_ActualExpansionStatus := G_ActualExpansionStatus::ChildNode;
END ELSE
IF IsExpanded(Rec) THEN BEGIN
G_ActualExpansionStatus := G_ActualExpansionStatus::Expanded;
END ELSE
IF HasChildren(Rec) THEN
G_ActualExpansionStatus := G_ActualExpansionStatus::"Has Children"
ELSE
G_ActualExpansionStatus := G_ActualExpansionStatus::"No Children";
//Transfer actual Record to local Record-Variable
L_Rec.COPYFILTERS(Rec);
L_Rec.SETCURRENTKEY(ItemNo, Level, ArticleNo);
L_Rec.TRANSFERFIELDS(Rec);
//Transfer fields from assigned Record to actual Record
TRANSFERFIELDS(P_CurrentRec);
//Find out expansion status
Found := (NEXT <> 0);
IF Found THEN
Found := (Level > P_CurrentRec.Level);
//Transfer local Record to actual Record and exit Function
TRANSFERFIELDS(L_Rec);
EXIT(Found);
//Transfer actual Record to global Record-Variable
G_SourceRec.RESET;
G_SourceRec.COPYFILTERS(Rec);
G_SourceRec.SETCURRENTKEY(ItemNo, Level, ArticleNo);
G_SourceRec.TRANSFERFIELDS(P_CurrentRec);
//Find out if current Record has Child-Records
IF G_SourceRec.NEXT = 0 THEN
EXIT(FALSE)
ELSE
EXIT(G_SourceRec.Level > P_CurrentRec.Level);
23. Juli 2008 10:19
23. Juli 2008 10:26
LSmedcap hat geschrieben:@Jörg
... Vermisse nämlich den OnPush-Trigger in der PictureBox. ...
23. Juli 2008 11:15