At 11:59 AM 11/25/2006, you wrote:
> I've been trying to clean up my programming styles (encapsulate,
> code reuse, comment well, be clear about variable names, write
> functions with clear purposes and not make them too long, etc.),
> but it's so frustrating when the development environment forces you
> to write unclear hacky code just to workaround an IDE kink.
Is it a "kink" or a feature?
Right, see below.
> The nice thing about Visual Basic is that even though you have a
> BASIC language thing and interpreted code, you pretty much have a
> completely open-ended system to where, if the IDE restricts you
> from something, you can use the Windows API using Declares or write
> a C++ DLL to do what you want. In this instance, you'd simply send
> a Windows message to the listbox forcing the selection to be made
> early in the CelLClick code. (But Windows/VB draws the selection
> before the event code anyway.)
In that case I would consider that a negative aspect of VB. One would
have to go back and erase the selection if one wanted code to execute
before it is done.
I don't understand what you mean by that.
The difference I see in this case is that 1) VB shows the cell
selected, then executes the code in the "Click" event, 2) RB executes
the code, then shows the cell as selected (highlights it).
That's the defaults. What I was referring to was that in VB, and in
Windows, I can swap the behavior if I wanted to. On RB and Mac, I
(apparently) can't.
On Windows (maybe on RB and VB, but for sure on VB), you can send a
Windows message to the ListBox window to select something, or
deselect something, no matter what VB is doing. VB is nice enough to
allow something else to "mess" with it's functionality. There are
some exceptions (Menus especially), but generally if you play the
game right, you can blend Windows messages and common VB events and
come up with something that works for you.
And you do this within the Cell code itself, not some other place.
Instead of using a Timer, which is a hack, just to avoid RB's
built-in behavior.
At least, in Rb, you have an option to do the built-in routines
yourself, call declares and avoid the IDE's built-
in routines by returning true. To me, the ability to handle all
aspects of the event is one of the nice things in Rb. This is on Mac,
however, as I am not that familiar with how Rb works in Windows in
this instance.
> With RB there isn't that flexability; perhaps it's a Mac problem
> that you don't have these type of events to control objects. VB
> tends to use Windows-standard controls, I don't kow, perhaps RB
> uses their own and they aren't open to the Mac API sections.
As I said above, you have the option of doing everything yourself or
responding after the event.
How do I do that?
>> You can also use properties to set the flow of your code after the
>> event has finished.
>
> What do you mean by that?
Basically setting your own custom property values during the
CellClick event that would then be read in the Timer's Action event
to determine how it should execute. This is because you cannot
*easily* transfer parameters to the timer itself.
Oh, OK.
* * * * * * * * * * * * * * * * * * * * * * * * * * *
| Garth Hjelte |
| Customer Service Representative, President |
| Chicken Systems, Inc, Rubber Chicken Software Co. |
| 714 5th Street SE |
| Willmar, MN 56201 USA |
| |
| 800-8-PRO-EPS Toll Free Order Line (US Only) |
| 320-235-9798 Tech Support, Sampler Questions |
| International Line |
| 360-838-7689 Fax |
| Product Sales: [EMAIL PROTECTED] |
| Product Support: [EMAIL PROTECTED] |
| Sampler Q+A: [EMAIL PROTECTED] |
| Web Page: www.chickensys.com |
* * * * * * * * * * * * * * * * * * * * * * * * * * *
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>