|
Renegade
|
 |
« on: September 27, 2006, 11:28:46 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 RulerJust 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
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #1 on: September 27, 2006, 11:35:42 AM » |
|
can we get a screenshot? (just attach it to post)
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #2 on: September 27, 2006, 12:23:25 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.  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:00 PM by app103 »
|
Logged
|
|
|
|
|
|
Renegade
|
 |
« Reply #3 on: September 27, 2006, 05:29:35 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!
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #4 on: September 28, 2006, 12:47:46 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)
|
|
|
|
|
Logged
|
|
|
|
|
Renegade
|
 |
« Reply #5 on: September 28, 2006, 03:54:47 AM » |
|
That's strange... You're clicking and dragging from the "form" part? (red circle below)  The code for dragging is: Formatted for C# with the GeSHI Syntax Highlighter [ copy or print] private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; protected override void WndProc(ref Message m) { if(m.Msg == WM_NCHITTEST) { m .Result = new IntPtr (HTCAPTION ); } else { base.WndProc(ref m); } }
Not sure why that wouldn't work for you... I've only tested it on 2 machines, but didn't have any wierdness.
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #6 on: September 28, 2006, 04:17:52 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: 
|
|
|
|
« Last Edit: September 28, 2006, 04:24:12 AM by app103 »
|
Logged
|
|
|
|
|
cranioscopical
|
 |
« Reply #7 on: September 28, 2006, 04:37:43 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).
|
|
|
|
|
Logged
|
Chris
|
|
|
|
app103
|
 |
« Reply #8 on: September 28, 2006, 04:46:16 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.
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #9 on: September 28, 2006, 04:54:52 AM » |
|
If it means anything, I am running XP Home and classic theme (not XP theme)
|
|
|
|
|
Logged
|
|
|
|
|
Renegade
|
 |
« Reply #10 on: September 28, 2006, 02:56:01 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
|
|
|
|
|
Logged
|
|
|
|
|
Renegade
|
 |
« Reply #11 on: September 30, 2006, 10:45:39 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 RulerCheers, Ryan
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #12 on: September 30, 2006, 06:22:58 PM » |
|
that's pretty cool 
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #13 on: September 30, 2006, 06:52:02 PM » |
|
ooooh...I like this! Like it very much!  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. Screen Loupe 2000
|
|
|
|
« Last Edit: September 30, 2006, 07:09:53 PM by app103 »
|
Logged
|
|
|
|
|
Renegade
|
 |
« Reply #14 on: September 30, 2006, 09:09:20 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
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #15 on: September 30, 2006, 10:32:49 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. 
|
|
|
|
|
Logged
|
|
|
|
|
Renegade
|
 |
« Reply #16 on: October 01, 2006, 02:38:25 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.  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
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #17 on: October 01, 2006, 04:31:38 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: Formatted for Delphi with the GeSHI Syntax Highlighter [ copy or print] procedure TForm1.FormCreate(Sender: TObject); begin SetWindowLong( Handle, GWL_STYLE, GetWindowLong( Handle, GWL_STYLE ) and not WS_CAPTION ) ; ClientHeight := Height; end;
form properties & settings: Formatted for Delphi with the GeSHI Syntax Highlighter [ copy or print] object Form1: TForm1 Left = 210 Top = 157 HorzScrollBar.Visible = False VertScrollBar.Visible = False BorderStyle = bsNone BorderWidth = 1 ClientHeight = 449 ClientWidth = 681 Color = clBtnFace TransparentColor = True TransparentColorValue = clLime Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] FormStyle = fsStayOnTop OldCreateOrder = False OnCreate = FormCreate DesignSize = ( 681 449) PixelsPerInch = 96 TextHeight = 13 object Panel1: TPanel Left = 0 Top = 0 Width = 681 Height = 449 Anchors = [akLeft, akTop, akRight, akBottom] BevelInner = bvLowered BevelOuter = bvLowered Color = clLime TabOrder = 0 object Panel2: TPanel Left = 1 Top = 1 Width = 185 Height = 41 BevelInner = bvRaised Caption = 'drag me' TabOrder = 0 OnMouseDown = Panel2MouseDown object Button1: TButton Left = 152 Top = 8 Width = 27 Height = 25 Caption = 'X' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False TabOrder = 0 OnClick = Button1Click end end end end
Form code: Formatted for Delphi with the GeSHI Syntax Highlighter [ copy or print] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Panel1: TPanel; Panel2: TPanel; Button1: TButton; procedure Panel2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } procedure WMNCHitTest(var Msg: TWMNCHitTest); message wm_NCHitTest; public { Public declarations } procedure CreateParams(var Params: TCreateParams); override; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); Params.Style := (Params.Style or WS_THICKFRAME); end; procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest); begin inherited; if Msg.Result = htClient then Msg.Result := htCaption; end; procedure TForm1.Panel2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ReleaseCapture; SendMessage(Form1.Handle, WM_SYSCOMMAND, 61458, 0); end; procedure TForm1.FormCreate(Sender: TObject); begin //prevents flickering when resizing Form1.DoubleBuffered := true; Panel1.DoubleBuffered := true; Panel2.DoubleBuffered := true; end; procedure TForm1.Button1Click(Sender: TObject); begin Application.Terminate; end; 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.
|
|
|
|
Logged
|
|
|
|
|
cranioscopical
|
 |
« Reply #18 on: October 01, 2006, 08:48:59 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 
|
|
|
|
|
Logged
|
Chris
|
|
|
|
Renegade
|
 |
« Reply #19 on: May 23, 2010, 10:36:12 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
|
|
|
|
|
Logged
|
|
|
|
|
app103
|
 |
« Reply #20 on: May 23, 2010, 10:40:22 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. 
|
|
|
|
|
Logged
|
|
|
|
|
cranioscopical
|
 |
« Reply #21 on: May 23, 2010, 11:25:44 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)
|
|
|
|
|
Logged
|
Chris
|
|
|
|