indexing
	description: "Objects that contain information about a dialog template."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_DLG_TEMPLATE

create 

	make
			-- Allocate item
			-- (from WEL_STRUCTURE)
		ensure -- from WEL_STRUCTURE
			not_shared: not shared

	make_with_global_alloc
			-- Allocate item with call to GlobalAlloc instead of malloc
		ensure
			not_shared: not shared

	make_by_pointer (a_pointer: POINTER)
			-- Set item with a_pointer.
			-- Since item is shared, it does not need
			-- to be freed.
			-- Caution: a_pointer must be a pointer
			-- coming from Windows.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = a_pointer
			shared: shared

feature -- Access

	cdit: INTEGER
			-- Number of items in dialog.

	cx: INTEGER
			-- Width of dialog.

	cy: INTEGER
			-- Height of dialog.

	dwextendedstyle: INTEGER
			-- Extended style of dialog.

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

	style: INTEGER
			-- Style of dialog.

	x: INTEGER
			-- X coordinate of dialog.

	y: INTEGER
			-- Y coordinate of dialog.
	
feature -- Measurement

	structure_size: INTEGER
			-- Size to allocate (in bytes)
		ensure -- from WEL_STRUCTURE
			positive_result: Result > 0
	
feature -- Status report

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

	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)
	
feature -- Status setting

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

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

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

	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

	initialize
			-- Fill Current with zeros.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	initialize_with_character (a_character: CHARACTER)
			-- Fill current with a_character.
		require -- from WEL_STRUCTURE
			exists: exists

	memory_copy (source_pointer: POINTER; length: INTEGER)
			-- Copy length bytes from source_pointer to item.
		require -- from WEL_STRUCTURE
			length_small_enough: length <= structure_size
			length_large_enough: length > 0
			exists: exists
	
feature -- Status setting.

	set_cdit (a_value: INTEGER)
			-- Assign a_value to cdit.

	set_cx (a_cx: INTEGER)
			-- Assign a_cx to x.

	set_cy (a_cy: INTEGER)
			-- Assign a_cy to cy.

	set_dwextendedstyle (a_style: INTEGER)
			-- Assign a_style to dwextendedstyle.

	set_style (a_style: INTEGER)
			-- Assign a_style to style.

	set_x (an_x: INTEGER)
			-- Assign an_x to x.

	set_y (a_y: INTEGER)
			-- Assign a_y to y.
	
invariant

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

end -- class WEL_DLG_TEMPLATE