Hallo GolezTrol,
Dank voor je reactie. Ik moest even goed nadenken wat je precies bedoelde, maar ik hoop dat ik het goed heb begrepen.
Ik heb het nu als volgt aangepast:
Delphi Code:
procedure TMainForm.StatusBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect);
var
RectForText : TRect;
begin
with StatusBar.Canvas do
begin
// StatusBar.Canvas.Brush.Color := clBtnFace;
// StatusBar.Canvas.FillRect(Rect);
// TextOut(Rect.left + 5, Rect.top + 2, pDiversen.TextLine1);
// TextOut(Rect.left + 5, Rect.top + 22, pDiversen.TextLine2);
StatusBar.Canvas.Font.Color := clGreen;
RectForText := Rect;
StatusBar.Canvas.FillRect(RectForText);
DrawText(StatusBar.Canvas.Handle, PChar(Panel.Text), -1, RectForText, DT_WORDBREAK or DT_TOP or DT_LEFT);
end;
end;
En ik roep nu gewoon de StatusBar als volgt aan:
Delphi Code:
if strtoFloat(ePresureDifference.Text) <= (PD[IndexLaagsteWaarde]) then
begin
aStr := aStr + ' The Meassurred Presure Difference [' + ePresureDifference.Text + '] is lower than the minimum required Pressure Difference [' + floattostr((PD[IndexLaagsteWaarde]));
aStr := aStr + ']. Adjust the balancing valve to achieve the Minimum Pressure Difference.';
bStr := 'Additional adjustment is required. The system water flow is NOT balanced. The Meassurred Presure Difference [' + ePresureDifference.Text + '] is lower than the minimum required Pressure Difference [' + floattostr((PD[IndexLaagsteWaarde])) + ']';
bStr := bStr + ' Adjust the balancing valve to achieve the Minimum Pressure Difference.';
StatusBar.Panels[0].Text := bStr;
pDiversen.PressureBalanced := false;
ePresureDifference.Font.Color := clRed;
end else
begin
pDiversen.PressureBalanced := true;
ePresureDifference.Font.Color := clWindowText;
end;
InformeerGebruiker(aStr, mtWarning, [mbOK], [mbOK]);
pDiversen.Balanced := false;
end;
Het aanroepen van de status bar is nu ook handiger door:
Delphi Code:
StatusBar.Panels[0].Text := bStr;
in plaats van:
Delphi Code:
pDiversen.Str1 := 'Enter the water temperature in degrees Celcius.';
pDiversen.Str2 := 'Enter the water temperature in degrees Celcius.';
StatusBar1.Invalidate;
En met de opties van DrawText kun je aangeven of de StatusBar 1 lijn moet worden of multiLine. Tevens kun je aangeven of de regels automatisch aan het eind moeten worden afgebroken.
Dank,
Johan
Bookmarks