How to highlight a TabBar Button manually?

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

How to highlight a TabBar Button manually?

Post by DevBoyLars » Sat Apr 27, 2013 5:48 pm

Hi there,
how can I manually set, which of my TabBar-Buttons should be highlighted (font set to white) at runtime? It seems, that mobGUI wan't correctly do this automatically -.-

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sat Apr 27, 2013 10:03 pm

Hi Lars,
I thought you were going to drop mobGui?
It's great for getting started but most of your posts keep showing it's short comings.
Building your own tabs is easy and allows you all the flexibility of any other control. Also you'll get more responses to your questions because most people answering question here don't use mobGui.
OK, it probably is possible to change the highlight state of your tabs in mobGui. I just don't know it, I do for tab buttons. :D

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sat Apr 27, 2013 11:25 pm

Yes, maybe I should drop it, but I don't know to handle the different proportion between such as iPhone 4 and iPhone 5 (if I would use an automatic resize script for that).

mobGUI is a very nice tool, which helps me a lot, but I think you're right, the next App I should build without mobGUI.

But how can I handle this problem (proportion)?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sat Apr 27, 2013 11:34 pm

Here:
http://forums.runrev.com/phpBB2/viewtop ... =8&t=14859
For more advanced stuff check out the bottom of the page.

Simon :D
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sat Apr 27, 2013 11:59 pm

I know this thread, but it says explicit "This scales proportionally i.e. If you have a square object and do not scale proportionally it won't be square anymore."


And that's the problem. A square should be a square on an iPhone 5, too. Do you know, what I mean?

Or think about an iPad. It would be terribly just to scale it up and don't use the more given space on the screen.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sun Apr 28, 2013 1:06 am

Scaling just 1 object is easy.
Just take apart the code.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sun Apr 28, 2013 2:03 am

Also, when I said square I meant square not rectangle. A rectangle will fill up the new space easily.

With that code iPhone and iPhone retina are fine because retina is 2X, so a square would remain a square. For IPad you just use the same code again setting your minimum size to 1024 x 768, make sure everything looks nice and hit the button. Use "the working effective screenRect" in the "on resizeStack" with an if/then or switch case to set up for the correct device.

I'm not sure mobGui will keep a square square for iPhone and iPad.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sun Apr 28, 2013 12:31 pm

Again: My problem is the different screen-dimension between such us iPhone 4 and iPhone 5 - they are not proportional.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sun Apr 28, 2013 7:56 pm

Hi Lars,
Did you know that the largest square you can draw on an iPhone 4 equals the largest square you can draw on an iPhone 5? (640 X 640)
I know it's crazy! :D
So you will have dead space on an iPhone 5 no matter how you size it.
Are you really talking about a square?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sun Apr 28, 2013 8:02 pm

I'm talking about the free space vertical on iPhone 5 (compared to iPhone 4).

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sun Apr 28, 2013 8:08 pm

If it's a square then nothing will fill it. Or your tabs (and other controls) will become long and narrow.
How does mobGui handle it?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sun Apr 28, 2013 8:33 pm

In mobGUI you just select the device, like iPhone 4, set everything to the right place, select iPhone 5 and set the changes you want on your screen (such as to use the "more" space). That's it :)

It is really great, but it needs an update. iPad retina is missing and all Android-Devices have to set up manually. Every time you change something. That's bad. It needs a drop-down for every screen-resulution.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: How to highlight a TabBar Button manually?

Post by Simon » Sun Apr 28, 2013 8:57 pm

Ah, you set every resolution manually.
You should still give the script a try (not with the mobGui scripts in place) just to see what it does. If you have a text field that fills the bottom of the screen it will automatically resize to fit available screen space.

Maybe I'll write a script that allows manual setting of resolutions, but I'll never get "all" the Android resolutions. Way too many of them and more each day.

There is that splash21 way of doing it, thought it was very clever, using a "letterbox".
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: How to highlight a TabBar Button manually?

Post by DevBoyLars » Sun Apr 28, 2013 9:06 pm

Yes, you can try mobGUI for free on the website:

http://mobgui.com/download.php

I tried the script, but there are some missing things, which mobGUI can do: Such as plattform-spacific controls, etc.

Post Reply

Return to “MobGUI”