Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Standards for making a long folder path fit into a textbox?
FOXPRO 101: I've got a form that consists of (among others controls) a command button and a textbox.
The command button calls GETDIR(), the textbox displays the selected path. In the interest of cramming as much text into the textbox as possible, I make the font proportional and lower case. The problem is, some users love to bury directories deep into their trees, and/or create l o n g directory names, thereby exceeding the width of the textbox. I've hit upon a workable solution, but would appreciate any guidance if I'm straying from the norm...
1. In shortening a fullpath, is it standard to replace a middle section with "\...\"?
(i.e., c:\program files\subone\subtwo with c:\...\subone\subtwo )
2. In shortening a fullpath, is it standard to replace the sections starting with the leftmost "\"?
( i.e., as before, c:\...subone\subtwo rather than c:\program files\...\subtwo )
3. Is it best to set such a textbox as unselectable, but viewable (i.e., WHEN method returns .F., Backstyle = 0 - Transparent)?
If I allow the user to directly enter the path themselves, won't they be tempted to enter their own \...\s (which I would have to explain in a VALID clause why they can't but my program can) ?
4. Is it better to user a label instead of a textbox, when echoing such information back to the user?
5. When using a proportional font, is there a cleaner way of determining the length of the variable inside the textbox, other than using the form's .TEXTWIDTH(cString) property, and comparing it against the length of the textbox? (This way gave me fits on my dynamically resizeable forms, until I stored off the original width of the textbox, rather than the resized width; this because .TEXTWIDTH(cString) doesn't resize. Doh!)
Thanks in advance, all. I'd hate to appear on the "Interfaces from Hell" page!
Jim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement