GUI Related Address Bar Question (Implementation)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

GUI Related Address Bar Question (Implementation)

Post 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.
Cognition
Member
Member
Posts: 191
Joined: Tue Apr 15, 2008 6:37 pm
Location: Gotham, Batmanistan

Re: GUI Related Address Bar Question (Implementation)

Post by Cognition »

I'd just got with a tooltip personally.
Reserved for OEM use.
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: GUI Related Address Bar Question (Implementation)

Post 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?
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: GUI Related Address Bar Question (Implementation)

Post 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!
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: GUI Related Address Bar Question (Implementation)

Post 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
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: GUI Related Address Bar Question (Implementation)

Post 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.
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: GUI Related Address Bar Question (Implementation)

Post 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?
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: GUI Related Address Bar Question (Implementation)

Post 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".
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: GUI Related Address Bar Question (Implementation)

Post 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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: GUI Related Address Bar Question (Implementation)

Post 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...
neato
Member
Member
Posts: 75
Joined: Fri Jan 15, 2010 2:46 am

Re: GUI Related Address Bar Question (Implementation)

Post 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
Post Reply