Subversion Repositories Kolibri OS

Rev

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