INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Control window that contains one or more buttons. Each ", "button sends a command message to the parent window when ", "user chooses it. ", "note: The common controls dll (WEL_COMMON_CONTROLS_DLL) ", " needs to be loaded to use this control. ", "WEL: library of reusable components for Eiffel. ", "Based on WEL library for ISE Eiffel, used with permission. "
project: "Windows Eiffel Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997-2001 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
cluster: wel
class WEL_TOOL_BAR
inherit

WEL_CONTROL
redefine
set_text,
text,
text_length
end

WEL_TB_CONSTANTS
export
{NONE}
all
end

WEL_TB_STYLE_CONSTANTS
export
{NONE}
all
end

WEL_MAIN_ARGUMENTS
export
{NONE}
all
end
creation

make
feature {NONE}-- Initialization

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 -- Basic operations

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

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
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)

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

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

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

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

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

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)

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)

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)

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

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_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_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
feature -- Status report

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

tooltip: WEL_TOOLTIP
-- The tooltip associated with the toolbar
require
tooltip_exists: tooltip_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_checked (command_id: INTEGER): BOOLEAN
-- Is the button identified by `command_id' checked?
require
exists: exists

button_enabled (command_id: INTEGER): BOOLEAN
-- Is the button identified by `command_id' enabled?
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

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

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

last_bitmap_index: INTEGER
feature -- Element change

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 = button_count + 1

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
ensure
count_increased: button_count = button_count + buttons.count

add_bitmaps (bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
-- Add bitmaps.
require
exists: exists
bitmap_not_void: bitmap /= void
positive_bitmap_count: bitmap_count > 0
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 = button_count - 1
end -- class WEL_TOOL_BAR

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES