Subversion Repositories Kolibri OS

Rev

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