Forum > Carbon

Why are TButtons square?

<< < (3/4) > >>

Phil:

--- Quote from: Frederick on February 21, 2011, 09:04:20 pm ---I just discovered that setting TBitBtn.Kind = bkOK results in a "OK" button glyph with a green checkmark. It would be nice if it were a blue Mac Aqua button, but maybe that is asking too much.

--- End quote ---

That's the garish old Delphi glyphs. I haven't seen apps that use them for years since that's not what Windows buttons look like either.

I'm not sure what the best solution ultimately is. Go ahead and file a bug report at least to document this. Perhaps all that's needed is for the Carbon widgetset to highlight the button that has Default = True.

Thanks.

-Phil

Phil:
Frederick,

What happens if you set a button's Default to True? Try it with both TButton and TBitBtn. I see this in the Carbon widgetset:

procedure TCarbonCustomButton.SetDefault(ADefault: Boolean);
begin
  OSError(
    SetControlData(ControlRef(Widget), kControlEntireControl,
      kControlPushButtonDefaultTag, SizeOf(Boolean), @ADefault),
    Self, 'SetDefault', SSetData);
end;

procedure TCarbonBitBtn.SetDefault(ADefault: Boolean);
begin
  // not supported
end;

So it seems like it should work with TButton but not with TBitBtn. If not, include your sample app that demonstrates the problem with your bug report.

Thanks.

-Phil

VTwin:
That does work Phil. Thanks, I don't know why I didn't see that. Too long staring at the screen I guess.

Should that behavior be implemented in a TBitBtn?

That leaves just the minor cosmetic issue of vertical text centering. It is obvious if you create a TButton and a TBitBtn both with Height = 22 and identical text. A minor point perhaps, but it makes the TButtons look slightly odd, something users notice when evaluating a program.

Phil:
That's probably why I wasn't seeing it, because I'm using TBitBtn.

It would be nice if TBitBtn supported the Default property. Not sure what that comment in the code means. Normally if a property is not supported, there will be an entry in the widgetset's issues.xml file, but I don't see anything about TBitBtn.Default in carbon's issues.xml.

You might want to post two different bug reports since the two issues are not related. That makes it easier for closing an issue if only one of them gets fixed.

Thanks.

-Phil

VTwin:
Thanks Phil, I really appreciate your help. I will file two reports with sample code.

Regards,
Frederick

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version