View Issue Details

IDProjectCategoryView StatusLast Update
0002070JEDI VCL00 JVCL Componentspublic2004-08-19 23:44
ReporteranonymousAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0002070: Arrow Buttons bug in TJvOutlookBar JVCL 2.00
DescriptionFirst I have to appologise for reporting a bug in a rather old version, but I don't have time to search wheather it is in the fixed issues in 2.10. i searched the bug reports and didn't find it so maybe will be good to add it.

The problem occures when we have one page with enough buttons ( like 10-15 ) so they cannot be drawn in the page and a arrow buttons must be placed. We click that page and then we switch to a page that have no buttons and the arrow buttons stay visible.

The fix is simple:
We just have to put:
  TopButton.Visible := false;
  BtmButton.Visible := false;
at the start of TJvCustomOutlookBar.DrawArrowButtons

Here is the full code as i have it. Remember the version of the control is 2.00!
procedure TJvCustomOutlookBar.DrawArrowButtons(Index:integer);
var R:TRect;H:integer;
begin
  TopButton.Visible := false;
  BtmButton.Visible := false;
  if (Index < 0) or (Index >= Pages.Count) or (Pages[Index].Buttons = nil) or
   (Pages[Index].Buttons.Count <= 0) then Exit;
  R := getPageRect(Index);
  H := getButtonHeight(Index);
  TopButton.Visible := (Pages.Count > 0) and (R.Top < R.Bottom - 20) and (Pages[Index].TopButtonIndex > 0);
  BtmButton.Visible := (Pages.Count > 0) and (R.Top < R.Bottom - 20) and (Pages[Index].Buttons.Count > 0) and
    (R.Bottom - R.Top < (Pages[Index].Buttons.Count - Pages[Index].TopButtonIndex) * H); // remove the last - H to show arrow
                                                                                             // button when the bottom of the last button is beneath the edge
  if TopButton.Visible then
    TopButton.SetBounds(ClientWidth - 20,R.Top + 4,16,16)
  else if csDesigning in ComponentState then
    TopButton.Top := -1000;
  if BtmButton.Visible then
    BtmButton.SetBounds(ClientWidth - 20,R.Bottom - 20,16,16)
  else if csDesigning in ComponentState then
    BtmButton.Top := -1000;
end;

Regards
Stefan Ivanov,
GSP 1900 Bulgaria
Additional InformationPlease e-mail me at stiff_bg@mail.bg if this is really a bug and have to be fixed, because i did use the control and need to know if this doesn't crash things up.

Regards
Stefan Ivanov,
GSP 1900 Bulgaria
TagsNo tags attached.

Activities

user72

2004-08-19 23:42

  ~0005025

This has already been fixed but in a sligthly different manner (so it will work at design-time as well):

procedure TJvCustomOutlookBar.DrawArrowButtons(Index: Integer);
var
  R: TRect;
  H: Integer;
begin
  if csDestroying in ComponentState then
    Exit;
  if (Index < 0) or (Index >= Pages.Count) or (Pages[Index].Buttons = nil) or
    (Pages[Index].Buttons.Count <= 0) then
  begin
    TopButton.Visible := False;
    BtmButton.Visible := False;
  end
  else
  begin
    R := GetPageRect(Index);
    H := GetButtonHeight(Index);
    TopButton.Visible := (Pages.Count > 0) and (R.Top < R.Bottom - 20) and (Pages[Index].TopButtonIndex > 0);
    BtmButton.Visible := (Pages.Count > 0) and (R.Top < R.Bottom - 20) and
      (R.Bottom - R.Top < (Pages[Index].Buttons.Count - Pages[Index].TopButtonIndex) * H);
  // remove the last - H to show arrow
  // button when the bottom of the last button is beneath the edge
  end;
  if TopButton.Visible then
    TopButton.SetBounds(ClientWidth - 20, R.Top + 4, 16, 16)
  else if csDesigning in ComponentState then
    TopButton.Top := -1000;
  if BtmButton.Visible then
    BtmButton.SetBounds(ClientWidth - 20, R.Bottom - 20, 16, 16)
  else if csDesigning in ComponentState then
    BtmButton.Top := -1000;
  TopButton.Enabled := TopButton.Visible and Pages[Index].Enabled;
  BtmButton.Enabled := BtmButton.Visible and Pages[Index].Enabled;
end;

Issue History

Date Modified Username Field Change
2004-08-19 02:32 anonymous New Issue
2004-08-19 23:42 user72 Note Added: 0005025
2004-08-19 23:44 user72 Status new => resolved
2004-08-19 23:44 user72 Resolution open => fixed
2004-08-19 23:44 user72 Assigned To => user72