Ruler Gadget - Beta 1 sourcecode library

Share your advanced PureBasic knowledge/code with the community.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Studying the code a little, hats off there maestro. That's a novel way of doing things.

8)
I may look like a mule, but I'm not a complete ass.
Clutch
User
User
Posts: 52
Joined: Sun Nov 26, 2006 6:11 am
Location: South Florida

Post by Clutch »

:shock: Very nice! Awesome job, net'.
"Ahead one third... ahead two thirds... Full ahead flank
And out from the belly of the whale came a prophet, Amen"
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Fantastic bit of code, perhaps it should get included in a future update, 4.5 or something.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Thanks for the kind words everyone. As I see it there are three main tasks left:

1) Implement a system of setting/clearing tabstops

2) Implement routines for setting/retrieving the various states of the gadget

3) Implement optional logical measurement units

Task #1 is the next on the list, I'm considering a couple different approaches. Anyone have ideas on a good way to proceed?
Last edited by netmaestro on Fri Apr 13, 2007 6:38 pm, edited 1 time in total.
BERESHEIT
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Really neat :) Thank You
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Nice code!
Even i never understood the meaning of that in MS Word. (I use Openoffice 2.1)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Very nice code.
These neat little features should be included in a community project like PBOSL. :wink:
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Update Tuesday April 10: added full tabstop functionality, new code is in the first post. Please try to find bugs, it's appreciated.

We're getting there!
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Added more compatibility to the tabstops & sliders, now they draw the indicator lines on creation and upon being clicked. (they used to wait for being moved) Code in first post.

Also, the tabs are lined up to the background a bit better, although if a tab is sitting right on a number it can look a bit ugly, which I imagine can't be helped.
BERESHEIT
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

How about delete the iTab.bmp file before ending?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Sorry that was in there just for debugging purposes, I'll take it out now. Thanks for pointing it out!
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Excellent.

Noticed that the tabs, whilst being dragged, can move vertically. A bug? :)
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Thanks!

The vertical tab movement isn't a bug, it was intentional so someone could drag the tabs off the bar upwards if they want, but after some reflection and working with it, I don't like it either so I'll probably take it out.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Update:

- The tabs don't drag up anymore

I've never been happy with how hard it was to click an existing tab, with that clipping region applied there were only two pixels width- and height-wise you could click for the tabstop to receive the WM_LBUTTONDOWN message. I initially experimented with different shapes for the tabs with thicker "black parts" but they were ugly. So today I've implemented a small routine in the BaseProc procedure to test if a WM_LBUTTONDOWN it gets is actually inside the full windowrect of an existing tab. If it is, it sends the message on to the tab and doesn't process further. So - just a bit of explanation for the second improvement for this morning, which is:

- It's now much easier to select an existing tabstop!
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

New update for Wednesday Apr 11, details and code in first post.
BERESHEIT
Post Reply