virtual BOOL on_event (HELEMENT he, HELEMENT target, BEHAVIOR_EVENTS type, UINT_PTR reason ) 
 {
   if( type == VISIUAL_STATUS_CHANGED )
   {
     if(reason /* shown */)
       HTMLayoutSetTimer( he, 1000 ); // set one second timer      
     else
       HTMLayoutSetTimer( he, 0 ); // remove timer
   }
   return false;
 }
Ejemplo n.º 2
0
 virtual BOOL on_event (HELEMENT he, HELEMENT target, BEHAVIOR_EVENTS type, UINT_PTR reason ) 
 {
   if( type == VISIUAL_STATUS_CHANGED )
   {
     if(reason /* shown */)
     {
       step = 0;
       HTMLayoutSetTimer( he, 10 ); // set 10 milliseconds timer 
     }
     else
     {
       step = steps - 1;
       HTMLayoutSetTimer( he, 0 ); // remove timer
     }
   }
   return false;
 }
Ejemplo n.º 3
0
    virtual void attached  (HELEMENT he ) 
    { 
      super::attached(he);
      dom::element el = he;
      if(el.visible())
        HTMLayoutSetTimer( he, 10 ); // animation timer      

      // get data for our chart:
      const wchar_t* data_selector = el.get_attribute("data");
      if( data_selector )
      {
        dom::element root = el.root();
        dom::element del = root.find_first(data_selector);
        if(del.is_valid())
          data = del.get_value(); // if it is <script type="application/json"> then the value is parsed automatically.
      }
    } 
    virtual void attached  (HELEMENT he ) 
    { 
      super::attached(he);
      dom::element el = he;
      if(el.visible())
        HTMLayoutSetTimer( he, 1000 ); // set one second timer      

      json::string url = el.url(L"clock-images/seconds-head.png");
      aux::wchars  url_chars = url;
      if( url_chars.like(L"file://*") )
        url_chars.prune(7);

      aux::mm_file imf;
      if( imf.open( url_chars.start ))
      {
         pimage = htmlayout::image::load( imf.bytes() );
      }
    } 
 virtual void detached  (HELEMENT he ) 
 { 
   HTMLayoutSetTimer( he, 0 ); // remove timer
 } 
 virtual void attached  (HELEMENT he ) 
 { 
   dom::element el = he;
   if(el.visible())
     HTMLayoutSetTimer( he, 1000 ); // set one second timer      
 } 
Ejemplo n.º 7
0
 virtual void detached  (HELEMENT he ) 
 { 
   HTMLayoutSetTimer( he, 0 ); // remove timer if any
   data.clear();
   super::detached(he);
 }