Subversion Repositories Kolibri OS

Rev

Rev 617 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. struct POINT
  3.   X dd ?
  4.   Y dd ?
  5. ends
  6.  
  7. struct RECT
  8.   Left   dd ?
  9.   Top    dd ?
  10.   Right  dd ?
  11.   Bottom dd ?
  12. ends
  13.  
  14. struct TBOX
  15.   width  dw ?
  16.   x      dw ?
  17.   height dw ?
  18.   y      dw ?
  19.   sel.x  db ?
  20.   pos.x  db ?
  21.   ofs.x  db ?
  22.   length db ?
  23.   text   rb 255
  24. ends
  25.  
  26. struct SCROLLBAR
  27.   Top  dd ?
  28.   Size dd ?
  29. ends
  30.  
  31. struct EDITOR
  32.   FilePath       db PATHL dup(?)
  33.   FileName       dd ?
  34.   Bounds         RECT
  35.   Lines          dd ?
  36.   Lines.Size     dd ?
  37.   Lines.Count    dd ?
  38.   Columns.Count  dd ?
  39.   Caret          POINT
  40.   SelStart       POINT
  41.   TopLeft        POINT
  42.   VScroll        SCROLLBAR
  43.   HScroll        SCROLLBAR
  44.   Gutter.Width   dd ?
  45.   Gutter.Visible db ?
  46.   AsmMode        db ?
  47.   Modified       db ?
  48.                  db ?
  49. ends
  50.  
  51. struct TABITEM
  52.   Editor EDITOR
  53. ends
  54.  
  55. struct TABCTL
  56.   Bounds        RECT
  57.   Items         dd ?
  58.   Items.Count   dd ?
  59.   Items.Left    dd ?
  60.   Current       TABITEM
  61.   Current.Ptr   dd ?
  62.   Default.Ptr   dd ?
  63.   Buttons.First dd ?
  64.   Buttons.Last  dd ?
  65.   Style         db ?
  66.                 db 3 dup(?)
  67. ends
  68.  
  69.  
  70.  
  71. virtual at -20
  72.  POPUP:
  73.   .actions dd ?
  74.   .data    dd ?
  75.   .acc_ofs dd ?
  76.  .size:
  77.   .height  dw ?
  78.   .width   dw ?
  79.  .pos:
  80.   .y       dw ?
  81.   .x       dw ?
  82. end virtual
  83.  
  84. macro popup_res _name,[_lang,_title,_accel,_action]
  85. {
  86.   common
  87.     local s1,s2,m1,m2,c1,c2
  88.     m1 = 0
  89.     m2 = 0
  90.     c1 = 0
  91.     c2 = 0
  92.     if used _name
  93.       dd _name#.actions
  94.       dd _name#.data
  95.       dd ?
  96.       dw ?              ; height
  97.       dw ?              ; width
  98.       dw ?              ; y
  99.       dw ?              ; x
  100.       _name:
  101.   forward
  102.       if (lang eq _lang) | (_lang eq @!)
  103.         db 1
  104.       end if
  105.   common
  106.       .data:
  107.   forward
  108.       if (lang eq _lang) | (_lang eq @!)
  109.         if _title eq '-'
  110.           db 1,'-'
  111.           c2 = c2+2
  112.         else
  113.           virtual at 0
  114.             db _title
  115.             s1 = $
  116.           end virtual
  117.           if m1 < s1
  118.             m1 = s1
  119.           end if
  120.           virtual at 0
  121.             db _accel
  122.             s2 = $
  123.           end virtual
  124.           if m2 < s2
  125.             m2 = s2
  126.           end if
  127.           db s1,_title,s2,_accel
  128.           c1 = c1+1
  129.         end if
  130.       end if
  131.   common
  132.       db 0
  133.       align 4
  134.       .actions:
  135.   forward
  136.       if (lang eq _lang) | (_lang eq @!)
  137.         if (_action eq )
  138.           dd 0
  139.         else
  140.           dd _name#.#_action
  141.         end if
  142.       end if
  143.   common
  144.       .size      = $-_name+20
  145.       .max_title = m1
  146.       .max_accel = m2
  147.       .cnt_item  = c1
  148.       .cnt_sep   = c2
  149.       if (m2 = 0)
  150.         m2 = -2
  151.       end if
  152.       store word (m1*6+m2*6+6*8) at _name+POPUP.width
  153.       store word (c1*POP_IHEIGHT+c2*POP_SHEIGHT+4) at _name+POPUP.height
  154.       store dword (((m1+2)*6-1)*65536) at _name+POPUP.acc_ofs
  155.     end if
  156. }
  157.  
  158. macro menubar_res _name,[_lang,_title,_popup,_onshow]
  159. {
  160.   common
  161.     local s,m,c,x
  162.     m = 0
  163.     c = 0
  164.     x = 2
  165.     if used _name
  166.       _name:
  167.   forward
  168.       if lang eq _lang
  169.         virtual at 0
  170.           db _title
  171.           s = $
  172.         end virtual
  173.         if m < s
  174.           m = s
  175.         end if
  176.         dw (s+2)*6,x,ATOPH-1,0
  177.         db s,_title
  178.         c = c+1
  179.         x = x + (s+2)*6
  180.       end if
  181.   common
  182.       db 0
  183.       align 4
  184.       .popups:
  185.   forward
  186.       if lang eq _lang
  187.         dd _popup
  188.       end if
  189.   common
  190.       align 4
  191.       .onshow:
  192.   forward
  193.       if lang eq _lang
  194.         dd _onshow
  195.       end if
  196.   common
  197.       .size      = $-_name
  198.       .max_title = m
  199.       .cnt_item  = c
  200.       .width     = x-7
  201.     end if
  202. }
  203.  
  204. ;// OPTIONS
  205.  
  206. OPTS_SECURESEL  = 00000001b
  207. OPTS_AUTOBRACES = 00000010b
  208. OPTS_AUTOINDENT = 00000100b
  209. OPTS_SMARTTAB   = 00001000b
  210. OPTS_OPTIMSAVE  = 00010000b
  211. OPTS_LINENUMS   = 00100000b
  212.  
  213. ;// MOUSE EVENTS
  214.  
  215. MEV_LDOWN = 1
  216. MEV_LUP   = 2
  217. MEV_RDOWN = 3
  218. MEV_RUP   = 4
  219. MEV_WHEEL = 5
  220. MEV_MOVE  = 6
  221.  
  222. ;// KEY MODIFIERS
  223.  
  224. KM_SHIFT        = 0x00010000
  225. KM_CTRL         = 0x00020000
  226. KM_ALT          = 0x00040000
  227.  
  228. KM_CTRLSHIFT    = 0x00030000
  229. KM_ALTSHIFT     = 0x00050000
  230. KM_CTRLALT      = 0x00060000
  231.  
  232. KM_CTRLALTSHIFT = 0x00070000
  233.  
  234. ;// KEY CODES
  235.  
  236. KEY_ESCAPE      = 0x00000001
  237. KEY_SNAPSHOT    = 0x00000137
  238. KEY_PAUSE       = 0x0000021D
  239.  
  240. KEY_F1          = 0x0000003B
  241. KEY_F2          = 0x0000003C
  242. KEY_F3          = 0x0000003D
  243. KEY_F4          = 0x0000003E
  244. KEY_F5          = 0x0000003F
  245. KEY_F6          = 0x00000040
  246. KEY_F7          = 0x00000041
  247. KEY_F8          = 0x00000042
  248. KEY_F9          = 0x00000043
  249. KEY_F10         = 0x00000044
  250. KEY_F11         = 0x00000057
  251. KEY_F12         = 0x00000058
  252.  
  253. KEY_TILDE       = 0x00000029
  254. KEY_MINUS       = 0x0000000C
  255. KEY_EQUAL       = 0x0000000D
  256. KEY_BACKSPACE   = 0x0000000E
  257. KEY_TAB         = 0x0000000F
  258. KEY_SQBRACE1    = 0x0000001A
  259. KEY_SQBRACE2    = 0x0000001B
  260. KEY_SLASH1      = 0x00000035
  261. KEY_SLASH2      = 0x0000002B
  262. KEY_SEMICOLON   = 0x00000027
  263. KEY_QUOTE       = 0x00000028
  264. KEY_COMMA       = 0x00000033
  265. KEY_DOT         = 0x00000034
  266. KEY_SPACE       = 0x00000039
  267.  
  268. KEY_1           = 0x00000002
  269. KEY_2           = 0x00000003
  270. KEY_3           = 0x00000004
  271. KEY_4           = 0x00000005
  272. KEY_5           = 0x00000006
  273. KEY_6           = 0x00000007
  274. KEY_7           = 0x00000008
  275. KEY_8           = 0x00000009
  276. KEY_9           = 0x0000000A
  277. KEY_0           = 0x0000000B
  278.  
  279. KEY_A           = 0x0000001E
  280. KEY_B           = 0x00000030
  281. KEY_C           = 0x0000002E
  282. KEY_D           = 0x00000020
  283. KEY_E           = 0x00000012
  284. KEY_F           = 0x00000021
  285. KEY_G           = 0x00000022
  286. KEY_H           = 0x00000023
  287. KEY_I           = 0x00000017
  288. KEY_J           = 0x00000024
  289. KEY_K           = 0x00000025
  290. KEY_L           = 0x00000026
  291. KEY_M           = 0x00000032
  292. KEY_N           = 0x00000031
  293. KEY_O           = 0x00000018
  294. KEY_P           = 0x00000019
  295. KEY_Q           = 0x00000010
  296. KEY_R           = 0x00000013
  297. KEY_S           = 0x0000001F
  298. KEY_T           = 0x00000014
  299. KEY_U           = 0x00000016
  300. KEY_V           = 0x0000002F
  301. KEY_W           = 0x00000011
  302. KEY_X           = 0x0000002D
  303. KEY_Y           = 0x00000015
  304. KEY_Z           = 0x0000002C
  305.  
  306. KEY_CAPSLK      = 0x0000003A
  307. KEY_SCRLK       = 0x00000046
  308. KEY_NUMLK       = 0x00000069
  309.  
  310. KEY_RETURN      = 0x0000001C
  311. KEY_NUMRETURN   = 0x0000011C
  312.  
  313. KEY_LCONTROL    = 0x0000001D
  314. KEY_RCONTROL    = 0x0000011D
  315. KEY_LSHIFT      = 0x0000002A
  316. KEY_RSHIFT      = 0x00000036
  317. KEY_LALT        = 0x00000038
  318. KEY_RALT        = 0x00000138
  319.  
  320. KEY_LWIN        = 0x0000015B
  321. KEY_RWIN        = 0x0000015C
  322. KEY_APPS        = 0x0000015D
  323.  
  324. KEY_INSERT      = 0x00000152
  325. KEY_DELETE      = 0x00000153
  326. KEY_HOME        = 0x00000147
  327. KEY_END         = 0x0000014F
  328. KEY_PAGEUP      = 0x00000149
  329. KEY_PAGEDOWN    = 0x00000151
  330. KEY_UP          = 0x00000148
  331. KEY_LEFT        = 0x0000014B
  332. KEY_RIGHT       = 0x0000014D
  333. KEY_DOWN        = 0x00000150
  334.  
  335. KEY_DIVIDE      = 0x00000135
  336. KEY_MULTIPLY    = 0x00000037
  337. KEY_SUBTRACT    = 0x0000004A
  338. KEY_ADD         = 0x0000004E
  339. KEY_SEPARATOR   = 0x00000053
  340.  
  341. KEY_NUM1        = 0x0000004F
  342. KEY_NUM2        = 0x00000050
  343. KEY_NUM3        = 0x00000051
  344. KEY_NUM4        = 0x0000004B
  345. KEY_NUM5        = 0x0000004C
  346. KEY_NUM6        = 0x0000004D
  347. KEY_NUM7        = 0x00000047
  348. KEY_NUM8        = 0x00000048
  349. KEY_NUM9        = 0x00000049
  350. KEY_NUM0        = 0x00000052
  351.  
  352. ;// EXTENDED KEY CODES (MULTIMEDIA KEYBOARDS)
  353.  
  354. KEY_MYDOCUMENTS = 0x0000014C
  355. KEY_MYPICTURES  = 0x00000164
  356. KEY_MYMUSIC     = 0x0000013C
  357. KEY_MUTE        = 0x00000120
  358. KEY_PLAYPAUSE   = 0x00000122
  359. KEY_STOP        = 0x00000124
  360. KEY_VOLUMEUP    = 0x00000130
  361. KEY_VOLUMEDOWN  = 0x0000013E
  362. KEY_PREVSONG    = 0x00000110
  363. KEY_NEXTSONG    = 0x00000119
  364. KEY_MEDIA       = 0x0000016D
  365. KEY_MAIL        = 0x0000016C
  366. KEY_WEBHOME     = 0x00000132
  367. KEY_MESSENGER   = 0x00000105
  368.  
  369. KEY_CALCULATOR  = 0x00000121
  370. KEY_LOGOFF      = 0x00000116
  371. KEY_SLEEP       = 0x0000015F