indexing
	description: "Control window that contains one or more buttons. Each buttons sends a command message to the parent window when the user chooses it."
	note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_TOOL_BAR

create 

	make (a_parent: WEL_WINDOW; an_id: INTEGER)
			-- Create a toolbar with a_parent as parent and
			-- an_id as id.
		require
			a_parent_not_void: a_parent /= void
			a_parent_exists: a_parent.exists
		ensure
			exists: exists
			parent_set: parent = a_parent
			id_set: id = an_id

feature -- Access

	commands: WEL_COMMAND_MANAGER
			-- Command manager associated to the current window.
			-- (from WEL_WINDOW)

	default_processing: BOOLEAN
			-- (from WEL_RETURN_VALUE)

	font: WEL_FONT
			-- Font with which the control is drawing its text.
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			exists: exists
		ensure -- from WEL_CONTROL
			result_not_void: Result /= void

	has_return_value: BOOLEAN
			-- Should the window procedure return a value?
			-- (from WEL_RETURN_VALUE)

	id: INTEGER
			-- Control id
			-- (from WEL_CONTROL)

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)

	message_return_value: INTEGER
			-- Return value of the window procedure.
			-- (from WEL_RETURN_VALUE)
		require -- from WEL_RETURN_VALUE
			has_return_value: has_return_value

	parent: WEL_WINDOW
			-- Parent window
			-- (from WEL_WINDOW)
	
feature -- Status report

	absolute_x: INTEGER
			-- Absolute x position
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			Result = window_rect.x

	absolute_y: INTEGER
			-- Absolute y position
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			Result = window_rect.y

	background_brush: WEL_BRUSH
			-- Current window background color used to refresh the window when
			-- requested by the WM_ERASEBKGND windows message.
			-- By default there is no background
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			new_object: Result /= void implies Result /= background_brush

	button_checked (command_id: INTEGER): BOOLEAN
			-- Is the button identified by command_id checked?
		require
			exists: exists

	button_count: INTEGER
			-- Number of buttons in toolbar
		require
			exists: exists
		ensure
			positive_result: Result >= 0

	button_enabled (command_id: INTEGER): BOOLEAN
			-- Is the button identified by command_id enabled?
		require
			exists: exists

	button_hidden (command_id: INTEGER): BOOLEAN
			-- Is the button identified by command_id hidden?
		require
			exists: exists

	button_indeterminate (command_id: INTEGER): BOOLEAN
			-- Is the button identified by command_id
			-- indeterminate?
		require
			exists: exists

	button_pressed (command_id: INTEGER): BOOLEAN
			-- Is the button identified by command_id pressed?
		require
			exists: exists

	button_rect (index: INTEGER): WEL_RECT
			-- Rectangle of button at the zero-based index.
		require
			exists: exists
			index_large_enough: index >= 0
			index_small_enough: index < button_count
		ensure
			result_not_void: Result /= void

	captured_window: WEL_WINDOW
			-- Current window which has been captured.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			window_captured: window_captured

	client_rect: WEL_RECT
			-- Client rectangle
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			result_not_void: Result /= void

	command (message: INTEGER): WEL_COMMAND
			-- Command associated to message
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			positive_message: message >= 0
			command_exists: command_exists (message)
		ensure -- from WEL_WINDOW
			result_not_void: Result /= void

	command_argument (message: INTEGER): ANY
			-- Command argument associated to message
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			positive_message: message >= 0
			command_exists: command_exists (message)

	command_exists (message: INTEGER): BOOLEAN
			-- Does a command associated to message exist?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			positive_message: message >= 0

	commands_enabled: BOOLEAN
			-- Is the commands execution enabled?
			-- (from WEL_WINDOW)

	enabled: BOOLEAN
			-- Is the window enabled for mouse and keyboard input?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	ex_style: INTEGER
			-- Window ex_style
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	exists: BOOLEAN
			-- Does the item exist?
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = (item /= default_pointer)

	focused_window: WEL_WINDOW
			-- Current window which has the focus.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	has_bitmap: BOOLEAN
			-- Does the toolbar contains one bitmap or more?

	has_capture: BOOLEAN
			-- Does this window have the capture?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	has_focus: BOOLEAN
			-- Does this window have the focus?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	has_heavy_capture: BOOLEAN
			-- Does this window have the heavy capture?
			-- (from WEL_WINDOW)

	has_horizontal_scroll_bar: BOOLEAN
			-- Does this window have a horizontal scroll bar?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	has_system_font: BOOLEAN
			-- Does the control use the system font?
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			exists: exists

	has_vertical_scroll_bar: BOOLEAN
			-- Does this window have a vertical scroll bar?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	heavy_capture_activated: BOOLEAN
			-- Is the heavy capture currently running?
			-- (i.e. is there a window in the current program
			-- with has_heavy_capture to True?)
			-- (from WEL_WINDOW)

	height: INTEGER
			-- Window height
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
			-- Button at the zero-based index.
		require
			exists: exists
			index_large_enough: index >= 0
			index_small_enough: index < button_count
		ensure
			result_not_void: Result /= void

	is_inside: BOOLEAN
			-- Is the current window inside another window?
			-- (from WEL_WINDOW)

	last_bitmap_index: INTEGER
			-- Last bitmap index added by add_bitmaps.

	last_string_index: INTEGER
			-- Last string index added by add_strings.

	maximal_height: INTEGER
			-- Maximal height allowed for the window
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			result_large_enough: Result >= minimal_height

	maximal_width: INTEGER
			-- Maximal width allowed for the window
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			result_large_enough: Result >= minimal_width

	maximized: BOOLEAN
			-- Is the window maximized?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	minimal_height: INTEGER
			-- Minimal height allowed for the window
			-- Zero by default.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			positive_result: Result >= 0
			result_small_enough: Result <= maximal_height

	minimal_width: INTEGER
			-- Minimal width allowed for the window
			-- Zero by default.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			positive_result: Result >= 0
			result_small_enough: Result <= maximal_width

	minimized: BOOLEAN
			-- Is the window minimized?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	placement: WEL_WINDOW_PLACEMENT
			-- Window placement information
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			result_not_void: Result /= void

	shared: BOOLEAN
			-- Is item shared by another object?
			-- If False (by default), item will
			-- be destroyed by destroy_item.
			-- If True, item will not be destroyed.
			-- (from WEL_ANY)

	shown: BOOLEAN
			-- Is the window shown?
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	style: INTEGER
			-- Window style
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	tooltip: WEL_TOOLTIP
			-- The tooltip associated with the toolbar
		require
			tooltip_exists: tooltip_exists

	tooltip_exists: BOOLEAN
			-- Is there a tooltip associated to the toolbar?
		require
			exists: exists

	width: INTEGER
			-- Window width
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	window_captured: BOOLEAN
			-- Has a window been captured?
			-- (from WEL_WINDOW)

	window_rect: WEL_RECT
			-- Window rectangle (absolute position)
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			result_not_void: Result /= void

	x: INTEGER
			-- Window x position
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			parent = void implies Result = absolute_x

	y: INTEGER
			-- Window y position
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			parent = void implies Result = absolute_y
	
feature  -- Status report

	valid_hwnd_constant (c: POINTER): BOOLEAN
			-- Is c a valid hwnd constant?
			-- (from WEL_HWND_CONSTANTS)
	
feature -- Status setting

	check_button (command_id: INTEGER)
			-- Checks a button identified by command_id.
		require
			exists: exists
		ensure
			button_is_checked: button_checked (command_id)

	clear_indeterminate_state (command_id: INTEGER)
			-- Clear the indeterminate state of the button
			-- identified by command_id.
		require
			exists: exists
		ensure
			button_not_indeterminate: not button_indeterminate (command_id)

	disable
			-- Disable mouse and keyboard input
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			disabled: not enabled

	disable_button (command_id: INTEGER)
			-- Disable the button identified by command_id.
		require
			exists: exists
		ensure
			button_disabled: not button_enabled (command_id)

	disable_commands
			-- Disable commands execution.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			commands_disabled: not commands_enabled

	disable_default_processing
			-- Disable default window processing.
			-- The standard window procedure will not be called for
			-- each messages received by the window and then the
			-- normal behavior will not occur.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			default_processing_disabled: not default_processing

	disable_hot_item
			-- Unset the hot item.
		require
			exists: exists

	enable
			-- Enable mouse and keyboard input.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			enabled: enabled

	enable_button (command_id: INTEGER)
			-- Enable the button identified by command_id.
		require
			exists: exists
		ensure
			button_enabled: button_enabled (command_id)

	enable_commands
			-- Enable commands execution.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			commands_enabled: commands_enabled

	enable_default_processing
			-- Enable default window processing.
			-- The standard window procedure will be called for
			-- each messages received by the window and then the
			-- normal behavior will occur.
			-- (from WEL_WINDOW)
		ensure -- from WEL_WINDOW
			default_processing_enabled: default_processing

	enable_hot_item (command_id: INTEGER)
			-- Set hot item for button identified by command_id.
		require
			exists: exists

	hide
			-- Hide the window
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			hidden: not shown

	hide_button (command_id: INTEGER)
			-- Hide the button identified by command_id.
		require
			exists: exists
		ensure
			button_hidden: button_hidden (command_id)

	maximize
			-- Maximize the window
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			maximized: maximized

	minimize
			-- Minimize the window and display its icon
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			minimized: minimized

	press_button (command_id: INTEGER)
			-- Press the button identified by command_id.
		require
			exists: exists
		ensure
			button_pressed: button_pressed (command_id)

	release_button (command_id: INTEGER)
			-- Release the button identified by command_id.
		require
			exists: exists
		ensure
			button_not_pressed: not button_pressed (command_id)

	release_capture
			-- Release the mouse capture after a call
			-- to set_capture.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			has_capture: has_capture
		ensure -- from WEL_WINDOW
			not_has_capture: not has_capture

	release_heavy_capture
			-- Release the mouse capture after a call
			-- to set_heavy_capture.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			has_heavy_capture: has_heavy_capture
			heavy_capture_activated: heavy_capture_activated
		ensure -- from WEL_WINDOW
			heavy_capture_set: not has_heavy_capture
			heavy_capture_deactivated: not heavy_capture_activated

	restore
			-- Restore the window to its
			-- original size and position after
			-- minimize or maximize
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_bitmap_size (a_width, a_height: INTEGER)
			-- Sets the size of the bitmapped images to be added to
			-- the toolbar.
			-- The size can be set only before adding any
			-- bitmaps to the toolbar. If an application does
			-- not explicitly set the bitmap size, the size
			-- defaults to 16 by 15 pixels.
		require
			exists: exists
			positive_width: a_width >= 0
			positive_height: a_height >= 0
			no_bitmap_present: not has_bitmap

	set_button_size (a_width, a_height: INTEGER)
			-- Set the size of the buttons to be added to the
			-- toolbar.
			-- The size can be set only before adding any buttons
			-- to the toolbar. If an application does not
			-- explicitly set the button size, the size defaults
			-- to 24 by 22 pixels.
		require
			exists: exists
			positive_width: a_width >= 0
			positive_height: a_height >= 0
			no_existing_buttons: button_count = 0

	set_capture
			-- Set the mouse capture to the Current window.
			-- Once the window has captured the mouse, all
			-- mouse input is directed to this window, regardless
			-- of whether the cursor is over that window. Only
			-- one window can have the mouse capture at a time.
			--
			-- Works only for windows in the same thread as your
			-- application.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			has_not_capture: not has_capture
			has_not_heavy_capture: not has_heavy_capture
		ensure -- from WEL_WINDOW
			has_capture: has_capture

	set_ex_style (an_ex_style: INTEGER)
			-- Set an_ex_style with ex_style.
			--
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_focus
			-- Set the focus to Current
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_heavy_capture
			-- Set the mouse capture to the Current window.
			-- Once the window has captured the mouse, all
			-- mouse input is directed to this window, regardless
			-- of whether the cursor is over that window. Only
			-- one window can have the mouse capture at a time.
			--
			-- Works for ALL windows.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			has_not_heavy_capture: not has_heavy_capture
			heavy_capture_deactivated: not heavy_capture_activated
		ensure -- from WEL_WINDOW
			heavy_capture_set: has_heavy_capture
			heavy_capture_activated: heavy_capture_activated

	set_identifier (index, an_id: INTEGER)
			-- Set the identifier for the button at zero-based
			-- index to an_id.
		require
			exists: exists
			index_large_enough: index >= 0
			index_small_enough: index < button_count

	set_indeterminate_state (command_id: INTEGER)
			-- Set the indeterminate state of the button
			-- identified by command_id.
		require
			exists: exists
		ensure
			button_indeterminate: button_indeterminate (command_id)

	set_shared
			-- Set shared to True.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			shared: shared

	set_style (a_style: INTEGER)
			-- Set style with a_style.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_tooltip (a_tooltip: WEL_TOOLTIP)
			-- Associate a tooltip control with the toolbar.
		require
			exists: exists
			a_tooltip_not_void: a_tooltip /= void
			a_tooltip_exists: a_tooltip.exists
		ensure
			tooltip_exists: tooltip_exists
			tooltip_set: tooltip = a_tooltip

	set_unshared
			-- Set shared to False.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			unshared: not shared

	show
			-- Show the window
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	show_button (command_id: INTEGER)
			-- Show the button identified by command_id.
		require
			exists: exists
		ensure
			button_shown: not button_hidden (command_id)

	uncheck_button (command_id: INTEGER)
			-- Unchecks a button identified by command_id
		require
			exists: exists
		ensure
			button_unchecked: not button_checked (command_id)

	update_cached_style (new_ex_style, old_ex_style: INTEGER)
			-- Update Window cache buffer for Window style.
			-- (from WEL_WINDOW)
	
feature -- Element change

	add_bitmaps (tb_bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
			-- Add bitmaps.
		require
			exists: exists
			bitmap_not_void: tb_bitmap /= void
			positive_bitmap_count: bitmap_count > 0

	add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
			-- Add buttons.
		require
			exists: exists
			buttons_not_void: buttons /= void
			buttons_not_empty: not buttons.is_empty
			no_void_button: not buttons.has (void)
		ensure
			count_increased: button_count = old button_count + buttons.count

	add_strings (strings: ARRAY [STRING])
			-- Add strings to the toolbar.
		require
			exists: exists
			string_not_void: strings /= void
			strings_not_empty: not strings.is_empty

	has_system_window_locked: BOOLEAN
			-- Is there any window locked ?
			-- (from WEL_WINDOW)

	insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
			-- Insert button to the left of the button
			-- at the zero-based index.
		require
			exists: exists
			button_not_void: button /= void
			index_large_enough: index >= 0
			index_small_enough: index <= button_count
		ensure
			buttons_increased: button_count = old button_count + 1

	lock_window_update
			-- Disables drawing in the current window. A locked window cannot be moved.
			-- Only one window can be locked at a time. To unlock a window locked with
			-- lock_window_update , call 'unlock_window_update'.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			has_system_window_locked

	set_font (a_font: WEL_FONT)
			-- Set font with a_font.
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			exists: exists
			a_font_not_void: a_font /= void
			a_font_exists: a_font.exists
		ensure -- from WEL_CONTROL
			font_set: not has_system_font implies font.item = a_font.item

	set_height (a_height: INTEGER)
			-- Set height with a_height
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item

	set_parent (a_parent: WEL_WINDOW)
			-- Change the parent of the current window.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_placement (a_placement: WEL_WINDOW_PLACEMENT)
			-- Set placement with a_placement
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			a_placement_not_void: a_placement /= void

	set_timer (timer_id, time_out: INTEGER)
			-- Set a timer identified by timer_id with a
			-- time_out value (in milliseconds).
			-- See also on_timer, kill_timer.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			positive_timer_id: timer_id > 0
			positive_time_out: time_out > 0

	set_width (a_width: INTEGER)
			-- Set width with a_width
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_x (a_x: INTEGER)
			-- Set x with a_x
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_y (a_y: INTEGER)
			-- Set y with a_y
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	unlock_window_update
			-- Unlock a locked window.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
	
feature -- Removal

	delete_button (index: INTEGER)
			-- Delete the button at the zero-based index.
		require
			exists: exists
			index_large_enough: index >= 0
			index_small_enough: index < button_count
		ensure
			buttons_decreased: button_count = old button_count - 1

	destroy
			-- Destroy the window.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
		ensure -- from WEL_WINDOW
			not_exists: not exists

	dispose
			-- Destroy the inner structure of Current.
			--
			-- This function should be called by the GC when the
			-- object is collected or by the user if Current is
			-- no more usefull.
			-- (from WEL_ANY)
	
feature -- Conversion

	to_integer: INTEGER
			-- Converts item to an integer.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = cwel_pointer_to_integer (item)
	
feature -- Basic operations

	auto_size
			-- Resize tooolbar after changes.
			-- An application sends the TB_AUTOSIZE message after
			-- causing the size of a toolbar to change either by
			-- setting the button or bitmap size or by adding strings
			-- for the first time.
		require
			exists: exists

	bring_to_top
			-- Bring this window to the top of the Z order.
			--
			-- Note:
			--  * If the window is a top-level window, it is activated.
			--  * If the window is a child window, the top-level parent window
			--    associated with the child window is activated.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	default_process_notification (notification_code: INTEGER)
			-- Process a notification_code which has not been
			-- processed by process_notification.
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			exists: exists

	disable_horizontal_scroll_bar
			-- Disable the horizontal scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	disable_vertical_scroll_bar
			-- Disable the vertical scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	enable_horizontal_scroll_bar
			-- Enable the horizontal scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	enable_vertical_scroll_bar
			-- Enable the vertical scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
			-- Find the previous or following control with the
			-- Wm_tabstop style in the current group in a_parent
			-- depending on the value of after.
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			valid_parent: a_parent /= void and then a_parent.exists

	go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
			-- Find the previous or following control with the
			-- Wm_tabstop style in `a_parent depending on the
			-- value of after.
			-- (from WEL_CONTROL)
		require -- from WEL_CONTROL
			valid_parent: a_parent /= void and then a_parent.exists

	hide_horizontal_scroll_bar
			-- Hide the horizontal scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	hide_scroll_bars
			-- Hide the horizontal and vertical scroll bars.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	hide_vertical_scroll_bar
			-- Hide the vertical scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	insert_after (a_window: WEL_WINDOW)
			-- Insert the current window after a_window.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			a_window_not_void: a_window /= void
			a_window_not_current: a_window /= Current
			a_window_exists: a_window.exists

	invalidate
			-- Invalide the entire client area of the window. The
			-- background will be erased before.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
			-- Invalidate the area rect and erase
			-- the background if erase_background is True.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			rect_not_void: rect /= void

	invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
			-- Invalidate the area region and erase
			-- the background if erase_background is True.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			region_not_void: region /= void
			region_exists: region.exists

	invalidate_without_background
			-- Invalidate the entire client area of the window. The
			-- background will not be erased.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	kill_timer (timer_id: INTEGER)
			-- Kill the timer identified by timer_id.
			-- See also set_timer, on_timer.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			positive_timer_id: timer_id > 0

	move (a_x, a_y: INTEGER)
			-- Move the window to a_x, a_y.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
			-- Move the window to a_x, a_y position and
			-- resize it with a_width, a_height.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
			-- Put a_command associated to message.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			a_command_not_void: a_command /= void
			positive_message: message >= 0
		ensure -- from WEL_WINDOW
			command_added: command (message) = a_command and command_argument (message) = argument

	remove_command (message: INTEGER)
			-- Remove the command associated to message.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			positive_message: message >= 0
			command_exists: command_exists (message)
		ensure -- from WEL_WINDOW
			command_removed: not command_exists (message)

	reposition
			-- Reposition the bar according to the parent.
			-- This function needs to be called in the
			-- on_size function of the parent.
		require
			exists: exists

	resize (a_width, a_height: INTEGER)
			-- Resize the window with a_width, a_height.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	scroll (a_x, a_y: INTEGER)
			-- Scroll the contents of the window's client area.
			-- a_x and a_y specify the amount of horizontal
			-- and vertical scrolling.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	set_class_icon (new_icon: WEL_ICON)
			-- Replace the current icon for the class which this window
			-- belongs to.
			--
			-- The SetClassLong function replaces the specified 32-bit (long)
			-- value at the specified offset into the extra class memory
			-- or the WNDCLASSEX structure for the class to which the
			-- specified window belongs.
			-- (from WEL_WINDOW)

	set_class_small_icon (new_icon: WEL_ICON)
			-- Replace the current icon for the class which this window
			-- belongs to.
			--
			-- The SetClassLong function replaces the specified 32-bit (long)
			-- value at the specified offset into the extra class memory
			-- or the WNDCLASSEX structure for the class to which the
			-- specified window belongs.
			-- (from WEL_WINDOW)

	set_z_order (z_order: POINTER)
			-- Set the z-order of the window.
			-- See class WEL_HWND_CONSTANTS for z_order values.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			valid_hwnd_constant: valid_hwnd_constant (z_order)

	show_horizontal_scroll_bar
			-- Show the horizontal scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	show_scroll_bars
			-- Show the horizontal and vertical scroll bars.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	show_vertical_scroll_bar
			-- Show the vertical scroll bar.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	show_with_option (cmd_show: INTEGER)
			-- Set the window's visibility with cmd_show.
			-- See class WEL_SW_CONSTANTS for cmd_show value.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			parent_shown: parent /= void implies parent.exists and parent.shown

	update
			-- Update the client area by sending a Wm_paint message.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	validate
			-- Validate the entire client area of the window.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists

	validate_rect (rect: WEL_RECT)
			-- Validate the area rect.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			rect_not_void: rect /= void

	validate_region (region: WEL_REGION)
			-- Validate the area region.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			region_not_void: region /= void
			region_exists: region.exists

	win_help (help_file: STRING; a_command, data: INTEGER)
			-- Start the Windows Help program with help_file.
			-- a_command specifies the type of help requested. See
			-- class WEL_HELP_CONSTANTS for a_command values.
			-- 'data' is depandant on 'a_command'.  Check MSDN for more details.
			-- (from WEL_WINDOW)
		require -- from WEL_WINDOW
			exists: exists
			help_file_not_void: help_file /= void
	
feature -- Element Change

	set_default_processing (value: BOOLEAN)
			-- Enable or disable default processing of window messages.
			-- (from WEL_RETURN_VALUE)
		ensure -- from WEL_RETURN_VALUE
			value_set: default_processing = value

	set_message_return_value (value: INTEGER)
			-- Set the window-procedure-return-value.
			-- (from WEL_RETURN_VALUE)
		ensure -- from WEL_RETURN_VALUE
			has_return_value: has_return_value
			value_set: message_return_value = value
	
feature -- Notifications

	on_tbn_beginadjust
			-- The user has begun customizing the toolbar.
		require
			exists: exists

	on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
			-- The user has begun dragging a button in the toolbar.
		require
			exists: exists

	on_tbn_custhelp
			-- The user has chosen the Help button in the
			-- customize toolbar dialog box.
		require
			exists: exists

	on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
			-- The user clicks a button that uses the
			-- Tbstyle_dropdown style.
		require
			exists: exists

	on_tbn_endadjust
			-- The user has stopped customizing the toolbar.
		require
			exists: exists

	on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
			-- The user has stopped dragging a button in the toolbar.
		require
			exists: exists

	on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
			-- Retrieves toolbar customization.
		require
			exists: exists

	on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
			-- A button may be deleted from the toolbar while
			-- the user is customizing the toolbar.
		require
			exists: exists

	on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
			-- A button may be inserted to the left of the
			-- specified button while the user is customizing
			-- the toolbar.
		require
			exists: exists

	on_tbn_reset
			-- The user has reset the content of the customise
			-- toolbar dialog box.
		require
			exists: exists

	on_tbn_toolbarchange
			-- The user has customized the toolbar.
		require
			exists: exists
	
feature -- Registration

	register_current_window
			-- Register Current in window manager.
			-- (from WEL_WINDOW)
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_BAR