Subversion Repositories Kolibri OS

Rev

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