Page 3 of 4

Posted: Fri Apr 13, 2007 6:52 am
by netmaestro
Finished the gadget, details in first post. It's actually usable now. I think there's something wrong in Tailbite as it compiles the lib fine but generates an IMA in ExamineTabStops() at runtime. The code in that proc is simple and clean and runs perfectly compiled with PureBasic.

I appreciate anyone testing the gadget and reporting anything it does that doesn't seem right, any and all reports are welcome.

Posted: Fri Apr 13, 2007 11:58 am
by byo
That's very cool.
Any chance of seeing that as a Userlib? :D

Posted: Fri Apr 13, 2007 12:17 pm
by techjunkie
Wow! I'm going to have a wet dream about this gadget tonight! :lol: Great work!!

Posted: Fri Apr 13, 2007 6:05 pm
by netmaestro
I must confess that an increase in laundry bills was not anticipated as a side effect of using this. For a temporary workaround, you could consider printing out a screenshot of the gadget and pasting it to your wife's forehead. At least until a proper fix is implemented.

Posted: Fri Apr 13, 2007 7:35 pm
by srod
@netmaestro, move the 'Static Newlist' command to the init procedure and it then works fine with Tailbite.

Code: Select all

ProcedureDLL RulerGadget_Init()
  Global NewList tabs() 
EndProcedure
Actually, simply replacing Static by Global in the NewList() seems to work, and without using the _init procedure. :)

Posted: Fri Apr 13, 2007 7:56 pm
by netmaestro
Thanks a million srod! You saved me a lot of time. I'd traced the error to the static list and was going to replace it with a self-managed block of allocated memory, which would have taken some fiddly coding. I'd like to avoid globals in libs if possible, it's not a problem for the compiled lib but for .pbi files it's important not to use globals and name them something basic like tabs() as it might conflict with something else a coder is doing. One alternative is to use two sources, one to compile with Tailbite and one to use as .pbi, but that gets to be a pain pretty quick. I compromised by keeping the codebases identical and changing the name of the list to RG_gTabs().

New download available: Library installer, details in first post.

@byo: yup.

Posted: Sat Apr 14, 2007 12:33 am
by srod
You could define a constant and then use some compiler directives within the underlying procedure:

Code: Select all

;#RulerGadget_StaticLib = 1 ;Uncomment if compiling a static lib.

Code: Select all

CompilerIf Defined(RulerGadget_StaticLib, #PB_Constant)
  Global NewList Tabs()
CompilerElse
  Static NewList Tabs()
CompilerEndIf

Posted: Sat Apr 14, 2007 5:06 am
by netmaestro
Performance update, no new features but the drawing routine for the tabstops is retooled with the following problems fixed:

- If you moved a tabstop under a slider and held it there, the slider would flicker intermittently

- If you dropped several tabstops on top of each other under a slider, they would overwrite the rightmost 2 pixels of the slider, leaving an ugly effect that would stay until the slider was moved

- The tabstops could be dragged downwards, this was to allow them to be removed by dragging off the gadget. This has been changed so that they don't move down at all but will be removed if the mouse pointer goes below a certain distance under the gadget. This is exactly the behavior of Microsoft's (inferior) version, and after much experimentation, I like it better.

- All discernible flicker has now been removed with this update, here at least

Both posted code and library installer are updated with the improvements

Posted: Sun Apr 15, 2007 7:13 am
by netmaestro
Significant update today, the ruler now generates events for everything that happens on it. Details in first post. Sorry for the lack of a helpfile, but you should find your way easily if you study the eventloop of the example program.

Posted: Sun Apr 15, 2007 4:20 pm
by rsts
Little did I know what it would involve -

netmaestro, you've outdone yourself.

Magnifico.

(and many thanks)

Posted: Sun Apr 15, 2007 4:34 pm
by netmaestro
You're most welcome :wink:
Little did I know what it would involve -
Me too! I went into it with the idea that it's little more than an ownerdrawn scrollbar with a couple extras added on, now a week and 800 lines of code later I'm still not finished! I'm doing RulerUndo(#actions) today, then a help file and it really should be done. I actually held off a couple of days before starting it because I figured there was a good chance a) something off-the-shelf was around, or b) your fellow Buckeye would take up the cause. But I guess he's snoozing in front of old WKRP reruns or something... :lol:

Posted: Sun Apr 15, 2007 5:21 pm
by rsts
netmaestro wrote: snip b) your fellow Buckeye would take up the cause. But I guess he's snoozing in front of old WKRP reruns or something... :lol:
ROF :lol: - he probably had a better idea what would be involved :wink:

I figured between the two of you something would be made. But I actually expected something based off a control and API's. I had no idea it would be quite this involved or I would have felt too guilty to ask :oops:

This is 'legacy' code - and I don't mean that in the mainframe sense.

cheers

Posted: Sat Jun 02, 2007 4:16 am
by netmaestro
Compiled version of the library for PureBasic 4.10 available, link added to first post

Compiled version for 4.02 is still there too for now until 4.10 goes release.

Posted: Sat Dec 15, 2007 11:38 pm
by QuimV
@netmaestro
Could you update the installer in firt link?
It gives to me several errors and don't install anything.
Thans in advanced.

Posted: Sat Dec 15, 2007 11:44 pm
by netmaestro
Sorry, should work now. If you're using PB v4.10 you should use the link from June 1. For 4.02 the first link should be fine. It works as an Include file too, the posted code does.