Page 1 of 1

GUI Related Address Bar Question (Implementation)

Posted: Fri Jan 15, 2010 2:55 am
by neato
I have a GUI with an address bar that shows the address of the currently viewed directory. After so many directories deep, the address bar becomes full and I need to think of a cool way to handle it. I don't want to do the Windows thing. Windows allows the address to extend beyond the viewable area of the address bar and only when the address bar is clicked does it reveal the hidden parts of the address. It's a good solution, but it would require some major control over my print procedure (down to the pixel) or some fancy overlay and position shifting. That's a lot of work but I'll do it if I can't come up with a better idea. I like the new Vista Address bar where it collapses the path so you always see the name of the folder you are in, but I am not going to try that because it's way too fancy. I'm looking for a smart but simple solution. So, I was wondering what some of you do. Ideas are welcome. Thanks.

Re: GUI Related Address Bar Question (Implementation)

Posted: Fri Jan 15, 2010 5:13 pm
by Cognition
I'd just got with a tooltip personally.

Re: GUI Related Address Bar Question (Implementation)

Posted: Fri Jan 15, 2010 5:55 pm
by neato
Hi -,

I thought of that but what happens when even the tooltip becomes to large for the screen. Do you suggest I make it more like a BalloonTip where newlines are present? I don't think that would do well either, would kind of defeat the purpose of an Address bar. The reason is because when the <whatever>Tip displays you would see what the address bar does show you, plus what it doesn't. Might as well just have a BalloonTip and no Address bar then. But, I want the functionality of the Address bar, the backwards and forwards progression through History. Thanks for the suggestion though. Any more ideas?

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Jan 16, 2010 2:45 am
by neato
Hi forum,

I decided to just do it the Windows way since everything else is probably too fancy or too redundant to try. The trick is this:

Code: Select all

||------------||
  C:\WINDOWS\system32
Fig A. Any character beneath or beyond (outside the text area) the inner "|"('s) is omitted from print.

The outer "|"('s) represent the outside of the address bar, the inner "|"('s) represent the space between where the first and last characters in the address will begin and end. The space is the key, because it must be the same amount of pixels wide as the amount of pixels used to space each character in a word. Once this is accomplished (the size tuning), you can then write a substr function to make the illusion of the text sliding when the area is clicked or hovered and the text within will never extend beyond those inner boundaries. Takes a bit of fine tuning to get it right, but it works. Hope this helps.

Cogneato, Salut!

Re: GUI Related Address Bar Question (Implementation)

Posted: Tue Jan 19, 2010 2:26 pm
by jal
Personally, I would omit the lead characters, not the final ones, so you can always see the name of the current directory. Also, it is common use to use an ellipsis if you have removed stuff (so "C:\whatever\my..." or "..tever\my long directory name").


JAL

Re: GUI Related Address Bar Question (Implementation)

Posted: Wed Jan 20, 2010 5:30 am
by neato
Hi Jal, the way it works is that you have your address box, and in code you set your limits to it, I set mine the same distance I space characters in a word. Now, when you print the address, it may draw to a limit, this is found through trial and error, because your characters pixels width may vary, as they should. Now, if you keep a count of the pixel width as you draw you can compare that length with our pre-defined limits. If it is larger than our limit we loop the character count backwards until it fits, all the while making sure to increase our starting index. Using a substr function, we print the address and it is always going to show the hidden portion of the address bar, it creates a sliding illusion, and can be programmed to react onclick or hover. Since my address box is read only, it reacts on click and defaults on leave.

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Feb 06, 2010 10:37 am
by Kitsune
berkus wrote:Get...rid...of... DIRECTORIES.
A bit of a tangent, but what model would you propose as an alternative to the traditional directory structure?

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Feb 06, 2010 10:53 am
by Creature
Kitsune wrote:
berkus wrote:Get...rid...of... DIRECTORIES.
A bit of a tangent, but what model would you propose as an alternative to the traditional directory structure?
I think he meant "remember the directory, but don't show it in the address bar".

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Feb 06, 2010 10:57 am
by neon
What about giving the address bar a second line that is "ontop" of the window elements? berkus's idea would solve it quite well also as only the current directory is shown.

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Feb 06, 2010 12:58 pm
by Selenic
jal wrote:Also, it is common use to use an ellipsis if you have removed stuff (so "C:\whatever\my..." or "..tever\my long directory name").
For that matter, a lot of programs tend to cut out the middle - for your example, it would be something like "C:\what... directory name". Not that I think that's a great idea, because it can be a bit confusing...

Of course, you can mitigate the problem somewhat by setting up the default directory structure carefully - if you avoid deep nesting and long names (think Unix, rather than Windows)

Also, notice that every shell I've seen only displays the deepest directory name...

Re: GUI Related Address Bar Question (Implementation)

Posted: Sat Feb 06, 2010 2:52 pm
by neato
The point of this thread was to develop a way to reveal the portions of an address in an Address Bar that extend beyond the Address Bar and are thus hidden from view. Therefore:

let ANS=That is no different than hiding the extended portion of an address.
let SAR=Might as well not have an address bar.
let AND=What if I forget the path I took to get to where I am currently at in a directory?
let QUE=How is that any different than a Status bar?
let FIN=BTW, this issue has already been long solved. I described the working fix above.

01. Showing the Most Current Directory Only = ANS + SAR
02. Hiding the Middle Portion of the Address = ANS + AND
03. Address Bar plus another Text box that shows the current directory = QUE + AND + SAR

FIN