##############################################################################
#
# Copyright (C) 2007 Tristan  http://www.tcltk.cn
#
# Description file for Tile Widget
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

##############################################################################

# Created from scale.wgt

Class       TSeparator
Lib     ttk

DefaultOptions  -class TSeparator
Icon            @vTcl::widgets::ttk::separator::getIcon
TreeLabel       Separator
CreateCmd       ttk::separator
#MegaWidget      yes
TtkWidget       yes

## Special proc for setting up icons on the toolbar.
proc vTcl:TSeparator:ToolBarSetup {} {
    vTcl:toolbar_add ttk TSeparator "vertical separator" icon_separator_v.gif \
        "-orient vertical"
    vTcl:toolbar_add ttk TSeparator "horizontal separator" icon_separator_h.gif \
        "-orient horizontal"
}

namespace eval vTcl::widgets::ttk::separator {

    proc getIcon {{w ""}} {
        if {[lempty $w]} {
            return [list icon_separator_h.gif icon_separator_v.gif]
        }
        if {[catch {$w cget -orient} orient]} {
            return "icon_separator.gif"
        }
        if {$orient == "horizontal"} {
            return "icon_separator_h.gif"
        }
        return "icon_separator_v.gif"
    }

}
