<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://stlab.adobe.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://stlab.adobe.com/wiki/index.php?title=Message_Box_Widget&amp;feed=atom&amp;action=history</id>
		<title>Message Box Widget - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://stlab.adobe.com/wiki/index.php?title=Message_Box_Widget&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=Message_Box_Widget&amp;action=history"/>
		<updated>2013-05-20T01:42:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://stlab.adobe.com/wiki/index.php?title=Message_Box_Widget&amp;diff=1440&amp;oldid=prev</id>
		<title>FosterBrereton: initial population</title>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=Message_Box_Widget&amp;diff=1440&amp;oldid=prev"/>
				<updated>2006-06-21T22:33:19Z</updated>
		
		<summary type="html">&lt;p&gt;initial population&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Basic Description==&lt;br /&gt;
&lt;br /&gt;
A message box widget can be bound to the error handling or other message display mechanism to provide the user with runtime information about the state of the dialog.&lt;br /&gt;
&lt;br /&gt;
==Semantics / Rationale==&lt;br /&gt;
&lt;br /&gt;
The rationale for the widget is that there needs to be a feature rich static text field that is very flexible about its size, content, and visibility. These are not features we want to add to the static_text_t widget currently, as that goes beyond the semantic intent of that widget. This is more or less a warning indicator with text that comes and goes as warnings should be presented to the user.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
* It must be able to change content dynamically&lt;br /&gt;
* When there is no message to be displayed the widget should not only be invisible, but it should have no &amp;quot;placeholder&amp;quot; space in the layout. That is, when it does become visible it should &amp;quot;grow&amp;quot; into the location that it is to occupy.&lt;br /&gt;
* It must be able to respond to user intervention, in case there is a desired behavior as a result of the user acknowledging the warning.&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct message_box_t&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  message_box_t(adobe::theme_t theme);&lt;br /&gt;
&lt;br /&gt;
  adobe::extents_t measure();&lt;br /&gt;
  void set_bounds(const point2d_t&amp;amp;, const extents_t&amp;amp;);&lt;br /&gt;
&lt;br /&gt;
  void set_field_text(const std::string&amp;amp; text); // set_name?&lt;br /&gt;
&lt;br /&gt;
  // should there be an activate call as well? I don't think there should&lt;br /&gt;
  // be as there isn't a meaning to a deactivated, yet visible, message box&lt;br /&gt;
&lt;br /&gt;
  void set_visible(bool make_visible);&lt;br /&gt;
&lt;br /&gt;
  // used to call back to the client when the message box is clicked on&lt;br /&gt;
  // possible behaviors might include resetting the value that triggered&lt;br /&gt;
  // the warning to a last known good value.&lt;br /&gt;
  void set_hit_proc(adobe::implementation::hit_callback_proc_t proc);&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
  implementation_t* object_m;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===API Considerations===&lt;br /&gt;
&lt;br /&gt;
* Do we want to have some kind of icon support, like 3 or 4 different types of icons one could attach to the message box as well as a piece of text?&lt;br /&gt;
** RalphThomas: Icon is a specialization of [[Picture View]].&lt;br /&gt;
* How do we trigger a re-layout of the view? Should we have a callback set within message_box_t that is called whenever the visibility changes, or should the relayout be an issue handled by the same client that set the visibility? I'm guessing it'll be the latter.&lt;br /&gt;
* How do we handle the fact that the metrics of the widget change at runtime? Eve doesn't call calculate upon relayout, does it?&lt;br /&gt;
** RalphThomas: it does for evaluate, but not for adjust.&lt;br /&gt;
&lt;br /&gt;
==Other Issues==&lt;br /&gt;
&lt;br /&gt;
RalphThomas thinks that this current proposal combines the optional panel, a dynamic_text and a way to bind to an invariant violation. Would the following be more useful?&lt;br /&gt;
&lt;br /&gt;
* some kind of [http://www.missioncode.org/index.fcgi/wiki/WidgetDocumentation dynamic_text] widget.&lt;br /&gt;
* allow binding to an invariant, flag it when it's violated (is this already possible?)&lt;br /&gt;
* a way to determine which cell caused the violation if the invariant is complicated; or just have simple invariants like in the example below.&lt;br /&gt;
&lt;br /&gt;
It might look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sheet errortest {&lt;br /&gt;
  interface:&lt;br /&gt;
    width  : 800 ;&lt;br /&gt;
    height : 600 ;&lt;br /&gt;
  output:&lt;br /&gt;
    result &amp;lt;== { w: @width, h: @height } ;&lt;br /&gt;
  invariant:&lt;br /&gt;
    width_max  &amp;lt;== width  &amp;lt;= 300000 ;&lt;br /&gt;
    height_max &amp;lt;== height &amp;lt;= 300000 ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
dialog( name: &amp;quot;error test&amp;quot;, placement: place_column ) {&lt;br /&gt;
  row() {&lt;br /&gt;
    optional( bind: @width_max ) { picture( image: &amp;quot;error.png&amp;quot; ); }&lt;br /&gt;
    edit_number( name: &amp;quot;Width:&amp;quot;, bind: @width );&lt;br /&gt;
  }&lt;br /&gt;
  row() {&lt;br /&gt;
    optional( bind: @height_max ) { picture( image: &amp;quot;error.png&amp;quot; ); }&lt;br /&gt;
    edit_number( name: &amp;quot;Height:&amp;quot;, bind: @height );&lt;br /&gt;
  }&lt;br /&gt;
  button( action: @ok, name: &amp;quot;OK&amp;quot;, bind: @result );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you could do the above right now if there was a way to make the optional panel show when the thing it was bound to went inactive...&lt;br /&gt;
&lt;br /&gt;
If we had a way to style a widget (color, etc) then we could make the offending edit_number turn red instead of showing an image next to it.&lt;br /&gt;
&lt;br /&gt;
''What other issues will need consideration?''&lt;br /&gt;
&lt;br /&gt;
==Related Work==&lt;br /&gt;
&lt;br /&gt;
''What additional code must be written to support this widget? What platform implementations / APIs can be leveraged when implementing this widget?''&lt;/div&gt;</summary>
		<author><name>FosterBrereton</name></author>	</entry>

	</feed>