[haiku-bugs] [Haiku] #11871: BButton class accepting BShape argument for its label

  • From: "konradjr" <trac@xxxxxxxxxxxx>
  • Date: Sat, 21 Feb 2015 23:48:10 -0000

#11871: BButton class accepting BShape argument for its label
----------------------------+----------------------
 Reporter:  konradjr        |        Owner:  stippi
     Type:  enhancement     |       Status:  new
 Priority:  normal          |    Milestone:  R2
Component:  User Interface  |      Version:
 Keywords:                  |   Blocked By:
 Blocking:                  |  Has a Patch:  0
 Platform:  All             |
----------------------------+----------------------
 At the moment, one can pass a 'text' (''const char*'') argument to set the
 text-label of a ''BButton''.
 Would it be possible to pass a ''BShape'' argument to a ''BButton'' object
 in order to create a button with a 'picture' instead of a text label?

 I have seen how the ''mediaplayer'' solves this (for its 'transport'
 play/pause/stop buttons), where it overrides the ''BButton'' 's methods
 (especially the ''Draw()'' method) in order to achieve this.

 In this possible solution, I imagine, there would be a ''SetShape(BShape*
 shape)'' method (corresponding to the ''SetLabel(const char* label)''
 method of the ''BButton'' class.

 Would something like that be programmatically possible, especially with
 regards to Haiku's ''LayoutManager''? I imagine that if it used
 'overloading', this solution would not break any previous BeOS or Haiku
 code.

--
Ticket URL: <https://dev.haiku-os.org/ticket/11871>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: