HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2014
1021
774ツリービューのドラッグイメージで半角英数字のラベルが表示されない?0解決


774

リンク

2014/10/21(Tue) 01:36:13|NO.65654

TVN_BeginDragでTVM_CreateDragImageを用いてドラッグイメージを生成してるのですが、
ドラッグ時の使用フォントに拠って、ラベル部分が表示されたりされなかったりします。

〜瓦凸簑蠅覆表示
半角英数字のみのラベルが表示されない
A瓦討離薀戰襪表示されない

私の環境(XP sp3)ではフォントの種類で上記のような差異がありました。
,錬唯 ゴシックやMS UI Gothicなど本当に極一部。
殆どが△如∩干冓源さえ混じってれば半角文字部分も表示されます。
一部日本語フォントはなのですが、これはフォント側の不備なのかも知れません。
いずれもアイコン部分は問題なく表示できています。

末尾に全角スペースでも付ければ取り敢えず表示はされるのですが
根本的な原因や対処法をご存知の方、いらっしゃいましたらご教示頂けないでしょうか?

#module #uselib "comctl32.dll" #func _InitCommonControls "InitCommonControls" #func _IL_Create "ImageList_Create" int,int,int,int,int #cfunc _IL_GetCount "ImageList_GetImageCount" sptr #func _IL_ReplaceIcon "ImageList_ReplaceIcon" sptr,int,sptr #func _IL_Destroy "ImageList_Destroy" sptr #func _IL_BeginDrag "ImageList_BeginDrag" sptr,int,int,int #func _IL_EndDrag "ImageList_EndDrag" #func _IL_DragEnter "ImageList_DragEnter" sptr,int,int #func _IL_DragLeave "ImageList_DragLeave" sptr #func _IL_DragMove "ImageList_DragMove" int,int #func _IL_DragShowNolock "ImageList_DragShowNolock" int #uselib "comdlg32.dll" #cfunc _ChooseFont "ChooseFontA" var #uselib "gdi32.dll" #func _GetTextFace "GetTextFaceA" sptr,int,var #uselib "shell32.dll" #func _SHGetFileInfo "SHGetFileInfoA" str,int,var,int,int #uselib "user32.dll" #func _ScreenToClient "ScreenToClient" sptr,var #func _DestroyIcon "DestroyIcon" sptr #func _SetCapture "SetCapture" sptr #func _ReleaseCapture "ReleaseCapture" #func _SetCursor "SetCursor" sptr #cfunc _LoadCursor "LoadCursorA" nullptr,int #deffunc cc_Init If(f_ccInit==0){f_ccInit++ :_InitCommonControls} :Return stat //----FontDialog------------------------------------------------ #deffunc _FontDialog var p0, var p1, var p2, int p3, int p4, local a, local b a=""+p0 :sDim p0,32 :If(a==""){_GetTextFace hDC,32,p0}else{p0=a} Dim a,15 :Dim b,15 :b.0=-Int(p1) :b.4=(p2&1)*700 :Poke b,23,128 Repeat 3,1 :Poke b,19+cnt,(p2>>cnt)&1 :Loop :Poke b,28,p0 a.0=60,hWnd,0,varptr(b),p1*10,$01010041^(p4>>4&$0fffd000) a.6=((p3&$ff)<<16)|(p3&$ff00)|((p3>>16)&$ff) If(p4&$ffff){a.13=Limit((p4>>8)&$ff,8,72),Limit(p4&$ff,8,72) a.5|=$2000 :If(a.13>a.14){a.12=a.13,a.14 :a.14=a.12}} a.12=$2000 :If(p3>=0){a.5|=$100} :If(_ChooseFont(a)==0){Return -1} MemCpy p0,b,32,0,28 :p1=0-b.0 :p2=(b.4>600) Repeat 3,1 :p2|=(Peek(b,19+cnt)&1)<<cnt :Loop Return ((a.6&$ff)<<16)|(a.6&$ff00)|((a.6>>16)&$ff) //----ImageList------------------------------------------------- #define global iml_Create(%1=16,%2=16,%3=32) _iml_Create %1,%2,%3 #deffunc _iml_Create int p0, int p1, int p2, local a a=Limit(p2,4,32) :*@ :If(a&7)*(a!=4){a++ :Goto *@b} _IL_Create p0,p1,a|1,0,0 :c_iml=stat Return c_iml #deffunc iml_AddExtIcon str p0, local a If(p0==""){Return -1} :Dim a,88 :_SHGetFileInfo p0,$80,a,88*4,$111 _IL_ReplaceIcon c_iml,-1,a.0 :a.1=stat :_DestroyIcon a.0 Return a.1 #defcfunc iml_GetCount Return _IL_GetCount(c_iml) #deffunc iml_Destroy onexit If(c_iml){_IL_Destroy c_iml :Dim c_iml} :Return //----TreeView-------------------------------------------------- #define cType trvNext(%1,%2) SendMsg c_trv,$110a,%1,%2 ;TVM_GetNextItem #define cType trvSelect(%1,%2) SendMsg c_trv,$110b,%1,%2 ;TVM_SelectItem #deffunc trv_Create int p0, int p1, int p2, local a, local b cc_Init :WinObj "SysTreeView32","",0,$50000023^p2,Limit(p0,32,2048),Limit(p1,64,2048) If(stat<0){Return -1} :a=stat :c_trv=ObjInfo(a,2) :ObjSkip a,1 mRef b,67 :SendMsg c_trv,$30,b.38 :SendMsg c_trv,$111b,Limit(b.32+4,18,80) Return a #deffunc trv_AddItem str p0, int p1, int p2, int p3, int p4, local a, local b Dim a,12 :sDim b,$100 :b=p0 a.0=p1,p1,$2f,p2&3,p2&$2030,$2030,varptr(b),$ff,p4&$ffff,p4>>16,0,p3 Repeat 2,8 :If(a.cnt&$8000){a.cnt|=$ffff0000} :Loop If(a.3<2){a.1=$ffff0000|(2-a.3)}else{trvNext(3,a.1) :a.0=stat If(a.3&1){trvNext(2,a.1) :a.1=stat :If(a.1==0){a.1=$ffff0001}}} SendMsg c_trv,$1100,,varptr(a) Return stat #deffunc trv_SetParam int p0, int p1, local a, local b If(p0==3){SendMsg c_trv,$1109,,p1} If(p0==4){mRef b,67 :SendMsg c_trv,$30,b.38 :SendMsg c_trv,$111b,Limit(b.32+4,18,80)} Return stat #defcfunc trv_ItemAtPos int p0, int p1, local a Dim a,4 :a=p0,p1 :_ScreenToClient c_trv,a :SendMsg c_trv,$1111,,varptr(a) Return a.3 #defcfunc trv_IsAncestor int p0, int p1, local a If((p0*p1)==0){Return 0} :If(p0==p1){Return 1} :a=p0,0 Repeat :trvNext(3,a) :a=stat :If(a==p1)||(a==0){a.1=(a==p1) :Break} :Loop Return a.1 #deffunc trv_DragItem int p0, local a, local b If(p0){If(d_trv==0){Return 0} //[ドロップ] trvSelect(8,0) :_IL_EndDrag :_ReleaseCapture _SetCursor _LoadCursor($7f8a) :_IL_Destroy d_trv a=trv_ItemAtPos(gInfo.0,gInfo.1) :If(a){trvSelect(9,a)} Dim d_trv :Return a } If(d_trv==0){ //[ドラッグ開始] Dim a,12 :DupPtr a,lParam+14*4,12*4,4 SendMsg c_trv,$1112,,a.1 ;TVM_CreateDragImage d_trv=stat,a.1,0 :If(d_trv==0){Return 0} trvSelect(9,a.1) ;TVM_SelectItem (ドラッグ元を選択) Dim b,4 :b=a.1 :SendMsg c_trv,$1104,1,varptr(b) a.10-=b.0-19 :a.11-=b.1 ;てきとーにイメージ位置補正 _IL_BeginDrag d_trv,0,a.10,a.11 _IL_DragEnter 0,gInfo.0,gInfo.1 _SetCapture hWnd :Return 1 } _IL_DragMove gInfo.0,gInfo.1 //[ドラッグ中] a=trv_ItemAtPos(gInfo.0,gInfo.1) If(a==d_trv.2){Return 1} :d_trv.2=a _IL_DragShowNolock 0 If(trv_IsAncestor(a,d_trv.1)){ trvSelect(8,0) :_SetCursor _LoadCursor($7f88) }else{ trvSelect(8,a) :_SetCursor _LoadCursor($7f89)} _IL_DragShowNolock 1 Return 1 #global *test Screen 0,320,240,2 :SysColor 15 :BoxF :Randomize sDim sFont :Dim iFont,2 :sFont=msGothic :iFont=12,0 Font sFont,iFont.0,iFont.1 :Pos 4,4 :SysColor 18 :Mes sFont iml_Create :hIml=stat :iml_AddExtIcon ".txt" :iml_AddExtIcon ".bmp" iml_AddExtIcon ".wav" :iml_AddExtIcon ".mid" :iml_AddExtIcon ".htm" iml_AddExtIcon ".dll" :iml_AddExtIcon ".hsp" :iml_AddExtIcon ".*" Pos 4, 36 :trv_Create 200,200,4 :hTrv=ObjInfo(stat,2) trv_SetParam 3,hIml :i=0,0,0,iml_GetCount(),0 s="Item %02d","NODE #%02d","アイテム %02d","項目 %02d","FullSpc %02d " trv_AddItem "ルート",0,$30,0,$00000000 :j.0=stat Repeat 40 i.1=Rnd(6)+1 :i.4=Rnd(i.3) :If(i.1>i.2){i.1=i.2+1} trv_AddItem StrF(s(Rnd(5)),i.0),j(i.1-1),,,(i.4<<16)|i.4 j(i.1)=stat :i.0++ :i.2=i.1 :Loop Dim i :Dim j :sDim s Pos 240,36 :ObjSize 80,40 :Button gosub "Font",*font_btn oncmd gosub *message,$04e ;WM_Notify oncmd gosub *message,$200 ;WM_MouseMove oncmd gosub *message,$202 ;WM_LButtonUp onexit gosub *exit :gSel 0,1 stop *message If(iParam==$04e){DupPtr i,lParam,12,4 ;TVN_BeginDrag If(i.0==hTrv)&&(i.2==-407){trv_DragItem :If(stat){f_DnD++}} :Return} If(f_DnD==0){Return} If(iParam==$202){trv_DragItem 1 :f_DnD=0} ;WM_LButtonUp If(iParam==$200){trv_DragItem} ;WM_MouseMove Return *font_btn s=sFont :_FontDialog s,iFont.0,iFont.1,-1,$1808 :If(stat<0){Return} sFont=s :Font sFont,iFont.0,iFont.1 SysColor 15 :BoxF :SysColor 18 :Pos 4,4 :Mes sFont :trv_SetParam 4 Return *exit iml_Destroy End:End:End



この記事に返信する


ONION software Copyright 1997-2021(c) All rights reserved.