April 20, 2024, 09:37:58 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Add a Tabstop to a custom button

Started by Andy, January 21, 2015, 04:50:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

I use Larry's custom button designer to design control buttons.

Does anyone know how to add a @TABSTOP?

To create a normal button in IWB and add a tabstop it's easy:
Control mainscreen,@STATIC,"My Button",40,120,170,35,@TABSTOP,button_1

But with the designer to create a button it doesn't seem to allow this:
CreateCB_LM(mainscreen,"My Button",40,120,170,35,BUTTON_6)

So has anyone managed to add a tabstop to a button created with the custom button designer?

I know Larry is not very well at the moment (and we all wish him a "Get well soon"), anyone know if it can be done?

Thanks,
Andy.
:)

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,

At work at the moment, so can't test, but can't you use the MODIFYSTYLE command?

Brian

Andy

Hi Brian,

Thanks for that, I'm trying it but to no avail at the moment.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy, I keep forgetting this command, as long as you're using a WINDOW type

ENABLETABS(win as WINDOW,bEnable as INT)

Any good?

Brian

Andy

Thanks for trying Brian, but that doesn't work either.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

Try this
'if mainscreen is a window add this line
ENABLETABS mainscreen, 1

and then  add this
MODIFYSTYLE (mainscreen, @TABSTOP, 0, BUTTON_6)
' Show the changes
REDRAWFRAME (mainscreen, BUTTON_6)

after
CreateCB_LM(mainscreen,"My Button",40,120,170,35,BUTTON_6)

'if mainscreen is a dialog add this
MODIFYSTYLE (mainscreen, @TABSTOP, 0, BUTTON_6)
' Show the changes
REDRAWFRAME (mainscreen, BUTTON_6)

in
select @msg
   case @idinitdialog
      '-->here


LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Well, I was on the right track, Andy, both times. Just didn't put them together!

Brian

Andy

Thanks Brian and Larry,

Just taken a few days to try several different ways.

Yes Brian (clever clogs - only joking!), you were right.

In the end I decided to remove the Enambletabs command, and detect and count tab presses to highlight
the appropriate control.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

It appears my suggested fix above was in error.
The error was not in what I suggest but in the coding of my library.
A portion of my library is based on the structure of IWB's rgnbutton which has its own custom message handler as does the IWB @button and @static controls.  I tested the region button and the @tabstop flag works there in a dialog.  So there is something that is being done in the region button that I am not doing in my custom buttons that I should be doing.  The trick is for me to figure out what it is, how to fix it, and not break something else.

But it should be fixed.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

Sorry, I didn't mean to cause you any stress or work.

I could make a test program tab between buttons, but I had to use a count to detect when the custom buttons should have been highlighted.

I also found that if I added a checkbox, I couldn't "move off" the checkbox until I selected or deselected the checkbox, but probably
that was me.

Anyway, as I said, I got around it by removing the Enabletabs command and counted every time the tab key was pressed.

Thanks,
Andy.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

Quote from: andy1966 on January 26, 2015, 06:55:03 AM
I didn't mean to cause you any stress or work.
You didn't cause me any stress.
As for work.. you found what I consider a bug in my library and I don't like bugs in my code(if I can fix them) ;)

Besides, after fighting that cold for 3+ weeks I'm beginning to feel like a human being again.
I'll start looking into my code later today.  Have an appt. with my "hand tremors" Dr. in an hour and then some grocery shopping.  Later this week I hope to get my cataract surgery scheduled.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Well, I've look at my library code enough to know it would take a major rewrite to get it it to work properly with the tab key in both windows and dialogs.  Considering that, and the fact that that there aren't that many people using the library , AND, apparently Andy is the only user who has found a need for it and he had found a work around I have made the decision not to spend the time on doing a rewrite to 'fix' the problem.

Instead I will goback to tinkering with the database utility I was playing with.  Sorry if I'm disappointing anyone.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Hi Larry,

No problem what so ever, it was just one of those little questions that turned something up.

I have attached my work around for anyone who may find it useful.

To use it:

You will need Larry's custom button program installed.

Press <Enter> when a button is highlighted.
Press <Space> when a check box is highlighted.

or simply click the button / checkbox as normal.

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Thanks for sharing Andy!

Your workaround can come in handy in many other contexts as well.

As my version of the button library is very old, purchased long before IWB, I changed the file extension to .eba, and compiled it using EB. No buttons though, but the changing text style showed your idea clearly.
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil!

No problem, If I find something of use I always share.

I'm just posting an example of how to add "flat buttons" i.e. buttons without a border.

Please see the "User Offerings" section.

It may help someone.

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.