indexing
	description: "Interface on the MessageBox function."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_MSG_BOX

create 

	make
			-- initialize language

feature -- Status report

	flag_set (flags, mask: INTEGER): BOOLEAN
			-- Is mask set in flags?
			-- (from WEL_BIT_OPERATIONS)

	language: INTEGER
			-- Actual language for "push buttons"

	message_box_result: INTEGER
			-- Last result for all xxx_message_box routines.
			-- See class WEL_ID_CONSTANTS for values.

	sublanguage: INTEGER
			-- Sublanguage of language for "push buttons"
	
feature -- Basic operations

	basic_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style: INTEGER)
			-- Show a basic message box with a_text inside and
			-- a_title using a_style. Basic means a_style should not contain
			-- the flag MB_USERICON.
			-- See class WEL_MB_CONSTANTS for a_style value.
		require
			basic_message_box: basic_msg_box (a_style)
			text_not_void: a_text /= void
			title_not_void: a_title /= void

	clear_flag (flags, mask: INTEGER): INTEGER
			-- Clear the mask in flags
			-- (from WEL_BIT_OPERATIONS)
		ensure -- from WEL_BIT_OPERATIONS
			flag_unset: not flag_set (Result, mask)

	error_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
			-- Show an error message box with message a_text
			-- and caption a_title
		require
			text_not_void: a_text /= void
			title_not_void: a_title /= void

	information_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
			-- Show an information message box with message a_text
			-- and caption a_title
		require
			text_not_void: a_text /= void
			title_not_void: a_title /= void

	make
			-- initialize language

	question_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
			-- Show a question message box with message a_text
			-- and caption a_title
		require
			text_not_void: a_text /= void
			title_not_void: a_title /= void

	set_flag (flags, mask: INTEGER): INTEGER
			-- Set the mask in flags
			-- (from WEL_BIT_OPERATIONS)
		ensure -- from WEL_BIT_OPERATIONS
			flag_set: flag_set (Result, mask)

	set_language (a_language_id, a_sublanguage_id: INTEGER)
			-- set language to a_language_id
			-- and sublanguage to a_sublanguage_id
		require
			valid_langid: a_language_id > 0
			valid_sublangid: a_sublanguage_id > 0
		ensure
			language_set: language = a_language_id
			sublanguage_set: sublanguage = a_sublanguage_id

	user_icon_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style, an_id: INTEGER)
			-- Show a message box with a user icon an_id,
			-- a_text inside and a_title using a_style.
			-- the flag MB_USERICON must be present in a_style.
			-- See class WEL_MB_CONSTANTS for a_style value.
		require
			user_message_box: not basic_msg_box (a_style)
			text_not_void: a_text /= void
			title_not_void: a_title /= void

	warning_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
			-- Show a warning message box with message a_text
			-- and caption a_title
		require
			text_not_void: a_text /= void
			title_not_void: a_title /= void
	
feature -- Implementation

	basic_msg_box (a_style: INTEGER): BOOLEAN
			-- does a_style contain the flag Mb_usericon?
	
invariant

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

end -- class WEL_MSG_BOX