save_image_dlg_.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
源码类别:

生物技术

开发平台:

C/C++

  1. /*
  2.  * ===========================================================================
  3.  * PRODUCTION $Log: save_image_dlg_.cpp,v $
  4.  * PRODUCTION Revision 1000.1  2004/06/01 21:04:27  gouriano
  5.  * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.4
  6.  * PRODUCTION
  7.  * ===========================================================================
  8.  */
  9. // generated by Fast Light User Interface Designer (fluid) version 1.0105
  10. /* $Id: save_image_dlg_.cpp,v 1000.1 2004/06/01 21:04:27 gouriano Exp $ */
  11. #include <ncbi_pch.hpp>
  12. inline void CSaveImageDlg::cb_Browse_i(Fl_Button*, void*) {
  13.   x_OnBrowse();
  14. }
  15. void CSaveImageDlg::cb_Browse(Fl_Button* o, void* v) {
  16.   ((CSaveImageDlg*)(o->parent()->parent()->parent()->user_data()))->cb_Browse_i(o,v);
  17. }
  18. inline void CSaveImageDlg::cb_m_CustomSize_i(Fl_Check_Button*, void*) {
  19.   x_OnCustomSize();
  20. }
  21. void CSaveImageDlg::cb_m_CustomSize(Fl_Check_Button* o, void* v) {
  22.   ((CSaveImageDlg*)(o->parent()->parent()->parent()->user_data()))->cb_m_CustomSize_i(o,v);
  23. }
  24. Fl_Menu_Item CSaveImageDlg::menu_m_Format[] = {
  25.  {"Portable Network Graphics (PNG)", 0,  0, (void*)(m_Png), 0, 0, 0, 14, 56},
  26.  {"JPEG", 0,  0, (void*)(m_Jpeg), 0, 0, 0, 14, 56},
  27.  {0}
  28. };
  29. Fl_Menu_Item* CSaveImageDlg::m_Png = CSaveImageDlg::menu_m_Format + 0;
  30. Fl_Menu_Item* CSaveImageDlg::m_Jpeg = CSaveImageDlg::menu_m_Format + 1;
  31. inline void CSaveImageDlg::cb_OK_i(Fl_Return_Button*, void*) {
  32.   x_OnOK();
  33. }
  34. void CSaveImageDlg::cb_OK(Fl_Return_Button* o, void* v) {
  35.   ((CSaveImageDlg*)(o->parent()->parent()->user_data()))->cb_OK_i(o,v);
  36. }
  37. inline void CSaveImageDlg::cb_Cancel_i(Fl_Button*, void*) {
  38.   x_OnCancel();
  39. }
  40. void CSaveImageDlg::cb_Cancel(Fl_Button* o, void* v) {
  41.   ((CSaveImageDlg*)(o->parent()->parent()->user_data()))->cb_Cancel_i(o,v);
  42. }
  43. Fl_Double_Window* CSaveImageDlg::x_Create(void) {
  44.   Fl_Double_Window* w;
  45.   { Fl_Double_Window* o = new Fl_Double_Window(485, 310, "Save Image");
  46.     w = o;
  47.     o->user_data((void*)(this));
  48.     { Fl_Group* o = new Fl_Group(5, 5, 485, 265);
  49.       { Fl_Group* o = new Fl_Group(5, 15, 475, 75, "Output Location");
  50.         o->box(FL_ENGRAVED_FRAME);
  51.         o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
  52.         new Fl_Box(45, 50, 30, 25, "File");
  53.         m_Filename = new Fl_File_Input(90, 40, 280, 35);
  54.         { Fl_Button* o = new Fl_Button(375, 50, 75, 25, "Browse...");
  55.           o->callback((Fl_Callback*)cb_Browse);
  56.         }
  57.         o->end();
  58.       }
  59.       { Fl_Group* o = new Fl_Group(5, 95, 475, 120, "Scaling");
  60.         o->box(FL_ENGRAVED_BOX);
  61.         o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
  62.         { Fl_Group* o = m_CustomSizeGroup = new Fl_Group(15, 142, 455, 65);
  63.           { Fl_Value_Input* o = m_RasterWidth = new Fl_Value_Input(65, 152, 75, 25, "width");
  64.             o->minimum(1);
  65.             o->maximum(100000);
  66.             o->step(1);
  67.             o->value(1);
  68.           }
  69.           { Fl_Value_Input* o = m_RasterHeight = new Fl_Value_Input(210, 152, 75, 25, "height");
  70.             o->minimum(1);
  71.             o->maximum(100000);
  72.             o->step(1);
  73.             o->value(1);
  74.           }
  75.           { Fl_Check_Button* o = new Fl_Check_Button(65, 182, 25, 25, "constrain proportions");
  76.             o->down_box(FL_DOWN_BOX);
  77.           }
  78.           o->end();
  79.         }
  80.         { Fl_Check_Button* o = m_CustomSize = new Fl_Check_Button(34, 119, 25, 25, "Custom size");
  81.           o->down_box(FL_DOWN_BOX);
  82.           o->callback((Fl_Callback*)cb_m_CustomSize);
  83.         }
  84.         o->end();
  85.       }
  86.       o->end();
  87.     }
  88.     { Fl_Group* o = new Fl_Group(5, 219, 475, 55, "Output Format");
  89.       o->box(FL_ENGRAVED_FRAME);
  90.       o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
  91.       { Fl_Choice* o = m_Format = new Fl_Choice(90, 244, 280, 25);
  92.         o->down_box(FL_BORDER_BOX);
  93.         o->when(3);
  94.         Fl_Group::current()->resizable(o);
  95.         o->menu(menu_m_Format);
  96.       }
  97.       o->end();
  98.     }
  99.     { Fl_Group* o = new Fl_Group(5, 279, 480, 25);
  100.       { Fl_Return_Button* o = new Fl_Return_Button(400, 279, 80, 25, "OK");
  101.         o->callback((Fl_Callback*)cb_OK);
  102.       }
  103.       { Fl_Button* o = new Fl_Button(315, 279, 80, 25, "Cancel");
  104.         o->callback((Fl_Callback*)cb_Cancel);
  105.       }
  106.       { Fl_Group* o = new Fl_Group(10, 279, 300, 25);
  107.         o->end();
  108.         Fl_Group::current()->resizable(o);
  109.       }
  110.       o->end();
  111.     }
  112.     o->end();
  113.   }
  114.   return w;
  115. }