Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Article Writing
  3. Explorer, Docking, Splitter-windows in plain C

Explorer, Docking, Splitter-windows in plain C

Scheduled Pinned Locked Moved Article Writing
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Ted Green
    wrote on last edited by
    #1

    I am looking for any helpful source code on how to implement Docking windows, Splitter-windows and an Explorer-like tree view in plain C, not C++ and not MFC. I think we can figure out how to display an Explorer-like view of a drive using plain C, but I don't have a clue where to even begin with Docking windows and Splitter windows. Thank you. Ted Green ted@vedit.com

    H 1 Reply Last reply
    0
    • T Ted Green

      I am looking for any helpful source code on how to implement Docking windows, Splitter-windows and an Explorer-like tree view in plain C, not C++ and not MFC. I think we can figure out how to display an Explorer-like view of a drive using plain C, but I don't have a clue where to even begin with Docking windows and Splitter windows. Thank you. Ted Green ted@vedit.com

      H Offline
      H Offline
      Henry Jacobs
      wrote on last edited by
      #2

      I don't have any code but I can tell you were to start. Explorer's tree view uses the treeview common control which does not use MFC and can be used from C. Lookup the API function FindFirstFile for information on how to traverse directories. Docking windows and splitter windows use the same type of system. The main window controls the child windows size and location. One of the child windows, the view, is where the data is drawn. When docking windows are used the view window's size and location is changed by the main frame to allow other child windows to be positioned around it. When the docked window is clicked on and the cursor is dragged and released it tells its parent window that it needs space at its new position. The parent window resizes the view. (See Illus. 2.) When a splitter window is used one parent window controls the position of two or more view windows. In Windows Explorer the parent window is the main frame. (See Illus. 3.) When the parent window detects when the cursor pass over it the parent window changes the cursor to the splitter cursor. When the button is pressed and the cursor moved the parent window resizes its child windows (views) based on the cursor's new location. A way to see this behavior is to use the spy tool on Windows Explorer.

                   Illustrations
      
      1. Application window without toolbars.

      +---------------------+ <-- Main frame
      |Title |
      +---------------------+
      |File Edit Help |
      |+-------------------+| <-- View window takes
      || || up the Main frame's
      || || GetClientRect().
      || ||
      || ||
      || ||
      |+-------------------+|
      +---------------------+

      1. Notice how the view window size has been
        decreased by the toolbar.

      +---------------------+ <-- Main frame
      |Title |
      +---------------------+
      |File Edit Help |
      |+--------+ | <-- Docking window
      || | | (toolbar)
      |+--------+ |
      |+-------------------+| <-- View window
      || ||
      || ||
      |+-------------------+|
      +---------------------+

      1. Like Windows Explorer, the main frame will
        act as the splitter. For more complex
        designs a child window can handle the
        splitter logic.

      +---------------------

      T 1 Reply Last reply
      0
      • H Henry Jacobs

        I don't have any code but I can tell you were to start. Explorer's tree view uses the treeview common control which does not use MFC and can be used from C. Lookup the API function FindFirstFile for information on how to traverse directories. Docking windows and splitter windows use the same type of system. The main window controls the child windows size and location. One of the child windows, the view, is where the data is drawn. When docking windows are used the view window's size and location is changed by the main frame to allow other child windows to be positioned around it. When the docked window is clicked on and the cursor is dragged and released it tells its parent window that it needs space at its new position. The parent window resizes the view. (See Illus. 2.) When a splitter window is used one parent window controls the position of two or more view windows. In Windows Explorer the parent window is the main frame. (See Illus. 3.) When the parent window detects when the cursor pass over it the parent window changes the cursor to the splitter cursor. When the button is pressed and the cursor moved the parent window resizes its child windows (views) based on the cursor's new location. A way to see this behavior is to use the spy tool on Windows Explorer.

                     Illustrations
        
        1. Application window without toolbars.

        +---------------------+ <-- Main frame
        |Title |
        +---------------------+
        |File Edit Help |
        |+-------------------+| <-- View window takes
        || || up the Main frame's
        || || GetClientRect().
        || ||
        || ||
        || ||
        |+-------------------+|
        +---------------------+

        1. Notice how the view window size has been
          decreased by the toolbar.

        +---------------------+ <-- Main frame
        |Title |
        +---------------------+
        |File Edit Help |
        |+--------+ | <-- Docking window
        || | | (toolbar)
        |+--------+ |
        |+-------------------+| <-- View window
        || ||
        || ||
        |+-------------------+|
        +---------------------+

        1. Like Windows Explorer, the main frame will
          act as the splitter. For more complex
          designs a child window can handle the
          splitter logic.

        +---------------------

        T Offline
        T Offline
        Ted Green
        wrote on last edited by
        #3

        Thank you for the prompt reply. I understand the basics and have programmed windows such as toolbars (before the common control in Win32), rulers, MDI, etc. Its all the "details" that are so time consuming. 1. Explorer tree view - I'm sure that I am not the first person writing an "explorer" in plain C. Its all the details of determining which drives are available, etc. that take time. However, I don't see any stumbling blocks; just would be nice if I could find complete sample code. The "chicoapp" example on MSDN and the FileTree example on codeproject.com are very useful. 2. Docking Windows - Details include the subtle ways that the mainframe's window borders are drawn/shaded when there is a docked window, the algorithm for outlining where the window can be docked. The slider for resizing the docked window in non-trivial. 3. MDI splitter windows. This also looks very difficult. It appears that you may have to sub-class the drawing of the MDI border and scroll bars in order to display the scrollbar "splitter", etc. Perhaps no one has attempted this in plain C. Any references to sample code will be appreciated. Thank you. Ted Green ted@vedit.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups