ホーム › UI.Controls.RichEdit › TABLECELLPARMS
TABLECELLPARMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dxWidth | INT | 4 | +0 | +0 | セルの幅 (\cellx)。 |
| _bitfield | WORD | 2 | +4 | +4 | セルの配置や境界などの属性を格納するビットフィールド。 |
| wShading | WORD | 2 | +6 | +6 | 0.01% 単位のシェーディング (\clshdng)。これは、セルの背景色を作成するために使用されるパターン前景色 (crForePat) とパターン背景色 (crBackPat) の割合を制御します。wShading が 0 の場合、セルの背景は crBackPat になります。10000 の場合、セルの背景は crForePat になります。その中間の wShading の値では、2 つのパターン色が混合されます。 |
| dxBrdrLeft | SHORT | 2 | +8 | +8 | 左罫線の幅 (twip 単位) (\clbrdrl\brdrwN)。 |
| dyBrdrTop | SHORT | 2 | +10 | +10 | 上罫線の幅 (\clbrdrt\brdrwN)。 |
| dxBrdrRight | SHORT | 2 | +12 | +12 | 右罫線の幅 (\clbrdrr\brdrwN)。 |
| dyBrdrBottom | SHORT | 2 | +14 | +14 | 下罫線の幅 (\clbrdrb\brdrwN)。 |
| crBrdrLeft | COLORREF | 4 | +16 | +16 | 左罫線の色 (\clbrdrl\brdrcf)。 |
| crBrdrTop | COLORREF | 4 | +20 | +20 | 上罫線の色 (\clbrdrt\brdrcf)。 |
| crBrdrRight | COLORREF | 4 | +24 | +24 | 右罫線の色 (\clbrdrr\brdrcf)。 |
| crBrdrBottom | COLORREF | 4 | +28 | +28 | 下罫線の色 (\clbrdrb\brdrcf)。 |
| crBackPat | COLORREF | 4 | +32 | +32 | 背景色 (\clcbpat)。 |
| crForePat | COLORREF | 4 | +36 | +36 | 前景色 (\clcfpat)。 |
公式ドキュメント
テーブル行内のセルの属性を定義します。この定義には、対応するリッチ テキスト形式 (RTF) の制御ワードが含まれます。制御ワードは Rich Text Format (RTF) Specification で定義されています。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// TABLECELLPARMS (x64 40 / x86 40 バイト)
typedef struct TABLECELLPARMS {
INT dxWidth;
WORD _bitfield;
WORD wShading;
SHORT dxBrdrLeft;
SHORT dyBrdrTop;
SHORT dxBrdrRight;
SHORT dyBrdrBottom;
COLORREF crBrdrLeft;
COLORREF crBrdrTop;
COLORREF crBrdrRight;
COLORREF crBrdrBottom;
COLORREF crBackPat;
COLORREF crForePat;
} TABLECELLPARMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TABLECELLPARMS
{
public int dxWidth;
public ushort _bitfield;
public ushort wShading;
public short dxBrdrLeft;
public short dyBrdrTop;
public short dxBrdrRight;
public short dyBrdrBottom;
public uint crBrdrLeft;
public uint crBrdrTop;
public uint crBrdrRight;
public uint crBrdrBottom;
public uint crBackPat;
public uint crForePat;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TABLECELLPARMS
Public dxWidth As Integer
Public _bitfield As UShort
Public wShading As UShort
Public dxBrdrLeft As Short
Public dyBrdrTop As Short
Public dxBrdrRight As Short
Public dyBrdrBottom As Short
Public crBrdrLeft As UInteger
Public crBrdrTop As UInteger
Public crBrdrRight As UInteger
Public crBrdrBottom As UInteger
Public crBackPat As UInteger
Public crForePat As UInteger
End Structureimport ctypes
from ctypes import wintypes
class TABLECELLPARMS(ctypes.Structure):
_fields_ = [
("dxWidth", ctypes.c_int),
("_bitfield", ctypes.c_ushort),
("wShading", ctypes.c_ushort),
("dxBrdrLeft", ctypes.c_short),
("dyBrdrTop", ctypes.c_short),
("dxBrdrRight", ctypes.c_short),
("dyBrdrBottom", ctypes.c_short),
("crBrdrLeft", wintypes.DWORD),
("crBrdrTop", wintypes.DWORD),
("crBrdrRight", wintypes.DWORD),
("crBrdrBottom", wintypes.DWORD),
("crBackPat", wintypes.DWORD),
("crForePat", wintypes.DWORD),
]#[repr(C)]
pub struct TABLECELLPARMS {
pub dxWidth: i32,
pub _bitfield: u16,
pub wShading: u16,
pub dxBrdrLeft: i16,
pub dyBrdrTop: i16,
pub dxBrdrRight: i16,
pub dyBrdrBottom: i16,
pub crBrdrLeft: u32,
pub crBrdrTop: u32,
pub crBrdrRight: u32,
pub crBrdrBottom: u32,
pub crBackPat: u32,
pub crForePat: u32,
}import "golang.org/x/sys/windows"
type TABLECELLPARMS struct {
dxWidth int32
_bitfield uint16
wShading uint16
dxBrdrLeft int16
dyBrdrTop int16
dxBrdrRight int16
dyBrdrBottom int16
crBrdrLeft uint32
crBrdrTop uint32
crBrdrRight uint32
crBrdrBottom uint32
crBackPat uint32
crForePat uint32
}type
TABLECELLPARMS = record
dxWidth: Integer;
_bitfield: Word;
wShading: Word;
dxBrdrLeft: Smallint;
dyBrdrTop: Smallint;
dxBrdrRight: Smallint;
dyBrdrBottom: Smallint;
crBrdrLeft: DWORD;
crBrdrTop: DWORD;
crBrdrRight: DWORD;
crBrdrBottom: DWORD;
crBackPat: DWORD;
crForePat: DWORD;
end;const TABLECELLPARMS = extern struct {
dxWidth: i32,
_bitfield: u16,
wShading: u16,
dxBrdrLeft: i16,
dyBrdrTop: i16,
dxBrdrRight: i16,
dyBrdrBottom: i16,
crBrdrLeft: u32,
crBrdrTop: u32,
crBrdrRight: u32,
crBrdrBottom: u32,
crBackPat: u32,
crForePat: u32,
};type
TABLECELLPARMS {.bycopy.} = object
dxWidth: int32
_bitfield: uint16
wShading: uint16
dxBrdrLeft: int16
dyBrdrTop: int16
dxBrdrRight: int16
dyBrdrBottom: int16
crBrdrLeft: uint32
crBrdrTop: uint32
crBrdrRight: uint32
crBrdrBottom: uint32
crBackPat: uint32
crForePat: uint32struct TABLECELLPARMS
{
int dxWidth;
ushort _bitfield;
ushort wShading;
short dxBrdrLeft;
short dyBrdrTop;
short dxBrdrRight;
short dyBrdrBottom;
uint crBrdrLeft;
uint crBrdrTop;
uint crBrdrRight;
uint crBrdrBottom;
uint crBackPat;
uint crForePat;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TABLECELLPARMS サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dxWidth : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; _bitfield : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wShading : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; dxBrdrLeft : SHORT (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; dyBrdrTop : SHORT (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; dxBrdrRight : SHORT (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; dyBrdrBottom : SHORT (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; crBrdrLeft : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; crBrdrTop : COLORREF (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; crBrdrRight : COLORREF (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; crBrdrBottom : COLORREF (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; crBackPat : COLORREF (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; crForePat : COLORREF (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TABLECELLPARMS
#field int dxWidth
#field short _bitfield
#field short wShading
#field short dxBrdrLeft
#field short dyBrdrTop
#field short dxBrdrRight
#field short dyBrdrBottom
#field int crBrdrLeft
#field int crBrdrTop
#field int crBrdrRight
#field int crBrdrBottom
#field int crBackPat
#field int crForePat
#endstruct
stdim st, TABLECELLPARMS ; NSTRUCT 変数を確保
st->dxWidth = 100
mes "dxWidth=" + st->dxWidth