Just Wondering

| | Comments (28)

There are some items within REALbasic which have always made me go "hmmm..." Sometimes it's a programming practice which I see people attempt. Other times it's an API or a control which people use. So I figure I'll ask and see what response I get back from the small selection I have captivated. :-P

  • Who uses the Line control and why? I just fixed a bug with it today having to do with x2 and y2 changing when you move the control or resize it (the problem was that we'd update x1, x2, y1 and y2 properly for width and height, but not left and top -- forgot that you need to change x2 and y2 when left and top are modified, otherwise you're monkeying with endpoints), and as I was closing reports, I noticed that there were a large number of reporters (strewn across about 15 separate reports, sadly) -- much larger than I'd have expected. What do you use a line control for? Why not a Canvas? Or a Separator? Repeat this question for Rectangle, Oval and RoundRectangle.
  • Honestly now... who thinks a TabPanel inside of a TabPanel is a great idea? Yes, I realize a page/tab panel combination has legit uses -- but I usually hear people refer to TabPanel inside of TabPanel first when talking about the issue. Is it just easier to say, or are people honestly attempting that abomination?
  • Every once in a while, I see people stick non-control objects onto a window, such as a FolderItem. What, praytell, is that supposed to do? What purpose does it serve?
  • Are you using the pasteboard to stick all non-visible controls onto the design (such as threads, sockets, etc)? Or are you putting them on the window itself? If it's on the window itself, why do you put it there and not on the pasteboard (habit? Or some other reason?)? I must admit that I use the pasteboard extensively -- since I do a lot of networking, serial, thread, etc programming, it's blissful to not have that stuff cluttering up my UI. In fact, I'd like to see the default double-click-to-add-a-control behavior change to sticking non-visible items onto the pasteboard instead of the window someday.
  • Has anyone ever used the Deselect All menu command? How about Window->Minimize and Maximize?
  • Why do I see code snippets from people that say GetFolderItem( "" ).Child( "Something" ) instead of just GetFolderItem( "Something" )?
  • Do people customize their toolbars in the IDE? Add new items, remove items, set it to a different view, etc? I know I've done it -- I'm just curious if others have as well.
  • How much do you use exceptions and exception handling in your own code? For instance, when I write RB code, I'll usually make new subclasses of RuntimeException and fire those off in the case of drastic errors. Do other people do this as well? If not -- why don't you?

I'm sure there are others that'll pop into my mind, but this is a pretty good list to drill people with.

28 Comments

1) I don't, and I have no idea who one would use it either...

2) I've never needed a tabpanel in a tabpanel, but I have needed a tabpanel in a pagepanel. I guess what people are getting at is that there is no logical reason who it shouldn't work. Heck, I *should* be able to put a tabpanel in a tabpanel in a pagepanel if I want to (not a good idea, but it should work, no?).

3) I've done it a couple of times (mainly with custom toolbar classes). The idea here is that I can create events inside the class and then put code in them on the window - something I can't do if the item were a property.

4) I put them on the window out of habit (hey, that's how I've done it since RB 1!)

5) Nope, nope, nope. But they're part of a good GUI!

6) No clue. Ignorance? Maybe that should go in the tips feature.

7) I've customized it, but oftentimes with the betas the preferences got nuked - so I got used to the default. I still keep the buttons small and without labels, though.

8) I've learned to love exceptions. I don't go overboard, but I do create custom ones as needed.

Pasteboard? That's the first time I've ever heard that word used in relation to REALbasic and it's obviously not being used how it is in Cocoa. Are you calling "global space" the pasteboard? o_O

Line control: once or twice, I think.
Nested TabPanels: Very bad UI, but that's not a good reason not to support it.
Non-controls on windows: If I ever did, it was by accident.
Pasteboard: I constantly use the pasteboard. It's one of my favorite things about the IDE these days. Makes UI design so much cleaner and easier.
Deselect All: Didn't even realize it was there.
GetFolderItem("").Child: It was probably someone's example long ago, and it stuck. That's my guess.
Customize toolbar: Oh, yeah. That's the first thing I did. I still putz with it, trying to get it "juuuuust right." :)
Exception Handling: Not enough.

Damn, but I like metal windows with tab-panels inside of tab-panels. It adds as a certain something.

I wonder how many times I can re-iterate a tab-panel inside of a tab-panel though?

1) I use the Line control as a separator in a window when necessary. I've also used Ovals to display colors in my Colorspace application.

2) A TabPanel inside of a TabPanel is a weird idea.

3) I do use the pasteboard for non-visible controls, but I'm not 100% happy with it. Sometimes when I duplicate controls, they are created off in some remote area of the pasteboard that I can't scroll to!

4) Deselect All? Only when I accidently Select All.

5) I dunno. For the same reason people ask my name when I'm wearing a name tag?

6) I always customize my toolbars in the IDE.

7) I use exceptions and exception handling whenever possible, but I don't subclass exceptions as much as I should.

1) i tried using it once, but if i rember correctly, it was a pia (possibly due to the bugs you just fixed), so i just used a canvas.

2) i think it's a bad idea from a design standpoint, but it should theoretically work, right?

3) technically a timer is not a control, right? if that's true, then afaik, the only way to use a timer is by placing it on a window.

4) i LOVE the pasteboard. i was absolutely overjoyed to be to move all my non gui controls out of the way. soooo much easier to keep things organized.

5) never deselect all or window -> maximize, but i use the keyboard shortcut for window -> minimize all the time (on a mac)

6) confusion?

7) yep. i still don't know why bindings are there by default (i would like to mention that i think the gui for bindings took a large step back with 2k5+. i miss being able to drag and drop bindings)

8) not nearly enough. i just used them for the first time last week. i don't think i've completely wrapped my brain around them yet, though…

Clarification about Tabs within Tabs: yes, it certainly is technically possible to accomplish, and hence, should be possible for you to do. Now, let's say it takes X days to implement a random highly-requested feature and X * Y days to "fix" tab panels inside of tab panels. Which should be worked on and why? Note: that was rhetorical. :-P

But FWIW, my limited understanding of the issue is that once one is fixed (pages inside of pages, for instance), then all are fixed. So it's a moot rhetorical question.

If it weren't for that pesky backwards compatibility thing, I'd love it if new projects could move all non-visible controls onto the pasteboard. That'd make me happiest -- my feelings are that my old projects only have that stuff on the window because that's the only place it could go. So move it where it belongs for me!

@Seth -- didn't catch this post then, eh?

I'm not certain how the docs refer to it, but that's what it is and what I've always heard it called.

1. Used it once or twice as a separator. Didn't use a canvas because it was easier to use a line.

2. I never used but I already saw some software products using TabPanels inside TabPanels panels in a way that didn't shock me. What I consider an abomination is RB not supporting it ;)

3. ???

4. Yes, I use the pasteboard

5. Never used any of them.

6. ???

7. Yes, I customized the toolbars in the IDE.

8. Used it a few times but never subclassed them...

Now, let’s say it takes X days to implement a random highly-requested feature and X * Y days to “fix” tab panels inside of tab panels. Which should be worked on and why? Note: that was rhetorical. :-P

I have a dream, and that is... to see RS FIX ALL THE BUGS FIRST and ONLY THEN implement new features ;-)

Why? Because that's the way to go in my opinion! I can wait 6 (or more) months for new features IF the current bugs are fixed first!

Except for Intel support, right? Or was the Universal Binaries? :: grins ::

I develop for Windows only... and never used a MAC ;-)

1.) I don't use it

2.) Butchering UI is such a fun thing though...

5.) I think I've used deselect all, and under OS X command-m triggers the Window->Minimize eh?

7.) I hide everything but the editor toolbar.

8.) I usually go that the exception subclass route for drastic errors. Also I usually don't include any error checking code (that is, stuff like checking if a folderitem is nil before using it) -- I'd much rather have the bug thrown out in my face earlier than silently failing.

1. I used the line control once in 2005r1 and it was so difficult to control within a ContainerControl that I gave up. I was wanting to use it like a separator but with more control over how it was positioned, but I think that I just used a RectangleControl with a different colored border instead. I use RectangleControls more frequently than some controls, but it is mostly to add a solid color.

2. I have never done it, but I have seen it occasionally (which I dislike) and well, you know, monkey-see-monkey-do-do.

3. FolderItem? No idea... occasionally I will design a new class to be more generic so that I could drag it to the window and not have to create a true subclass. But it would be silly to drag a class without events to the window.

4. Timers, Threads, Sockets, and the occasional generic class get dragged to the pasteboard like good little non-visible controls.

5. Deselect all? What is that? I usually just click with the mouse outside the selection area. I will occasionally use the Minimize shortcut, but more often I use OS X "Hide" command (but I am very annoyed with Adobe for not following the "Hide" standard... like they can't deal with the rejection... nah nah nah... you can't hide me without using your stupid mouse).

6. Someone around longer than I did it in the examples and newbies don't know there is something better? You have to admit that there are a lot of things that only experience can teach... and in reality this issue is only a performance issue and nothing is technically wrong with it (except for the *rare* case of Nil).

7. Sometimes.

8. I am exceptionally empty in experience entertaining exceptions.

I use linecontrol in a music training program. Thank you for fixing it, it has been a very frustrating problem.

15 reports, you missed one: jywfekkh

:-)

Arne

@Phil "I used the line control once in 2005r1 and it was so difficult to control within a ContainerControl that I gave up"

I had exactly the same problem.

Arne

1) Never ued the line control nor Rectangle, Oval or RoundRectangle. I think I used some Line controls in VB once, years ago. Can't remember why.

2) Never tried a TabPanel inside of a TabPanel, though I suspect I do a lot more positioning, hiding and showing of controls in code than is strictly sensible.

3) I tried sticking a FolderItem on the pasteboard the other day to make sure I wasn't missing anything. Looked inside it, deleted it. Wouldn't do it for real.

4) I use the pasteboard for anything that's not going to be visible on the window. This includes the index(0) controls for cloned controls unless they're physically visible at the first Window.Show.

5) I suspect there's lots of menu commands I've never used - those are 3 of them

6) that stupid GetFolderItem( “” ).Child( “Something” ) construct is in the LR somewhere

7) I always add the add/list bindings to the layout editor toolbar but hardly ever use them. I say "always" because I've had to trash my preferences a few times lately.

8) I use try/catch all the time. The catches start out very q&d. I usually create runTimeException subclasses at final clean-up of code (when it's way too late) It's only the last couple of days I've been giving them .Create methods though ;) Tidies things up a lot.

7) I also change the toolbar to small buttons with labels

If there's a Select All menu item, there should always be a Deselect All item. Programs with one but not the other piss me off. (Remember, some of the things you select could be underneath other things, or out of the window bounds, or invisible in some other way.)

Not that I've used RB anytime recently (years ago when you still had the old icon I tried it out, stumbled over all those timers in the window'n stuff...), but in my drawing apps I often use "Deselect all" when I have a huge background picture covering the whole page. In that case there's usually no way to unselect everything by clicking, because there's no space on the page where there isn't an item.

Unless RB has another obvious way to unselect stuff in that situation (clicking the background to unselect everything but it, then shift-clicking to unselect doesn't really count) I wouldn't get rid of that menu item, though I personally wouldn't need a keyboard shortcut on it.

In my opinion, any program that has a "Select All" menu should have an "Invert Selection" menu.
Much more useful.

Pasteboard is truly out of sight, out of mind. Neither the Language Reference or REALBasic Tutorial search return anything for 'pasteboard'

Every once in a while, I see people stick non-control objects onto a window, such as a FolderItem. What, praytell, is that supposed to do? What purpose does it serve?
-------------------

You're kidding, I hope -- this is an extremely useful device, though dropping a FolderItem is probably not the best use of it.

@Charles -- no, seriously, what possible use is it? The only thing I can think of is automatic instansiation, but that seems awfully dangerous. Anything with a constructor is obviously out.

Why do I see code snippets from people that say GetFolderItem( “” ).Child( “Something” ) instead of just GetFolderItem( “Something” )?
-------

Because it makes sense in the context of the interface. GetFolderItem needs to be deprecated in favor of a function like AppDirectory. Then RS should get rid of the overloading of string parameters via a second parameter in favor of one of

distinct functions like GetFolderItemFromPath

FolderItem subclasses like PathFolderItem that one might use in code like

dim f as FolderItem = new PathFolderItem("/users/foo/textFile").

I put exception handling in nearly every function and tie it into a bug handling routine that can email the results to tech support. It gives the user something to report other than, "It don't work." Very handy in tracking down an obscure bug from end users.

I don't generally create my exceptions but I could see that being useful if you're using a LOT of classes. Getting to like the Try/Catch more and more!

Leave a comment

Disclaimer

I'm currently an employee of REAL Software. My blog is mine. The opinions represented in this blog are mine as well and may not represent my employer's opinions. All original material is copyrighted and property of the author.

REALbasic® is a registered trademark of REAL Software, Inc. REAL SQL Server™ and Lingua™ are pending trademarks of REAL Software, Inc. All rights reserved.