Example #1
0
/*------------------------------main_proc--------------------------------*/
long
main_proc (PFUNC_VAR)       
{        
  static int hExit, hCurPage=ID_NULL, hPage1, hPage2, hPage3, hPage4, hTest = ID_NULL;
  static YT_COLOR col1, col2, col3, col4;

  enum local_keys {
    DRAW_MESS = YKEY_LOCALS
  };

  switch (message) {       
  case YCREATE: 
    YSetDialog (dialog_proc);
    break;        
  case YOPEN: 
    col1 = YColor("fuchsia");
    col2 = YColor("white");
    col3 = YColor("blue");
    col4 = YColor("red");
  case YDRAW:       
    YPaintRectF (0,0, WND->w,WND->h, YColor("yellow"));        

    begin_group ("MESSAGES",    20,375, 440,55, YColor(""));
      YWnd (&hTest, testmsg_proc, "",  15,15, 385,30, 0,0,0,0, CLR_DEF);
    end_group ();

    YGoto (YDRAWITEM, 0,0,col1,(long)page1_proc);

    YWnd (&hPage1, push_proc, "Page1", 465, 20, 65,40, 0,0,0,0, col1);
    YWnd (&hPage2, push_proc, "Page2", 465, 70, 65,40, 0,0,0,0, col2);
    YWnd (&hPage3, push_proc, "Page3", 465,120, 65,40, 0,0,0,0, col3);
    YWnd (&hPage4, push_proc, "Page4", 465,170, 65,40, 0,0,0,0, col4);

    YWnd (&hExit,  push_proc, "Exit",  465,380, 65,40, 0,0,0,0, YColor("lime"));
    break;        
  case YDRAWITEM:       
   /*  YWndClose (hCurPage);  */
   /*  YUnWnd (hCurPage);  */       
    YWnd (&hCurPage, (YT_PFUNC)mes4, "", 20,20, 440,340, LP(hTest),0,0,0, (YT_COLOR)mes3); 
    break; 
  case YCLOSE:       
    YWndClean (id);        
    break; 
  case MYPUSH_UP:
    if      (mes1 == hExit )  exit(0); 
    else if (mes1 == hPage1)  YGoto (YDRAWITEM, 0,0,col1,(long)page1_proc);
    else if (mes1 == hPage2)  YGoto (YDRAWITEM, 0,0,col2,(long)page2_proc);
    else if (mes1 == hPage3)  YGoto (YDRAWITEM, 0,0,col3,(long)page3_proc);
    else if (mes1 == hPage4)  YGoto (YDRAWITEM, 0,0,col4,(long)page4_proc);
    break; 
  default:
    return (YSend (hTest, message, mes1,mes2,mes3,mes4)); 
  }       
  
  RETURN_TRUE; 
}
Example #2
0
const char * Nes_File_Writer::begin( Auto_File_Writer dw, nes_tag_t tag )
{
	out = dw;
	RETURN_ERR( out.open_comp() );
	return begin_group( tag );
}
Example #3
0
/*--------------------------------page1_proc------------------------------*/
long
page1_proc (PFUNC_VAR)       
{        
  YT_COLOR clr_text;
  static int hTest = ID_NULL;
  static int hMouse, hDialog;
  char     *shape[4] = {"arrow", "wait", "ibeam", "cross"};
  static int shape_i = 0;

  switch (message) {       
  case YOPEN: 
    hTest = *((int*)Y_WLONG1);
  case YDRAW:       
    YPaintRectFB (0,0,WND->w,WND->h, WIN->color, YColor("black"));        

    begin_group ("ABOUT", 20,30, 210,110, YColor("teal"));
      clr_text = YColor("white");
      YPaintString ("   'Library Yzone'    ", 20,20, clr_text);  
      YPaintString ("     version 0.2      ", 20,35, clr_text);  
      YPaintString (" Copyright (c) 2000   ", 20,60, clr_text);  
      YPaintString ("    Life Software.    ", 20,75, clr_text);  
      YPaintString ("  Under GNU License.  ", 20,90, clr_text);  
    end_group ();

    begin_group ("SORRY", 20,200, 210,90, YColor("teal"));
      clr_text = YColor("white");
      YPaintString ("     Sorry! Sorry!    ", 20,20, clr_text);  
      YPaintString ("  This demo example   ", 20,35, clr_text);  
      YPaintString ("          is          ", 20,50, clr_text);  
      YPaintString (" under constructions! ", 20,65, clr_text);  
    end_group ();

    begin_group("YDraw..", 240,30, 185,190, YColor("green")); 
    test_picture ();
    end_group ();

    YWnd (&hMouse,  push_proc, "Mouse",   250,240, 70,50, 0,0,0,0, CLR_DEF);
    YWnd (&hDialog, push_proc, "Dialog",  340,240, 70,50, 0,0,0,0, CLR_DEF);

    break;        
  case MYPUSH_DOWN:  
    if (mes1 == hMouse) {
      shape_i++;
      if (shape_i == 4) shape_i = 0;
      YMouseForm (shape[shape_i]);
    }
    if (mes1 == hDialog) {
      YDlg (dial_proc, "Dialog", 0,0,260,250, 0,0,0,0, CLR_DEF, TRUE); 
    }
    break;  
  case YRMOUSEUP:
    YBeep ();
    YBigWindow (NULL, dial_proc, "Big Window", 0,0,240,220, 0,0,0,0, CLR_DEF);
    break;
  case YCLOSE:       
    YWndClean (id);        
    break;  
  default:
   /*  OUTD(message); */
    YSend (hTest, message, mes1,mes2,mes3,mes4);
  }       
  
  RETURN_TRUE;
}