Icon View Thread

The following is the text of the current message along with any replies.
Messages 31 to 36 of 36 total
Thread Some Questions About TCheckBox
Wed, Feb 21 2018 5:55 AMPermanent Link

Michael Dreher

Uli Becker wrote:

 //  BTW: it helps if you have a look at the sources of existing (custom) components ...

And it's commended to have a look here:

  - https://www.elevatesoft.com/manual?action=viewtopic&id=ewb2&topic=Control_Interfaces

where the basics of control interfaces are explained.

Michael Dreher
Wed, Feb 21 2018 10:27 AMPermanent Link

Frederick Chin

Uli,

/*
It's *always* necessary to override this function if you want to use a
modified interface. If you skip that, TMyCheckBox will use the TCheckBox
interface(s).
*/

Noted.

/*
BTW: it helps if you have a look at the sources of existing (custom)
components (a number of them were posted in the "Components" NG) in
order to understand the basics.
*/

I will if I decide to write components but that is not the area of expertise I want to go into. This is the first time I have actually modified an internal component in EWB (or Delphi for that matter) and it is quite a lot of work just to switch a caption from the right to the left.

In the future, I will keep things simple and fudge it if there is no event code I can write or if there is no third party component I can throw at the problem.

--
Frederick
Thu, Feb 22 2018 3:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Frederick,

<< I will if I decide to write components but that is not the area of expertise I want to go into. This is the first time I have actually modified an internal component in EWB (or Delphi for that matter) and it is quite a lot of work just to switch a caption from the right to the left. >>

EWB's control customization is a breeze compared to Delphi, primarily because almost everything in EWB's controls are declarative and in the control interfaces, as opposed to requiring custom painting code.  You just have to get the naming correct, which in this particular case is more complicated than normal because of the way that the checkbox states work (the icons are different for each state, and I was trying to avoid "state explosion" in the control interfaces).  Most controls have a single control interface that includes all of the states that the control needs.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 23 2018 8:03 AMPermanent Link

Matthew Jones

Frederick Chin wrote:

> it is quite a lot of work just to switch a caption from the right to the left

To be fair, that is not all you required. That was achievable by just changing the interface for the check box - a relatively easy thing once you have understood the layouts. What you then wanted was some to work one way, and some to work a different way, and that either then needs coding (which pretty much needs to be a derived component to handle the change) or a derived variant with a different interface. But both possible with a little bit of learning.

--

Matthew Jones
Fri, Feb 23 2018 5:50 PMPermanent Link

Frederick Chin

Tim,

/*
EWB's control customization is a breeze compared to Delphi, primarily because almost everything in EWB's controls are declarative and in the control interfaces, as opposed to requiring custom painting code.  You just have to get the naming correct, which in this particular case is more complicated than normal because of the way that the checkbox states work (the icons are different for each state, and I was trying to avoid "state explosion" in the control interfaces).  Most controls have a single control interface that includes all of the states that the control needs.
*/

I'll expect that it would be easier to customise controls with EWB compared with Delphi based on the sample code that you and Uli had provided.

However, since I have never done any control work with Delphi before, just looking at the code made my head spin and I just copied, pasted and tested.

I have to admit that I am not much of a systems code guy and I have to take baby steps to understand the code in future.

--
Frederick
Fri, Feb 23 2018 5:58 PMPermanent Link

Frederick Chin

"Matthew Jones" wrote:

/*
To be fair, that is not all you required. That was achievable by just changing the interface for the check box - a relatively easy thing once you have understood the layouts. What you then wanted was some to work one way, and some to work a different way, and that either then needs coding (which pretty much needs to be a derived component to handle the change) or a derived variant with a different interface. But both possible with a little bit of learning.
*/

I was comparing the work needed to make changes to the interface files with a control property setting. Now, if only TCheckBox had an "Alignment" property, all this work (and taking up Tim's and you guys' time) would not have been necessary.

--
Frederick
Previous PagePage 4 of 4
Jump to Page:  1 2 3 4
Image