Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: DHTML Window widget (v1.1) help.

  1. #1
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question DHTML Window widget (v1.1) help.

    1) Script Title: DHTML Window widget (v1.1)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/index.htm

    3) Describe problem:

    I'd like to know if its possible to add a minimize event that handles the minimize like the one shown here:
    http://prototype-window.xilinus.com/PWC-OS/ (completed)

    need help getting the functions to work properly i.e: minimize and maximize shouldnt conflict.

    browser compatibility.

    styling of the control area.

    thank you for all of your time!
    Last edited by EISD; 06-13-2009 at 09:13 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I've managed to make the minimize block stack horizontally.

    Code:
    minimize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="minimized" //indicate the state of the window as being "minimized"
    	t.contentarea.style.display="none"
    	t.statusarea.style.display="none"
    	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
    		dhtmlwindow.minimizeorder++ //increment order
    		t.minimizeorder=dhtmlwindow.minimizeorder
    	}
    	t.style.width="175px"
    	var windowspacing=t.minimizeorder*185 //spacing (gap) between each minmized window(s)
    	t.style.top=96.3+"%"
    	t.style.left=windowspacing-t.minimizeorder-240+"px"
    now I'm trying to dissable the move function
    Code:
    move:function(t, e){
    	t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px"
    	t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"
    },
    while the dhtml windows are minimized.

    Also does anyone have any ideas on how to add a maximize (full window)
    and tie it up to work?

  3. #3
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Code:
    else if (t.state=="maximized" && t.controls.firstChild.title=="Restore"){ //If window exists and is currently maximized?
    		t.controls.firstChild.setAttribute("src", dhtmlwindow.imagefiles[3]) //Change "restore" icon within window interface to "maximize" icon
    		t.controls.firstChild.setAttribute("title", "Maximize")
    		t.state="maximized" //indicate the state of the window as being "fullview"
    	}
    
    ...
    
    maximize:function(button, t){
        var tracker=0;
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[3])
    	button.setAttribute("title", "Restore")
    	t.state="maximized" //indicate the state of the window as being "maximized"
    	t.contentarea.style.display="block"
    	t.statusarea.style.display="block"
    	t.style.height=
    	t.style.width="100%"
    	t.style.top="-3px"
    	t.style.left="-3px"
    	tracker=2
    },
    I got the maximize button working, incorrectly, but working.

    I have a small (quite big problem) trying to figure out how to make the icons switch individually.

  4. #4
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Code:
    minimize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="minimized" //indicate the state of the window as being "minimized"
    	t.contentarea.style.display="none"
    	t.statusarea.style.display="none"
    	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
    		dhtmlwindow.minimizeorder++ //increment order
    		t.minimizeorder=dhtmlwindow.minimizeorder
    	}
    	t.style.width="175px"
    	var windowspacing=t.minimizeorder*185 //spacing (gap) between each minmized window(s)
    	t.style.top=96.3+"%"
    	t.style.left=windowspacing-t.minimizeorder-240+"px"
    },
    
    maximize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="maximized" //indicate the state of the window as being "maximized"
    	t.contentarea.style.display="block"
    	t.statusarea.style.display="block"
    	t.style.height=dhtmlwindow.docheight-t.handle.offsetHeight-40+"px"
    	t.style.width="100%"
    	t.style.top="-3px"
    	t.style.left="-3px"
    },
    
    restore:function(button, t){
    	if(t.state=="maximized"){
    	dhtmlwindow.getviewpoint()
    	button.setAttribute("src", dhtmlwindow.imagefiles[3])
    	button.setAttribute("title", "Maximize")
    	t.state="fullview" //indicate the state of the window as being "fullview"
    	t.style.display="block"
    	t.contentarea.style.display="block"
    	if (t.resizeBool) //if this window is resizable, enable the resize icon
    	t.statusarea.style.display="block"
    	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
    	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
    	t.style.width=parseInt(t.lastwidth)+"px"
    	}
    	else if(t.state=="minimized"){
    	dhtmlwindow.getviewpoint()
    	button.setAttribute("src", dhtmlwindow.imagefiles[0])
    	button.setAttribute("title", "Minimize")
    	t.state="fullview" //indicate the state of the window as being "fullview"
    	t.style.display="block"
    	t.contentarea.style.display="block"
    	if (t.resizeBool) //if this window is resizable, enable the resize icon
    	t.statusarea.style.display="block"
    	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
    	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
    	t.style.width=parseInt(t.lastwidth)+"px"
    	}
    
    },
    having minor problems getting the icons to reset when window is maximized and you minimize, it will show a restore button for both the minimize and maximize.

  5. #5
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    still need help fixing the control buttons, they behave randomly depending on what you click first

    also still working on removing the move function while the dhtmlwindow is minimized

    the current script in its current buggy glory can be seen live at:

    http://80.221.7.8/

    note: to save on space i had to strip the
    // -------------------------------------------------------------------
    // DHTML Window Widget- By Dynamic Drive, available at: http://www.dynamicdrive.com
    // -------------------------------------------------------------------

    on the txt file
    Last edited by EISD; 06-07-2009 at 09:03 AM.

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Do you have an online example of what you have so far? As far as recreating the minimize dock you cited in that other link, it is a rather big change, so it's unlikely I'll be able to help you create it from scratch. Depending on what you have so far already though, I may be able to help you with issues you're having with the changes.

    p.s: Please don't start multiple threads on the same question, it just makes it harder for others to help you. I'm referring to this thread: http://www.dynamicdrive.com/forums/s...ad.php?t=45711
    DD Admin

  7. The Following User Says Thank You to ddadmin For This Useful Post:

    EISD (06-09-2009)

  8. #7
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    sorry about that. i'm kind of desperate to get this working - my way -

    uhm i have a test server runing at the following address: http://80.221.7.8/

    there you can see a stable script so to speak.

    I'm trying to mod the DD script to behave like OS windows.

  9. #8
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    so anyone have any ideas?

  10. #9
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It's hard to know where to start as far as extending what you have so far with what you have in mind, since based on your page I don't see any of the dock being implemented yet. In other words, it seems like you're asking for basically help on creating the interface from scratch. The scope of what you're asking probably makes this request much more realistic as a Paid Projects request.
    DD Admin

  11. #10
    Join Date
    Jun 2009
    Location
    Suomi
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    the script does the positioning of the minimized window. in my mind it seems obvious there should be a way to dissable the move function while the window is minimized. if that happened and i got a way to make the windows minimize and use a proper t.style.top=docheight - x pixels. to minimize into the "dock" thats made by the "menu bar". its should be an optical illusion that works well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •