📄 sys-graphics.zc
字号:
//[of]:description
//[c]Private part of the implementation of the graphics classes
//[cf]
//[of]:license
//[c] Code Browser - a folding text editor for programmers
//[c] Copyright (C) 2003-07 Marc Kerbiquet
//[c]
//[c] This program is free software; you can redistribute it and/or modify
//[c] it under the terms of the GNU General Public License as published by
//[c] the Free Software Foundation; either version 2 of the License, or
//[c] (at your option) any later version.
//[c]
//[c] This program is distributed in the hope that it will be useful,
//[c] but WITHOUT ANY WARRANTY; without even the implied warranty of
//[c] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//[c] GNU General Public License for more details.
//[c]
//[c] You should have received a copy of the GNU General Public License
//[c] along with this program; if not, write to the Free Software
//[c] Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//[cf]
//[of]:imports
import "base/types"
//[c]
import "win32/windows"
//[cf]
//[c]
//[of]:point
public struct point
x: int
y: int
end
//[cf]
//[of]:rectangle
public struct rectangle
x: int
y: int
w: int
h: int
end
//[cf]
//[c]
//[of]:sys font
//[c]
public struct sys font
hFont: HFONT
end
//[cf]
//[of]:sys cursor
//[c]
public struct sys cursor
hCursor: HCURSOR
end
//[cf]
//[of]:sys brush
//[c]
public struct sys brush
to delete: bool
hbr: HBRUSH
end
//[c]
//[of]:brush from handle (handle)
//[c]
public func brush from handle (handle: HBRUSH, m: sys brush)
hbr (m) = handle
to delete (m) = false
end
//[cf]
//[cf]
//[of]:sys canvas
//[c]
public struct sys canvas
the font: sys font
release dc: bool
hdc: HDC
hNullPen: HPEN
hOldPen: HPEN
end
//[c]
//[c]
public func initialize (m: sys canvas, handle: HDC)
the font (m) = nil
release dc (m) = false
hdc (m) = handle
hNullPen (m) = CreatePen(PS_NULL, 0, 255:d)
hOldPen (m) = SelectObject(hdc (m), hNullPen (m))
end
//[c]
public func initialize (m: sys canvas)
the font (m) = nil
release dc (m) = true
hdc (m) = GetDC (nil)
hNullPen (m) = CreatePen(PS_NULL, 0, 255:d)
hOldPen (m) = SelectObject (hdc (m), hNullPen (m))
end
//[cf]
//[c]
//[of]:color conversion routines
//[of]:win color (color)
//[c]Converts rgb color to window color
//[c]
public equ win color (color: dword) =
((color&255:d)<<16) | (color&0xFF00:d) | (color>>16)
//[cf]
//[of]:rgb color (color)
//[c]Converts window color to rgb color
//[c]
public equ rgb color (color: dword) =
((color&255:d)<<16) | (color&0xFF00:d) | (color>>16)
//[cf]
//[cf]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -