Advertisement
DestBro

Untitled

Sep 25th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. import base.win;
  2. import base.gui;
  3.  
  4. EditBox edit;
  5. EditBox editML;
  6. CheckBox checkBtn1, checkBtn2;
  7. ComboBox combo;
  8. ListBox list;
  9. Dialog ref dlg;
  10.  
  11. void close(Dialog ref dlg, int lparam){}
  12.  
  13. int gCountTimr = 0;
  14. int pressCount = 0;
  15. void timeEvent(Dialog ref dlg, int lparam)
  16. {
  17. if(gCountTimr == 5)
  18. {
  19. Beep(1000, 1000);
  20. dlg.KillTimer(timeEvent);
  21. }else Beep(1000, 500);
  22. gCountTimr++;
  23. }
  24.  
  25. void pressBtn(Dialog ref dlg, int lparam){
  26. Beep(1000, 400);
  27. pressCount++;
  28. edit.SetText("нажали "+pressCount.str()+" раз");
  29. editML.SetText("check1: "+ int(checkBtn1.IsChecked()).str()+"\r\n"+
  30. "check2: "+ int(checkBtn2.IsChecked()).str()+"\r\n"
  31. ); }
  32.  
  33. void pressCBtn(Dialog ref dlg, int lparam)
  34. {
  35. checkBtn2.GetHWND().Enable(checkBtn1.IsChecked());
  36. }
  37.  
  38. void selCombo(Dialog ref dlg, int lparam)
  39. {
  40. checkBtn2.GetHWND().Enable(true);
  41. }
  42.  
  43. void selList(Dialog ref dlg, int lparam)
  44. {
  45. checkBtn2.GetHWND().Enable(true);
  46. }
  47.  
  48. dlg = CreateDialog("test Dlg", 100, 100, 300, 200, close);
  49.  
  50.  
  51. dlg.AddTimer(1000, timeEvent, 0);
  52. dlg.AddButton("test", 10,10, 30,15,pressBtn, 0);
  53. dlg.AddStatic("static text", 10,30, 30,35);
  54. dlg.AddStatic("static:", 50,10, 30,35);
  55. edit = dlg.AddEdit("edit", 80,10, 80, 20);
  56. editML = dlg.AddEditMultiLine("edit\r\nMulti Line\r\ntt", 80,30, 100, 80);
  57. checkBtn1= dlg.AddCheckBox("Check 1", 12, 75, 60, 15, pressCBtn, 0);
  58. checkBtn2= dlg.AddCheckBox("Check2", 12, 95, 60, 15, pressCBtn, 0);
  59. combo = dlg.AddComboBox(20,120, 100,247, selCombo);
  60. dlg.AddGroupBox("Group box",5, 58, 73, 60);
  61. checkBtn2.GetHWND().Enable(false);
  62. checkBtn2.Checked(true);
  63.  
  64. list = dlg.AddListBox(120,120, 100,37, selList);
  65.  
  66. dlg.AddRadioButton("radio 1", 180,10, 80,15,pressBtn, 0, true);
  67. dlg.AddRadioButton("radio 2", 180,30, 80,15,pressBtn,0).Checked(true);
  68. dlg.AddRadioButton("radio 3", 180,50, 80,15,pressBtn,0);
  69.  
  70. dlg.AddRadioButton("radio g1", 180,80, 80,15,pressBtn,0, true);
  71. dlg.AddRadioButton("radio g2", 180,100, 80,15,pressBtn,0).Checked(true);
  72.  
  73. list.Add("Item 1");
  74. list.Add("Item 2");
  75. list.Add("Item 3");
  76. list.SetCurSel(1);
  77. //list.Select("Item 3");
  78. //list.Delete(1);
  79. combo.Add("Item 1 f fe");
  80. combo.Add("Item 2");
  81. combo.Add("Item 3");
  82. combo.Select("Item 3");
  83. combo.Insert("insert", 0);
  84. combo.SetCurSel(1);
  85. combo.Delete(1);
  86.  
  87. /*
  88. char[] nameF;
  89. bool r = dlg.SaveFile(nameF,"*.nc");*/
  90.  
  91.  
  92. dlg.Show(true);
  93. dlg.WaitClose();
  94. return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement