topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 7:14 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: New App - Floating Ruler - Feedback?  (Read 35100 times)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
New App - Floating Ruler - Feedback?
« on: September 27, 2006, 11:28 AM »
So I'm finally fed up with messing around with dumb ways to do things, so I wrote a stupid little application today to give me a simple on-screen ruler to measure alignments in other programs. (e.g. Visual Studio, Photoshop, appTranslator [the real motivation], etc.)

It's a .NET v1.1 app, so you'd need that installed. (Decided not to go with v2.0 but I'll do that later.)

Anyways, I'm looking for feedback. Please be brutal. But keep in mind what it is supposed to be used for...

I know it sucks a bit right now, but it does what I need it to do for now. i.e. Let me visually align things on-screen.

It's kind of like guidelines in Photoshop, but for any program.

Here's the download:

Floating Ruler

Just as a silly aside, the app is 72kb, but the zip is 212kb and 428kb unzipped. i.e. Bloated installer. But it works...

Cheers,

Ryan

Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #1 on: September 27, 2006, 11:35 AM »
can we get a screenshot? (just attach it to post)

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #2 on: September 27, 2006, 12:23 PM »
If I can get used to using this one it might be better than the pixel rulers I currently use. It's much more precise.

I like how you can set the thickness of the rulers...and the color.

It would be nice if there was a way to drag the control window instead of having to set the position with the controls. Or maybe make the control window not attached to the rulers and able to be dragged.

And I noticed it doesn't play well with Snagit. It disappears when I try to do a screenshot with the floating ruler in it.

floating ruler.png

It would also be nice if there was an additional setting so you could set a point to be considered 0-0 rather than it using the screen's 0-0 x-y coordinates. Measuring position in a browser window for setting CSS positions would be much easier if the 0-0 was relative to the space within a browser window rather than the screen.
« Last Edit: September 27, 2006, 12:34 PM by app103 »

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #3 on: September 27, 2006, 05:29 PM »
You should be able to just click on the form and drag it instead of using the number controls. I have no idea if it would work on Windows 98 though...

I'll see what I can do to add in a secondary measurement for browsers. That would be useful.

Thanks for the feedback!
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #4 on: September 28, 2006, 12:47 AM »
I tested it on XP and I can't drag the window at all.

I have not tested it on my WinME machine yet. (royal pain in the butt to download things with that one's 33.6k dialup)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #5 on: September 28, 2006, 03:54 AM »
That's strange... You're clicking and dragging from the "form" part? (red circle below)



The code for dragging is:

Code: C# [Select]
  1. private const int WM_NCHITTEST = 0x84;
  2. private const int HTCLIENT = 0x1;
  3. private const int HTCAPTION = 0x2;
  4. protected override void WndProc(ref Message m)
  5. {
  6.         if(m.Msg == WM_NCHITTEST)
  7.         {
  8.                 m.Result = new IntPtr(HTCAPTION);
  9.         }
  10.         else
  11.         {
  12.                 base.WndProc(ref m);
  13.         }
  14. }

Not sure why that wouldn't work for you... I've only tested it on 2 machines, but didn't have any wierdness.

Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #6 on: September 28, 2006, 04:17 AM »
That's exactly where I tried it...doesn't move.

And that section is "transparent" and I can click through it as if it's not there.

Not like it is in your screenshot.

This is a screenshot of it over my browser window. I can actually click my browser's refresh button right through the floating ruler form:

floating ruler2.png

« Last Edit: September 28, 2006, 04:24 AM by app103 »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #7 on: September 28, 2006, 04:37 AM »
FWIW dragging works on XP here (Pro,SP2,ATI Radeon).

It would be nice to have some sort of accelerater to extend the ruler lines rapidly (3200x1200 desktop).

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #8 on: September 28, 2006, 04:46 AM »
It would be nice to have some sort of accelerater to extend the ruler lines rapidly (3200x1200 desktop).

Type a number in the box and hit enter.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #9 on: September 28, 2006, 04:54 AM »
If it means anything, I am running XP Home and classic theme (not XP theme)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #10 on: September 28, 2006, 02:56 PM »
Ah... Ok... I think I know why that is... I think you have your ContolLight and Control set to the same color somehow. I used Windows theme control colors to accomodate themes. I'll go back and change the transparent color to mauve.

And I'll add in a maximize as well. That will require that I add in something to move the lines as well, but I should be able to get that done this weekend.

Cheers,

Ryan
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #11 on: September 30, 2006, 10:45 AM »
...
It would be nice to have some sort of accelerater to extend the ruler lines rapidly (3200x1200 desktop).

I hear, and obey...

You can now maximize it, but will still need to work manually for dual monitors.

Here's a screen shot:



I've also upgraded a lot of the stuff there.

The options icon is a place holder for now.

There is a set of axis controls now as well. and they make it MUCH easier to use now. You can still control things with the fine-grained control as before though.

You're also alerted to the absolute and relative positions of the crosshairs in the titlebar. Yadda yadda.

Hope it's useful for people. I'll release it later on when I have time. Right now, you can download it here:

Floating Ruler

Cheers,

Ryan
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #12 on: September 30, 2006, 06:22 PM »
that's pretty cool  :Thmbsup:

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #13 on: September 30, 2006, 06:52 PM »
ooooh...I like this!
Like it very much!  :Thmbsup:

I paid for this proggie a long time ago and little by little replaced everything I use it for with other software that does it better. Your floating ruler replaces just one more part of it.

loupe.pngNew App - Floating Ruler - Feedback?
Screen Loupe 2000
« Last Edit: September 30, 2006, 07:09 PM by app103 »

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #14 on: September 30, 2006, 09:09 PM »
app103,

Thank-you again!

There are some things in there that I was planning to add into it but was just lazy: A real absolute pixel ruler where the other sliders are now (additionally), a pin, a magnifier, saving settings to load on the next run, and some options to control behaviour. No plans for any screen capture as Screen Captor is already very good and I don't see what purpose that serves for a ruler.

I did find something wierd in .NET v1.1 though while making it. With a transparent form, if you maximize it, then restore it, you end up with a "screen shot" starting from 0,0 in the restored region, which stays there. I couldn't figure out how to work around that so I ended up using a form border. A bit lame, but it works.

However, I need to get back to 2 other projects at the moment. Maybe my ADHD will kick in though and I'll get distracted though.  ;)

Cheers,

Ryan
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #15 on: September 30, 2006, 10:32 PM »
I couldn't figure out how to work around that so I ended up using a form border. A bit lame, but it works.

I like the form border...a lot. Keep it in there. It's like having an extra set of guide lines. Can you make resizing possible by dragging the border?

Is there any way you can have normal controls on the titlebar? I'd like to be able to use FileBox Extender's extra buttons when needed, but without the min-max/restore-close on the titlebar I don't think I can. I can't access a menu when right clicking the taskbar button either, for toggling FileBox Extender's always on top or roll up options.

It would still be nice if it were 2 forms, one for the rulers, and one for the settings...that way you can move the settings panel out of your way and work in the upper portion of the screen if you need to. Right now you can't without entering negative numbers into the Y pos, which has the potential to cause the undesired effect of not being able to get the settings panel back without ending task on the program and restarting it. Having 2 separate forms would solve that problem. And the extra form for the settings doesn't even need to be always on top like the rulers.

The more I play with this, the more I can see this easily becoming a favorite tool.  :D

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #16 on: October 01, 2006, 02:38 AM »
I like the form border...a lot. Keep it in there. It's like having an extra set of guide lines. Can you make resizing possible by dragging the border?

Not without either changing it to a regular border/title bar, or overridding the base and adding in all that stuff, which is really more than I was prepared to do for it. There's something funny going on with the form and it won't resize properly or expose the resizing arrows. It was something that I just shuffled under the rug.

Is there any way you can have normal controls on the titlebar? I'd like to be able to use FileBox Extender's extra buttons when needed, but without the min-max/restore-close on the titlebar I don't think I can. I can't access a menu when right clicking the taskbar button either, for toggling FileBox Extender's always on top or roll up options.

Same as above.  :(

It would still be nice if it were 2 forms, one for the rulers, and one for the settings...that way you can move the settings panel out of your way and work in the upper portion of the screen if you need to. Right now you can't without entering negative numbers into the Y pos, which has the potential to cause the undesired effect of not being able to get the settings panel back without ending task on the program and restarting it. Having 2 separate forms would solve that problem. And the extra form for the settings doesn't even need to be always on top like the rulers.

I noticed that when I was extending it that I'd done it the wrong way and that it really needed two forms like you've mentioned, but I was quite frankly too lazy to do it right. I'll have to hack it up and redo it or just start from scratch (most likely).

The more I play with this, the more I can see this easily becoming a favorite tool.  :D

Glad to hear that! I won't get to redoing it for a bit, but I'll definitely get back to it in the near future - probably this week. But I'll get the next version done right. (It will be in .NET 2.0 though.)

One thing is certain though - It's pretty hard to get a design flaw past you.  ;)

Cheers,

Ryan
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #17 on: October 01, 2006, 04:31 AM »
I just tried some things in Delphi to see if I could get it to work where it didn't have a titlebar and could be resizable...and at first I couldn't do it either.

The problem I had is that there is no way to get rid of the titlebar unless I set the form's border style to 'none'...which isn't resizable. Only 'sizable' & 'sizable tool window' can be resized by dragging the edge...and they both have titlebars.

Then I remembered a custom form I was working on awhile back...some really flashy looking thing...and remembered I was able to make it resizable. So I looked at how I did it and was able to create a transparent window with a border that was resizable.

The trick here is in procedure TForm1.CreateParams. It overrides the borderstyle of 'none' to give it a border and it's resizable.  ;)

Anything you may have had in your OnCreate procedure that resembled this, won't be needed...just remove or comment it out:

Code: Delphi [Select]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   SetWindowLong( Handle, GWL_STYLE,
  4.     GetWindowLong( Handle, GWL_STYLE )
  5.     and not WS_CAPTION ) ;
  6.   ClientHeight := Height;
  7. end;



form properties & settings:
Spoiler
Code: Delphi [Select]
  1. object Form1: TForm1
  2.   Left = 210
  3.   Top = 157
  4.   HorzScrollBar.Visible = False
  5.   VertScrollBar.Visible = False
  6.   BorderStyle = bsNone
  7.   BorderWidth = 1
  8.   ClientHeight = 449
  9.   ClientWidth = 681
  10.   Color = clBtnFace
  11.   TransparentColor = True
  12.   TransparentColorValue = clLime
  13.   Font.Charset = DEFAULT_CHARSET
  14.   Font.Color = clWindowText
  15.   Font.Height = -11
  16.   Font.Name = 'MS Sans Serif'
  17.   Font.Style = []
  18.   FormStyle = fsStayOnTop
  19.   OldCreateOrder = False
  20.   OnCreate = FormCreate
  21.   DesignSize = (
  22.     681
  23.     449)
  24.   PixelsPerInch = 96
  25.   TextHeight = 13
  26.   object Panel1: TPanel
  27.     Left = 0
  28.     Top = 0
  29.     Width = 681
  30.     Height = 449
  31.     Anchors = [akLeft, akTop, akRight, akBottom]
  32.     BevelInner = bvLowered
  33.     BevelOuter = bvLowered
  34.     Color = clLime
  35.     TabOrder = 0
  36.     object Panel2: TPanel
  37.       Left = 1
  38.       Top = 1
  39.       Width = 185
  40.       Height = 41
  41.       BevelInner = bvRaised
  42.       Caption = 'drag me'
  43.       TabOrder = 0
  44.       OnMouseDown = Panel2MouseDown
  45.       object Button1: TButton
  46.         Left = 152
  47.         Top = 8
  48.         Width = 27
  49.         Height = 25
  50.         Caption = 'X'
  51.         Font.Charset = DEFAULT_CHARSET
  52.         Font.Color = clWindowText
  53.         Font.Height = -11
  54.         Font.Name = 'MS Sans Serif'
  55.         Font.Style = [fsBold]
  56.         ParentFont = False
  57.         TabOrder = 0
  58.         OnClick = Button1Click
  59.       end
  60.     end
  61.   end
  62. end


Form code:
Spoiler
Code: Delphi [Select]
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, ExtCtrls, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Panel1: TPanel;
  12.     Panel2: TPanel;
  13.     Button1: TButton;
  14.     procedure Panel2MouseDown(Sender: TObject; Button: TMouseButton;
  15.       Shift: TShiftState; X, Y: Integer);
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure Button1Click(Sender: TObject);
  18.   private
  19.     { Private declarations }
  20.     procedure WMNCHitTest(var Msg: TWMNCHitTest);
  21.   message wm_NCHitTest;
  22.  
  23.   public
  24.     { Public declarations }
  25.     procedure CreateParams(var Params: TCreateParams); override;
  26.  
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.  
  32. implementation
  33.  
  34. {$R *.dfm}
  35.  
  36. procedure TForm1.CreateParams(var Params: TCreateParams);
  37. begin
  38.   inherited CreateParams(Params);
  39.   Params.Style := (Params.Style or WS_THICKFRAME);
  40. end;
  41.  
  42. procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest);
  43. begin
  44.   inherited;
  45.   if  Msg.Result = htClient then
  46.     Msg.Result := htCaption;
  47. end;
  48.  
  49.  
  50.  
  51. procedure TForm1.Panel2MouseDown(Sender: TObject; Button: TMouseButton;
  52.   Shift: TShiftState; X, Y: Integer);
  53. begin
  54.   ReleaseCapture;
  55.   SendMessage(Form1.Handle, WM_SYSCOMMAND, 61458, 0);
  56. end;
  57.  
  58. procedure TForm1.FormCreate(Sender: TObject);
  59. begin
  60. //prevents flickering when resizing
  61.    Form1.DoubleBuffered := true;
  62.    Panel1.DoubleBuffered := true;
  63.    Panel2.DoubleBuffered := true;
  64. end;
  65.  
  66. procedure TForm1.Button1Click(Sender: TObject);
  67. begin
  68. Application.Terminate;
  69. end;
  70.  
  71. end.


I am not sure if the Delphi code will be any help to you, but I have been told that Delphi & C# are similar enough to be almost considered close cousins.

The full Delphi source and .exe file are attached if you need it or want to try out the form to see how it works.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #18 on: October 01, 2006, 08:48 AM »

I hear, and obey... You can now maximize it, but will still need to work manually for dual monitors.

Thanks very much! 
Judging from the interest, it looks as though your 'little application' will have to become a programming tour de force in order to satisfy all of our requests :)


Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #19 on: May 23, 2010, 10:36 PM »
***BUMP***

I'm currently doing some XSLT work and will need to use the floating ruler I posted here a few years ago.

However, it's really old and there are a few things that I think I'll end up improving/changing to help me out.

Anyways, just curious if anyone has been using it or if they found it useful or if they would find it useful. I know it's been a few years (about 4), so I'd just like to get an idea about whether or not I should bother making the new updates available for others. (This was the only place that I posted it.)

If you found/find/would find it useful, let me know.

Thanks,

Ryan
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #20 on: May 23, 2010, 10:40 PM »
If you found/find/would find it useful, let me know.

YES!  :-*

And if you don't update it some time within the next year, I am going to end up writing my own version.  :P

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #21 on: May 23, 2010, 11:25 PM »
floating ruler
If you found/find/would find it useful, let me know.

Yes, please!

It'd be nice to have:

  • multiple lines
  • the ability to extend the frame by dragging (though I know that was problematic)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #22 on: September 10, 2013, 09:38 PM »
app reminded me of this program here.

This is a .NET 4 (full, not client) build. There is no installer - it's simply unzip & run. There is no new functionality. The only change is an update to .NET 4.

* FloatingRuler-net4.zip (357.56 kB - downloaded 451 times.)

If I can find some time, I'll see about getting some better functionality in there, or maybe just do a rewrite.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker
« Last Edit: September 10, 2013, 10:15 PM by Renegade, Reason: Updated file with transparency bug fix »

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #23 on: September 10, 2013, 09:57 PM »
Thanks!  :Thmbsup:


Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: New App - Floating Ruler - Feedback?
« Reply #24 on: September 10, 2013, 10:17 PM »
^^ I just updated it with a transparency bug fix. Jeez... How many years was that there? Could have been some sort of framework thing as I think I'd have noticed it before. Meh. Fixed now.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker