?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. IDOK = 1
  2. IDCANCEL = 2
  3.  
  4. -- IDC numbers can be any custom name and value
  5. IDC_BUTTON1 = 100
  6. IDC_TEXT1 = 101
  7. IDC_DROPLIST1 = 102
  8. IDC_EDITLABEL1 = 199
  9.  
  10. -- Types
  11. BUTTON = 128
  12. EDIT = 129
  13. STATIC = 130
  14. LISTBOX = 131
  15. SCROLLBOX = 132
  16. COMBOBOX = 133
  17.  
  18. -- Styles
  19. WS_DefButton = 1342177281
  20. WS_Button = 1342177280
  21. WS_Static = 1342177280
  22. WS_Text = 1342308352
  23. WS_Edit = 1350631424
  24. WS_Combobox = 1344339971
  25.  
  26. function main ()
  27.  dlgproc = mappy.getValue (mappy.MAPWINPATH).."luascr\\Dialogue Proc.lua"
  28. --    mappy.msgBox(dlgproc, "Test", mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
  29.  
  30.  NUMCONTROLS = 6 -- Important, must be number of calls to 'addDialogueItem'
  31.  
  32.  mappy.createDialogue  ("Test Dialogue", 0, 10, 10, 300, 200, NUMCONTROLS)
  33.  
  34.  mappy.addDialogueItem ("Edit field", WS_Text, 80, 17, 50, 14, IDC_EDITLABEL1, STATIC)
  35.  mappy.addDialogueItem ("Change this text", WS_Edit, 132, 14, 100, 14, IDC_TEXT1, EDIT)
  36.  mappy.addDialogueItem ("Button 1", WS_Button, 10, 10, 50, 20, IDC_BUTTON1, BUTTON)
  37.  mappy.addDialogueItem ("List", WS_Combobox, 10, 40, 250, 100, IDC_DROPLIST1, COMBOBOX)
  38.  mappy.addDialogueItem ("Cancel", WS_Button, 236, 170, 50, 20, IDCANCEL, BUTTON)
  39.  mappy.addDialogueItem ("OK", WS_DefButton, 200, 170, 30, 20, IDOK, BUTTON)
  40.  
  41.  mappy.doDialogue (dlgproc)
  42. end
  43.  
  44. test, errormsg = pcall( main )
  45. if not test then
  46.     mappy.msgBox("Error ...", errormsg, mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
  47. end
  48.  
  49.