Tk Source Code

Ticket Change Details
Login
Overview

Artifact ID: 096567a1f206b287f440865cc717f5f95a8dd998
Ticket: 1520742fffffffffffffffffffffffffffffffff
Windows-style Open and Save file dialog on Unix
User & Date: dkf 2013-11-03 12:44:10
Changes

  1. closer changed to: "nobody"
  2. comment changed to:
    Email:[email protected]
    An attachment with the necessary source files is 
    attached.
    
    The tk_getOpenFile and tk_getSaveFile have been 
    greatly improved to function much like a windows 
    dialog taken from Windows 2000, when the default 
    dialogs are overridden.
    This is most useful on Unix systems where the 
    application is wanted to have a Windows-like 
    appearance, but it will also function on Windows.
    I have not been able to test on Macintosh.
    This also affects tk_chooseDirectory when the default 
    dialogs are overridden since it runs off of 
    tkfbox.tcl.
    
    The dialogs will work without the BWidget package, 
    but it will have more functionality and look more 
    like a windows dialog if BWidgets are included.
    The only thing it really needs from BWidgets is the 
    ComboBox widget.  If this were included in regular 
    Tk, then BWidgets would not be needed.
    It also uses the balloon messages of the "Button" 
    widget from BWidgets.
    
    This new file dialog widget requires two of the new 
    widgets included -- ResizeButs and tk_fileProperties.
    I added these lines to the file "tclIndex" to get it 
    to find these commands:
    set auto_index(ResizeButs) [list source [file join 
    $dir ResizeButs.tcl]]
    set auto_index(tk_fileProperties) [list source [file 
    join $dir tkfprops.tcl]]
    
    The two tcl files that define these widgets are 
    included (ResizeButs.tcl and tkfprops.tcl), along 
    with documentation on each one.
    
    The file choosedir.tcl is also included.  It is 
    needed to work with the modified tkfbox.tcl.
    
    
    Added functionality of the file dialog:
          1. Back directory button
          2. Create directory button
          3. Details button
          4. Delete button
          5. You can type the directory path at the top 
    (requires BWidgets).  Selecting "desktop" expands 
    what's available on the desktop if used on Windows.
          Right mouse clicking on a file gives these 
    options:
                1.  Cut
                2.  Copy
                3.  Delete
                4.  Rename
                5.  Properties (uses tk_fileProperties 
    widget)
          Right mouse clicking in open white space gives 
    these options:
                1.  View
                      1. List
                      2. Details
                2.  Arrange Icons
                      1. By Name
                      2. By Size
                      3. By Type
                      4. By Date
                3.  Refresh
                4.  Paste (ungreys if Cut or Copy were 
    previously selected on files)
                5.  New Folder
                6.  Properties (uses tk_fileProperties 
    widget)
          6. Recent selected files can be shown by 
    pressing the down arrow in the entry field of the 
    selected file name (requires BWidgets).  Recent file 
    names are saved to a file named 
    
    .tk_recent_selections in the users home directory.
          7. Box selecting of files can be done with 
    the "multiple 1" option.  Left mouse click and hold 
    and drag a box over files.
          8. The busy was improved to actually block 
    mouse clicks instead of just showing an hourglass 
    widget.
          9. Popup button descriptions. (requires 
    BWidgets)
          10. Icons shade as well as text when selected.
    
    Details view
          The Details button grids 4 columns (name, file 
    type, size, and modified date). (uses ResizeButs 
    widget)
          Moving the mouse over the border between two 
    buttons of the top column headings and left mouse 
    clicking while dragging will allow the user to change 
    the size of the columns.
          Pressing one of the heading buttons changes the 
    order of the data between increasing and decreasing 
    and displays a triangle in the button to indicate the 
    order.
    
    Additional Arguments to the tk_getOpenFile and 
    tk_getSaveFile commands
          The dir_leaf arguments allow a folder to be 
    selected as a file to select it as a project.  
    Providing a -dir_leaf_check procedure defines the 
    file dialog as a special type that only 
    
    lists folders, but the folder that passes the -
    dir_leaf_check procedure can be selected as a file.
          1. -dir_leaf_check -- This is the name of a 
    procedure which checks if the directory qualifies as 
    the kind that can be selected as a project file. It 
    returns a non-zero number if it 
    
    qualifies, otherwise it returns zero. The directory 
    name to check will be appended as an argument to the 
    procedure.
          2. -dir_leaf_image -- an image to use for the 
    folder types that will be treated as files.  It 
    should be an image created with "image create photo"
          3. -dir_leaf_label -- text that appears at the 
    left of the entry for the selected file when the 
    dialog is defined as a project folder selection type 
    (when the -dir_leaf_check 
    
    procedure is defined).
    
  3. icomment:
    Dropping priority. Needs:
    <ul><li>Committing to a branch, ASAP<li>Significant work before merging to any mainline version</ul>
    Alas.
    
  4. login: "dkf"
  5. mimetype: "text/html"
  6. priority changed to: "8"
  7. severity changed to: "Minor"
  8. username: "dkf"