#             H I G H L I G H T E D P A G E . I T K
# BRL-CAD
#
# Copyright (c) 2004-2023 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# version 2.1 as published by the Free Software Foundation.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this file; see the file named COPYING for more
# information.
#
###
#
# This page supports selecting options for a full-color image
# with lines highlighting the edges.
#

package require Itcl
package require Itk
package require Iwidgets

namespace eval RtWizard {

    package require MGEDpage 1.0
    package provide HighlightedPage 1.0

    #
    # highlightedpage - Provides a lowercased access method for the
    #                   full-color and lines image class
    #
    proc highlightedpage { pathName args } {
	uplevel HighlightedPage $pathName $args
    }

    #
    # Add options
    #

    # None!

    ::itcl::class HighlightedPage {
	inherit ::RtWizard::MGEDpage

	public {
	    constructor {filename args} {
		MGEDpage::constructor $filename
	    } {

		$itk_component(helpPanel) insert insert \
		    "Use this page to select the items that you wish to render as a full-color image with highlight lines." \
		    HelpTag

		$itk_component(helpPanel) tag configure HelpTag \
		    -font {helvetica 10 bold}

		configure -onSelectCallback [itcl::code $this onSelect2]
		configure -onDeselectCallback [itcl::code $this onDeselect2]
		configure -statusCallback [itcl::code $this statusCallback]
		configure -labeltext "Configure the Highlighted Elements"
		configure -labelpos nw
		configure -stepName "Configure Highlighted Elements"

		eval itk_initialize $args

		$itk_component(helpPanel) configure -state disabled
	    }
	}

	private {
	    method onSelect2 {optionMenu}
	    method onDeselect2 {}
	    method statusCallback {}
	}
    }

    #--------------------#
    #   Public Methods   #
    #--------------------#

    #--------------------#
    #  Private Methods   #
    #--------------------#
    #
    # onSelect2
    #
    # Derived class extension for the base class onSelect method.
    #
    itcl::body HighlightedPage::onSelect2 {optionsMenu} {
	#
	# Do the options menu
	#
	$::wizardInstance menubar add command .$optionsMenu.bg \
	    -label "Background Color..." \
	    -helpstr "Set the background color" \
	    -command "[itcl::code $this backgroundColorChooser]"

	$::wizardInstance menubar add cascade .$optionsMenu.fgCasc \
	    -label "Line Color"

	$::wizardInstance menubar add command .$optionsMenu.fgCasc.fgChoose \
	    -label "Choose..." \
	    -helpstr "Set the color of rendered lines" \
	    -command "[itcl::code $this lineColorChooser]"

	$::wizardInstance menubar add checkbutton \
	    .$optionsMenu.fgCasc.useRegCol \
	    -label "Use Region Colors" \
	    -helpstr "Use the colors assigned to individual regions" \
	    -variable "[itcl::scope useRegionColors]" \
	    -offvalue "false" \
	    -onvalue "true"
    }

    #
    # onDeselect2
    #
    # Cleans up when a page is deselected
    #
    itcl::body HighlightedPage::onDeselect2 {} {

    }

    #
    # statusCallback
    #
    # Page-specific status method
    #
    itcl::body HighlightedPage::statusCallback {} {
	return 1
    }
}; # end namespace


# Local Variables:
# mode: Tcl
# tab-width: 8
# c-basic-offset: 4
# tcl-indent-level: 4
# indent-tabs-mode: t
# End:
# ex: shiftwidth=4 tabstop=8
