構文
BOOL GetSlip(BSTR * szStr, double *dXPos, double *dYPos, BSTR * szFontName,
double * dHeight, BYTE * byFontAttr,
BYTE * byAlign, double * dAngle, OLE_COLOR * ocFontColor, BYTE * byLineStyle, BYTE * byLineWidth,
OLE_COLOR crLineColor, BYTE * byHatchStyle, BYTE * byHatchWidth, OLE_COLOR * crForeColor,
OLE_COLOR * crBackColor, USHORT * bBackTrans, BSTR * szPictureName,
USHORT * uPictureWidth,
USHORT * uPictureHeight, USHORT * uPicturePos);
(JavaScript用) string GetSlipJS();
カレントのオブジェクトが、付箋の場合、その情報を取得します。
パラメータ
szStr
文字列。
dXPos
配置位置X座標。
dYPos
配置位置Y座標。
szFontName
フォント名。
dHeight
フォントサイズ。
byFontAttr
フォント属性。次のフラグの任意の組み合わせです。
- 1斜体。
- 2太字。
- 4下線。
byAlign
位置合わせ。次のフラグの組み合わせです。
- 0水平方向/左寄せ。
- 1水平方向/中央。
- 2水平方向/右寄せ。
- 0垂直方向/上寄せ。
- 16垂直方向/中央。
- 32垂直方向/下寄せ。
dAngle
文字の角度。
crFontColor
文字の色。
byLineWidth
付箋のフチの線幅。
crLineColor
付箋のフチの線色。
byHatchStyle
付箋の模様の種類。次のいずれかの値です。
- 0なし。
- 1塗りつぶし。
- 2水平ハッチ。
- 3垂直ハッチ。
- 4右下がりハッチ。
- 5右上がりハッチ。
- 6水平と垂直の格子ハッチ。
- 7斜め格子ハッチ。
- 8ドット1。
- 9ドット2。
- 10ドット3。
- 11ウェーブ1。
- 12ウェーブ2。
- 13ウェーブ3。
- 14斜線1。
- 15斜線2。
- 16破線1。
- 17破線2。
- 18板目。
- 19グラデーション横1。
- 20グラデーション横2。
- 21グラデーション縦1。
- 22グラデーション縦2。
- 23グラデーション右上。
- 24グラデーション左上。
- 25グラデーション中心。
- 26グラデーション右上。
- 27グラデーション右下。
- 30半透明。
- 40水平ハッチ。2の水平ハッチより目が細かい。
- 41垂直ハッチ。3の垂直ハッチより目が細かい。
- 42水平と垂直の格子ハッチ。6のハッチより目が細かい。
crForeColor
付箋の前景色。
crBackColor
付箋の背景色。
bBackTrans
付箋の背景を透明にするかどうか。0で不透明、1で透明。
szPictureName
付箋につける画像ファイル名。フルパス。
uPictureWidth
付箋につける画像の幅。
uPictureHeight
付箋につける画像の高さ。
uPicturePos
画像の位置。次のいずれかの値です。
- 1左上。
- 2左中。
- 3左下。
- 4右上。
- 5右中。
- 6右下。
戻り値
付箋の情報を取得できた場合 0 以外を返します。できなかった場合は 0 を返します。
使用例
// 間取りオブジェクトへ接続
CMadoriDoc * m_MadoriDoc = new CMadoriDoc();
CLSIDFromProgID (L"MyHomeDesignerMadori.MadoriDoc", &clsid);
GetActiveObject (clsid, NULL, &pUnk);
pUnk->QueryInterface (IID_IDispatch, (void**)(&pDisp));
m_MadoriDoc->AttachDispatch (pDisp);
// 列挙する
long lRet = m_MadoriDoc->GetTopObject();
if(lRet == 0) AfxMessageBox(TEXT("何もない"));
while(lRet){
ULONG uType = m_MadoriDoc->GetCurrentObjectType();
short nLayer = m_MadoriDoc->GetCurrentObjectLayer();
CString strMsg;
strMsg.Format(TEXT("[%X]type[%d]layer[%d]"), lRet, uType,nLayer);
AfxMessageBox(strMsg);
switch(uType){
case 29: // slip
{
BSTR szStr = NULL;
double dXPos, dYPos;
BSTR szFontName = NULL;
double dHeight;
unsigned char byFontAttr, byAlign;
double dAngle;
unsigned long ocFontColor;
unsigned char byLineStyle, byLineWidth;
unsigned long ocLineColor;
unsigned char byHatchStyle;
unsigned long ocForeColor, ocBackColor;
unsigned short bBackTrans;
BSTR szPictureName = NULL;
unsigned short uPictureWidth, uPictureHeight, uPicturePos;
m_MadoriDoc->GetSlip(&szStr,&dXPos, &dYPos, &szFontName, &dHeight, &byFontAttr,
&byAlign, &dAngle, &ocFontColor, &byLineStyle, &byLineWidth, &ocLineColor,
&byHatchStyle, &ocForeColor, &ocBackColor, &bBackTrans, &szPictureName,
&uPictureWidth, &uPictureHeight, &uPicturePos);
CString strStr, strFontName, strPictureName;
AfxBSTR2CString(&strStr, szStr);
AfxBSTR2CString(&strFontName, szFontName);
AfxBSTR2CString(&strPictureName, szPictureName);
strMsg.Format(TEXT("slip str[%s]pos[%lf,%lf]font[%s]h[%lf]attr[%x]")
TEXT("align[%x]ang[%lf]col[%x]lineStyle[%d]width[%d]col[%x]")
TEXT("hatchStyle[%d]for[%x]back[%x]trans[%d]pic[%s]")
TEXT("w[%d]h[%d]pos[%u]"),
strStr, dXPos, dYPos, strFontName, dHeight, byFontAttr,
byAlign, dAngle, ocFontColor, byLineStyle, byLineWidth, ocLineColor,
byHatchStyle, ocForeColor, ocBackColor, bBackTrans, strPictureName,
uPictureWidth, uPictureHeight, uPicturePos);
AfxMessageBox(strMsg);
if(szStr){
::SysFreeString(szStr);
}
if(szFontName){
::SysFreeString(szFontName);
}
if(szPictureName){
::SysFreeString(szPictureName);
}
}
break;
}
lRet = m_MadoriDoc->GetNextObject();
}
// JavaScript sample
var doc = new CMadoriDoc();
var lRet = doc.GetTopObject();
while(lRet){
var uType =doc.GetCurrentObjectType();
alert(uType);
switch (uType){
case 29: // slip
var data = eval( doc.GetSlipJS() );
alert( "Result[" + data.Result + "]" );
var msg = " Str[" + data.Str + "]\r\n";
msg += " XPos[" + data.XPos + "]\r\n";
msg += " YPos[" + data.YPos + "]";
alert(msg);
msg = " FontName[" + data.FontName + "]\r\n";
msg += " Height[" + data.Height + "]\r\n";
msg += " FontAttr[" + data.FontAttr + "]";
alert(msg);
msg = " Align[" + data.Align + "]\r\n";
msg += " Angle[" + data.Angle + "]\r\n";
msg += " FontColor[" + data.FontColor + "]";
alert(msg);
msg = " LineStyle[" + data.LineStyle + "]\r\n";
msg += " LineWidth[" + data.LineWidth + "]\r\n";
msg += " LineColor[" + data.LineColor + "]";
alert(msg);
msg = " HatchStyle[" + data.HatchStyle + "]\r\n";
msg += " ForeColor[" + data.ForeColor + "]\r\n";
msg += " BackColor[" + data.BackColor + "]";
alert(msg);
msg = " BackTrans[" + data.BackTrans + "]\r\n";
msg += " PictureName[" + data.PictureName + "]\r\n";
msg += " PictureWidth[" + data.PictureWidth + "]\r\n";
msg += " PictureHeight[" + data.PictureHeight + "]\r\n";
msg += " PicturePos[" + data.PicturePos + "]";
alert(msg);
break;
}
lRet = doc.GetNextObject();
}