PB资料收集

在用PB6.5编程序时发现PB6.5中没有反三角函数,请问怎么办?
  答:确实如此,PB中只提供了三角函数如sin()、cos(),要想使用反三角函数须借助于数据库。一般数据库如Sybase SQL Anywhere、MS SQL SERVER等都提供反三角函数,使用方法select 函数名(参数) into 变量 ……如在Sybase SQL Anywhere 5 中:
  double ldb_value
  SELECT asin(″search″.″id″)
  INTO ldb_value
  FROM ″search″
  WHERE ″search″
.″id″ = 1;
  实现了对数据库字段的反三角计算,如果是对一般的内存变量的反三角计算可用变通的办法(此方法由网易PB版主edsion提供):
  double ldb_value = 1
  double ldb_asin
  SELECT asin( ldb_value )
  INTO ldb_asin
  FROM ″department″ ;

--------------------------------------------------------------------------------

如何只让第一页有表头,其他页无表头方法:
http://expert.csdn.net/Expert/topic/1247/1247960.xml?temp=.4769251

--------------------------------------------------------------------------------

如何只让DW第一页有表头,其他页无表头的方法:
http://expert.csdn.net/Expert/topic/1247/1247960.xml?temp=.4769251

--------------------------------------------------------------------------------

如何在DW中计算一页有多少行的方法:
http://expert.csdn.net/Expert/topic/1249/1249653.xml?temp=.3837397
dw_1.setrow(integer(dw_1.describe("DataWindow.LastRowOnPage")))
dw_1.scrollnextrow()

--------------------------------------------------------------------------------

怎么让PB只打印当前记录,是用Free格式制作的数据窗口:
DataStore ldt_temp
long ll_Row , ll_Rows
ll_Rows = dw_XX.Rowcount()
If ll_Rows = 0 Then GoTo the_end
If ll_Rows = 1 Then
dw_XX.Print()
GoTo the_end
End if
dw_XX.SetRedraw(False)
ldt_temp = Create DataStore
ldt_temp.DataObject = dw_XX.DataObject
ll_Row = dw_XX.GetRow()
dw_XX.RowsMove(1 , ll_Rows , Primary! , ldt_temp , 1 , Primary!)
ldt_temp.RowsMove(ll_Row , ll_Row , Primary! , dw_XX , 1 , Primary!)
dw_XX.Print()
dw_XX.RowsMove(1 , 1 , Primary! , ldt_temp , ll_Row , Primary!)
ldt_temp.RowsMove(1 , ll_Rows , Primary! , dw_XX , 1 , Primary!)
Destroy ldt_temp
dw_XX.SetRedraw(True)
the_end:
//只用将上述脚本拷入到打印部分即可,dw_XX为被打印的free型数据窗口,该方法可保证dw_XX中的数据在打印前后包括sort等属性均不发生任何改变,但效率较低,不宜用在数据量太大的数据窗口中,当然,考虑到打印本身速度就比较慢,所以3000行数据是可以采用这种方法并让用户接受的。若在同一窗口上存在与dw_XX共享的grid数据窗口并且与dw_XX同时显示,则需要与dw_one一起SetRedraw().

--------------------------------------------------------------------------------

如何在dw往右拖动时,第一列固定不动:
见:
http://expert.csdn.net/Expert/topic/1257/1257815.xml?temp=3.397769E-02
先选中DW控制的horizontal split属性,然后在程序中用
<dwname>.Object.datawindow.horizontalscrollsplit = <位置的点 >
这样可产生把DW切开为两个部分,基本满足要求 。
string ls_colx
ls_colx = dw_1.Object.emp_fname.x //emp_fname是要固定不动列的后面那
个列名
dw_1.Object.datawindow.horizontalscrollsplit = ls_colx
先在数据窗口画板中将第一列Bring to Front,
然后在数据窗口的scrollhorizontal事件中编程:
this.object.name.x = scrollposNAME是列名
this.object.t_1.x = scrollposT_1是列头控件的名称。
如果运行过程中出现了文字叠加现像,你应该到数据窗口画板中将第一列加一种底
色。
先在数据窗口画板中将第一列Bring to Front,
然后在数据窗口的scrollhorizontal事件中编程:
this.object.name.x = scrollposNAME是列名
this.object.t_1.x = scrollposT_1是列头控件的名称。
告诉你招狠的,做两个数据窗口
左边的显示第一列,而且把readonly = Yes即可
先在数据窗口画板中将第一列Bring to Front,
然后在数据窗口的scrollhorizontal事件中编程:
this.object.name.x = scrollposNAME是列名
this.object.t_1.x = scrollposT_1是列头控件的名称。
如果运行过程中出现了文字叠加现像,你应该到数据窗口画板中将第一列加一种底
色。
从第二列开始你就用这句:
long x[7]/全局变量
x[1] = this.object.name.x写到窗口的OPEN事件中,这是保存第二列的初始
值。
然后在数据窗口的scrollhorizontal事件中编程:
this.object.name.x = x[1]+scrollposNAME是列名
其它345678列的处理方法同上。
我以dw_test为例给出我的想法,而且是我们公司的基类,肯定可以实现的
if NOT dw_test.hsplitscroll then
dw_test.hsplitscroll = true
dw_test.hscrollbar = true
end if
string ls_x,ls_err,as_col
//as_col是你要分隔数据窗口的列名,这样你想分到哪里都行啊
ls_x=dw_test.describe(as_col+'.x' )
ls_x=string(integer(ls_x)-1 )
ls_err=adw.modify("datawindow.horizontalscrollsplit="+ls_x)
return ''=ls_err
//固定每一列,模仿EXCEL
int i
i = integer(this.Object.DataWindow.HorizontalScrollSplit)
if i < 1 then return
if pane = 1 then
if scrollpos > 0 then
//send(handle(this),276,0,0)
this.object.datawindow.horizontalScrollPosition = 0
end if
else
if i > scrollpos then
this.object.datawindow.horizontalScrollPosition2 = i
end if
end if

--------------------------------------------------------------------------------

CSDN专访台湾李维(一):大陆开发人员技不如人
(2002.12.13) 来自:CSDN 张里

由于对台湾地区软件技术和开发环境的不了解,大家见到李维的时候总爱比较海峡两岸开发人员的技术高低,毕竟李维见多识广,说话直率。当着众多大陆IT媒体的面,李维也是直截了地指出大陆地区开发人员开发能力远输美国,甚至连台湾地区的开发人员也不如。
李维认为大陆开发人员还纠缠于开发工具和语言的选择,他们关注的焦点不外乎特定的语言如何,特定的功能怎么样。而这在台湾地区或是国外很少见,他们关心的是解决方案的整体架构。
“简单举例,对于现在流行的网络服务(Webservices),国内程序员注意到的是技术怎么弄,开发工具如何用。而在海外你就可以看到截然不同的现象。他们首先想到的是我用Webservices可以实现什么,它的架构怎么设计才更合理,这其中会牵涉到哪些技术。”
李维说:“美国以及台湾地区的开发者已经树立一种意识——‘开局最重要’。如果开始就乱七八糟,即使每个单元都完美了,其结果同样会惨不忍睹。对于一个系统或项目来说,单元固然重要,更重要的是还是全部系统或项目的成功。这就意味着他们看到的是整体宏观架构,而不是微观的细枝末节。”
在此之前,美国Borland公司开发人员关系经理John Kaster也表达了类似观点。Kaster长期活跃在Borland开发社区(http://bdn.borland.com)为大家传道解惑,接触到不少来自中国大陆的开发人员,也回答了他们提出的大量问题。他认为中国开发人员提的问题非常低级(low level),以至于他有时找不出合适的回答。“越简单的问题越难回答”。“美国的技术开发人员已掌握了比较成形的架构模型,他们关注问题的焦点更高,他们感兴趣的问题就不如中国开发人员这般基础。”


--------------------------------------------------------------------------------

如何避免rows changed between retrieve and update ?
参考下文:
http://expert.csdn.net/expert/topic/735/735076.xml

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

如何将COLUMN的显示风格在EDIT、DDDW、DDLB之间相互切换:
(1)切换成DDDW:
dw_1.Modify("#1.dddw.Name='dddw_jg'")
dw_1.Modify("#1.dddw.DisplayColumn='name_jg'")
dw_1.Modify("#1.dddw.DataColumn='id_jg'")
(2)切换成DDLB:
dw_1.Modify("#1.ddlb.case='any'")
dw_1.Object.#1.Values ="red~t1/white~t2"
(3)切换成EDIT:
dw_1.Modify("#1.edit.case='any'")
dw_1.Modify("#1.edit.AutoSelect='Yes'")
(4)获取当前风格:
dw_1.Describe("#1.Edit.Style")
(5)如果还不行,可能得要如下操作:
dw_1.Modify("#1.dddw.Name=''")一下;

--------------------------------------------------------------------------------

http://www.csdn.net/news/newstopic/8/8546.shtml

--------------------------------------------------------------------------------

1、将程序最小化缩到系统栏 :
http://pbhome.net/info.asp?titleid=33
2、系统托盘区弹出右键菜单:
http://pbhome.net/info.asp?titleid=42
3、完整的汉字拼音库,包含多音字的拼音:
http://pbhome.net/info.asp?titleid=14

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

强烈推荐:
非常巧妙的一个方法:
$PBExportHeader$f_calculate.srf
$PBExportComments$返回计算表达示的值
global type f_calculate from function_object
end type
forward prototypes
global function string f_calculate (string thestr)
end prototypes
global function string f_calculate (string thestr);//===========================================================================
//函数功能:返回计算表达式的值
//参数: string thestr 计算表达式,如 2 * (3+5)
//返回值: string retVal 计算表达式的结果值,如 2 * (3+5)的结果值为 16
// 如果是一个不正确的表达式,则返回 false.
//===========================================================================
//作者:饶家洪 时间:2002年11月19日
//===========================================================================
string retVal
datastore lds_evaluate
lds_evaluate = create datastore
lds_evaluate.create('release 8; ~r~ntable()')
retVal = lds_evaluate.describe("evaluate('" + thestr + "',0)")
destroy lds_evaluate
return retVal
end function

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

我的新成果,透明单选按钮,有问题和我联系:)
$PBExportHeader$uo_transparent_rb.sru
forward
global type uo_transparent_rb from radiobutton
end type
type tagrect from structure within uo_transparent_rb
end type
end forward
type tagrect from structure
long left
long top
long right
long bottom
end type
global type uo_transparent_rb from radiobutton
integer width = 375
integer height = 72
integer textsize = -10
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 67108864
string text = " this"
event ue_paint pbm_paint
end type
global uo_transparent_rb uo_transparent_rb
type prototypes
FUNCTION ulong ReleaseDC(ulong hwnd,ulong hdc) LIBRARY "user32.dll"
Function uLong GetDC(uLong hwnd) LIBRARY "user32.dll"
Function uLong DeleteObject(uLong hObject) LIBRARY "gdi32.dll"
Function uLong SelectObject(uLong hdc,uLong hObject) LIBRARY "gdi32.dll"
Function uLong SetBkColor(uLong hdc,uLong crColor) LIBRARY "gdi32.dll"
FUNCTION ulong SetTextColor(ulong hdc,ulong crColor) LIBRARY "gdi32.dll"
FUNCTION ulong SetBkMode(ulong hdc,ulong nBkMode) LIBRARY "gdi32.dll"
FUNCTION ulong DrawText(ulong hdc,ref string lpStr,ulong nCount,ref tagrect lpRect,ulong wFormat) LIBRARY "user32.dll" ALIAS FOR "DrawTextA"
end prototypes
type variables
PRIVATE:
string is_text
Boolean ib_painting
long il_dc
integer il_Title_align
tagrect istr_fRect
end variables
forward prototypes
public subroutine ue_init_draw ()
end prototypes
event ue_paint;
DrawText(il_dc,is_text,Len(is_text),istr_fRect,il_Title_align)
IF IsValid(This) THEN
IF ib_painting THEN Return 0
ib_painting=True
Visible=False
DO WHILE Yield()
LOOP
Visible=True
ib_painting=False
END IF
Return 0
end event
public subroutine ue_init_draw ();
LogFont lstr_lf
long ll_old,ll_newFont
integer li_WM_GETFONT = 49
//得到dc
il_dc = getdc(handle(this))
SetBkMode(il_DC,-1)
if this.leftText then
istr_fRect.left = 0
istr_fRect.right = UnitsToPixels(this.width - 82,XUnitsToPixels!)
else
istr_fRect.left = UnitsToPixels(82,XUnitsToPixels!)
istr_fRect.right = UnitsToPixels(this.width,XUnitsToPixels!)
end if
if this.height > 72 then
istr_fRect.top = UnitsToPixels(this.height/2 - 36,yUnitsToPixels!)
istr_fRect.bottom = UnitsToPixels(this.height/2 +36,yUnitsToPixels!)
else
istr_fRect.top = 0
istr_fRect.bottom = UnitsToPixels(this.height,yUnitsToPixels!)
end if
ll_newFont = Send(Handle(this), li_WM_GETFONT, 0, 0)
ll_old = SelectObject(il_DC,ll_newFont)
DeleteObject(ll_newFont)
if this.RightToLeft then
il_Title_align = 6 //右对其
else
il_Title_align = 4 //中间对其
end if
SetTextColor(il_DC,this.TextColor)
end subroutine
on uo_transparent_rb.create
end on
on uo_transparent_rb.destroy
end on
event constructor;
this.hide()
BackColor=2^29
is_text = this.text
this.text = ""
ue_init_draw()
this.show()
end event
event destructor;ReleaseDC(handle(this),il_dc)
end event

--------------------------------------------------------------------------------

将PBL库中的全部对象的脚本转出成文本文件
http://www.liulee.net/shares/share_open.php?id=1038732102


--------------------------------------------------------------------------------

请把LogFont lstr_lf删除,呵呵:)小错误

--------------------------------------------------------------------------------

//首先将各列中第一行字符字体设为粗体;
ls_str = ls_dm_2+string(li_low + li_col - 2)+".font.weight='400 ~t if(getrow()=1,700,400)'"
dw_preview.modify(ls_str)
//首先将各列中第一行字符字体设为10号字;
ls_str = ls_dm_2+string(li_low + li_col - 2)+".font.height='-8 ~t if(getrow()=1,-10,-8)'"
dw_preview.modify(ls_str)
//首先将各列中第一行字符字体设为居中;
ls_str = ls_dm_2+string(li_low + li_col - 2)+".alignment='1 ~t if(getrow()=1,2,1)'"
dw_preview.modify(ls_str)
//首先将各列中各行字符字体设为8号字;
dw_preview.Modify(ls_dm_2+string(li_low + li_col - 2)+".font.height='-8'")

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

问:我用的数据库是 Sybase SQL Anywhere 5.0 ,数据库文件在本机能用,拷贝到别的机器却连接不上,是否还需其它配置?
答:假设数据库文件为hello.db,将hello.db与hello.log拷贝过去,再配置ODBC数据源。如果还连不上数据库,则须重新连接事务注册文件hello.log,方法如下:
1、运行MS_DOS模式
2、进入Sybase SQL Anywhere5.0/win32目录,如
C:> cd C:/Program Files/Sybase/SQL Anywhere 5.0/Win32
3、运行命令(假设数据库文件拷贝到D盘根目录下):
dblog -t d:/hello.log d:/hello.db

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

PB65下从串口通信获取程控交换机计费数据的API调用
首先定义外部函数:
Function Boolean CloseHandle(ulong hObject ) Library "kernel32.dll"
FUNCTION boolean ReadFile(ulong fhand,
& ref string lpbuffer,
& ulong numbyte,
& ref ulong bytesread,
& ulong lpover) LIBRARY "kernel32.dll"
FUNCTION ulong CreateFileA(ref string fname,
& ulong f_access,
& ulong f_share,
& ulong f_sec,
& ulong f_create,
& ulong f_flag,
& ulong f_attrib) LIBRARY "kernel32.dll"
Function Boolean WriteFile(uLong handle,
& ref string lpbuffer,
& ulong numbytes,
& ref ulong bytesread,
& ulong lpOverLaped) Library "Kernel32.dll"
Function Boolean GetCommProperties(ulong hFile,
& ref COMMPROP lpCommProp ) Library "Kernel32.dll"
Function Boolean BuildCommDCBA(ref string lpDef,
& ref DCB lpDCB ) Library "Kernel32.dll"
Function Boolean SetCommState(ulong hCommDev,
& ref DCB lpdcb ) Library "Kernel32.dll"
Function Boolean GetCommState(ulong hCommDev,
& ref DCB lpdcb ) Library "Kernel32.dll"
Function ulong GetLastError() Library "Kernel32.dll"
Function Boolean SetCommTimeouts(ulong hCommDev,
& ref COMMTIMEOUTS lpctmo ) Library "Kernel32.dll"
Function Boolean PurgeComm(ulong hCommDev,
& ulong fdwAction ) Library "Kernel32.dll"
实例变量定义:
ulong iu_file
string is_buffer//数据缓冲
string is_valid_num = "123" //有效数据
第二是初始设置
string ls_com,ls_commset
dcb lst_dcb
ls_com = "COM1" //

ib_reading = true //打开串口
iu_file = CreateFileA(ls_com,3221225472,0,0,3,128,0)
if (iu_file < 0) then
messagebox("错误","无法打开" + ls_com + " #" + string(getlasterror ( )),StopSign!)
end if //初始化DCB
ls_commset = "4800,N,8,1"
if (Not BuildCommDcbA ( ls_commset, lst_dcb )) then
messagebox("错误","无法创建DCB" + " #" + string(getlasterror ( )),StopSign!)
end if
//设置串口
if (Not setcommstate ( iu_file, lst_dcb )) then
messagebox("错误","无法设置串口"+ ls_com + " #" + string(getlasterror ( )),StopSign!)

end if
//设置超时
commtimeouts lst_to lst_to.readintervaltimeout = 4294967295 //MAXDWORD //
lst_to.readtotaltimeoutconstant = 60000 //
lst_to.readtotaltimeoutmultiplier = 10
SetCommTimeouts(iu_file, lst_to)
第三步:读或写(例子中的是读,写可用writefile)
ulong lu_bytesread, lu_numbytes
string ls_buff
ulong lstr_locstruct //注意!这是ULONG 而不是STRUCT
ls_buff = space(100)
setnull(lstr_locstruct)
lu_numbytes = 100
if (not readfile ( iu_file, ls_buff, lu_numbytes, & lu_bytesread, lstr_locstruct))
then
messagebox("错误","无法读取 #" + string(getlasterror ( )),StopSign!)
timer(0)
else
if( lu_bytesread > 0) then
is_buffer += trim(ls_buff) mle_1.text += trim(ls_buff) //处理数据
this.wf_is_valid_receieve ( ) //检验函数
end if
end if
第四步:完成后释放端口
closehandle ( iu_file )
具体函数使用方法可参见MSDN中的TAPI。 有时可能用控件做起来更简单一些(如SCOMM、SAX COMM等)。

--------------------------------------------------------------------------------

$PBExportHeader$uo_treebase.sru
$PBExportComments$树型控件基类
forward
global type uo_treebase from treeview
end type
end forward
global type uo_treebase from treeview
integer width = 1170
integer height = 672
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
string picturename[] = {"Environment!","pic/ico/选中.bmp","SetDefaultClass!","Continue!","UserObject5!","Custom027!","Custom079!","RunWindow!","Browse!"}
long picturemaskcolor = 536870912
long statepicturemaskcolor = 536870912
end type
global uo_treebase uo_treebase
type variables
boolean ib_candel = FALSE
private :
//查找标志
boolean ib_find = FALSE
end variables
forward prototypes
public function long uf_if_child (long handle)
public function integer uf_modify_item (long al_handle, any aa_data, string as_label)
public function long uf_sumitem (treeview at_view, integer ai_type)
public function integer uf_deleteitem (long al_handle, boolean ab_showdialog)
public function any uf_get_parentdata (long handle)
public function long uf_find_item (long handle, any a_data, integer ai_type)
public function long uf_insertlast (long handleparent, any data, string label, boolean children)
public function string uf_about ()
end prototypes
public function long uf_if_child (long handle);
/**********************************************************/
//function : 判断该子项是否有子项
//parameters :
// 1. handle : 目标项句柄
//return : 有则是下一个子项的第一个句柄,-1 是没有
//author : hzh
//date : 2002.07.22
/*********************************************************/
treeviewitem ltvi_temp
IF THIS.GetItem(handle,ltvi_temp) = -1 THEN RETURN -1
//生成句柄
IF NOT ltvi_temp.expandedonce THEN
THIS.ExpandItem(handle)
THIS.CollapseItem(handle)
END IF
RETURN THIS.FindItem(ChildTreeItem!,handle)
end function
public function integer uf_modify_item (long al_handle, any aa_data, string as_label);
/**********************************************************/
//function : 修改某节点的数据
//para :
// 1. al_handle : 本级句柄
//return : 1 is success or -1 is fail
//author : hzh
//date : 2002.07.22
/*********************************************************/
treeviewitem tv_modi
IF THIS.GetItem(al_handle,tv_modi) = -1 THEN RETURN -1
IF Len(String(aa_data))>0 THEN tv_modi.data = aa_data
IF Len(String(as_label))>0 THEN tv_modi.label = as_label
RETURN THIS.SetItem(al_handle,tv_modi)
end function
public function long uf_sumitem (treeview at_view, integer ai_type);
/**********************************************************/
//function : 求和树项目
//para :
// 1. at_view : 树形控件
// 2. ai_type : 参数类型
//return : 节点数
//author : hzh
//date : 2002.07.22
/*********************************************************/
long l_cnt
treeviewitem tv_temp
IF THIS.GetItem(1,tv_temp) = -1 THEN RETURN 0

IF ai_type = 1 THEN
//节点总数
l_cnt = Send(Handle(at_view), 4357, 0, 0)
ELSE
//节点可见总数(在当前树形结构可见区域内)
l_cnt = Send(Handle(at_view), 4368, 0, 0)
END IF
RETURN l_cnt
end function
public function integer uf_deleteitem (long al_handle, boolean ab_showdialog);/**********************************************************/
//function : 删除指定节点
//para :
// 1. al_handle : 指定节点句柄
// 2. ab_showdialog : 是否显示对话框
//return : -1 is fail,-2 is cancel or 1 is success
//author : hzh
//date : 2002.07.22
/*********************************************************/
treeviewitem tv_valid
IF THIS.Getitem(al_handle,tv_valid) = -1 THEN RETURN -1
IF ab_showdialog THEN
IF 1 = MessageBox(ga_app.dwmessagetitle,'是否确认删除该节点及其下属所有节点 ?',Question!,YesNo!,2) THEN
RETURN THIS.DeleteItem(al_handle)
ELSE
RETURN -2
END IF
ELSE
RETURN THIS.DeleteItem(al_handle)
END IF
RETURN -1
end function
public function any uf_get_parentdata (long handle);/**********************************************************/
//function : 所有父级的 data 数据项
//para :
// 1. handle : 本级句柄
//return : (none)
//author : hzh
//date : 2002.07.22
/*********************************************************/
long l_handle
any a_data,a_temp
treeviewitem ltvi_parent
l_handle = THIS.finditem(parenttreeitem!,handle)
DO WHILE l_handle <> -1
IF THIS.getitem(l_handle,ltvi_parent) <> -1 THEN
SetNull(a_temp)
a_temp = ltvi_parent.data
IF NOT IsNull(a_temp) THEN
a_data = String(a_temp) + String(a_data)
END IF
l_handle = THIS.finditem(parenttreeitem!,l_handle)
END IF
LOOP
RETURN a_data
end function
public function long uf_find_item (long handle, any a_data, integer ai_type);
/**********************************************************/
//function : 遍历所有的项,查找目标项
//para :
// 1. handle : 项目句柄
// 2. a_data : 目标项数据
// 3. ai_type: 查找类型
//return : (none)
//author : hzh
//date : 2002.07.22
//comment :
// ai_type = 1 是准确查找
// ai_type = 2 是模糊查找
/*********************************************************/
long l_ret,l_find
treeviewitem ltvi_find
//没有找到
ib_find = FALSE
IF IsNull(a_data)THEN
MessageBox(ga_app.dwmessagetitle,"请输入查询条件 !",StopSign!)
RETURN -1
END IF
Do While Yield()
Loop
DO WHILE handle <> -1 AND NOT ib_find
THIS.GetItem(handle,ltvi_find)
IF ai_type = 1 THEN //是准确查找
IF ltvi_find.data = a_data THEN
SelectItem(handle)
ib_find = TRUE
RETURN handle
END IF
ELSE //是模糊查找
IF Pos(ltvi_find.label,String(a_data)) > 0 THEN
SelectItem(handle)
IF MessageBox(ga_app.dwmessagetitle,'是否查找下一项 "' +&
String(a_data) + ' "' ,Question!,YesNo!,2) = 2 THEN
ib_find = TRUE
RETURN handle
END IF
END IF
END IF
//---判断该项是否有子项,有则,递归调用,处理返回值取得目标项句柄---//
l_ret = THIS.uf_if_child(handle)
IF l_ret >0 THEN
l_find = THIS.uf_find_item(l_ret,a_data,ai_type)
END IF
handle = THIS.FindItem(NextTreeItem!,handle)
LOOP
IF ib_find THEN
RETURN l_find
ELSE
RETURN -1
END IF
end function
public function long uf_insertlast (long handleparent, any data, string label, boolean children);
/**********************************************************/
//function : 插入节点在最后
//para :
// 1. handleparent : 本级句柄
// 2. data : 节点的 data 项
// 3. label : 节点的 label 项
// 4. children : 节点的 children 项
//return : 新节点的句柄
//author : hzh
//date : 2002.07.22
/*********************************************************/
int i_picindex
treeviewitem tv_insert,tv_level
//THIS.SetRedraw(FALSE)
IF handleparent <> 0 THEN
IF THIS.GetItem(handleparent,tv_level) = -1 THEN RETURN -1
i_picindex = tv_level.level + 2
ELSE
i_picindex = 1
END IF
tv_insert.label = Trim(label)
tv_insert.data = data
tv_insert.children = children
tv_insert.pictureindex = i_picindex
tv_insert.statepictureindex = i_picindex
tv_insert.selectedpictureindex = 2
// 插入节点在最后
RETURN THIS.InsertItemLast (handleparent ,tv_insert )
end function
public function string uf_about ();
string s_func = ""
s_func = " 1. 删除指定节点 (uf_deleteitem) ~r~n" +&
" 2. 遍历所有的项,查找目标项 (uf_find_item) ~r~n" +&
" 3. 所有父级的 data 数据项 (uf_get_parentdata) ~r~n" +&
" 4. 判断该子项是否有子项 (uf_if_child

--------------------------------------------------------------------------------

多谢楼上两位支持,继续啊,:),,,

--------------------------------------------------------------------------------

哇,信誉:140 ?PF! PF!

--------------------------------------------------------------------------------

1、怎样实现单选按钮透明?
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=47280
2、如何将控件如Text背景色,变成透明色?
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=34090
3、怎么实现动画以及淡隐淡出效果显示窗口打开和关闭?
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=8680
4、N-UP如何分组:
http://www.liulee.net/mycodes/mycode_open?id=006
5、如何使有标题的数据窗口固定不动?
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=3214
6、如何使有标题栏的数据窗口不被拖动,但是数据是enabled状态?
---------------------------------------------------------------

在OTHER事件里写代码:
if wparam=61458 then
return 2
end if

---------------------------------------------------------------

Make a dw with a title unmoveable

[other event]
uint a

a = Message.WordParm
CHOOSE CASE a
CASE 61458 // 61458 maybe necessary...
Message.Processed = true
Message.ReturnValue = 0
END CHOOSE
7、字段如何自动换行的同时且自动高度?
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=3877

--------------------------------------------------------------------------------

如何使用子数据窗口中的按钮控件
假设dddw列列名为,the_test,如下:
1、自定义事件ue_pbmcommand,选择event_id为pbm_command,定义一instance变量
string is_object
2、编写脚本DataWindowChild ldwc_Child
GetChild( "the_test", ldwc_Child )
IF hwndchild = Handle( ldwc_Child ) THEN
CHOOSE CASE notificationcode
CASE 2048 // RowFocusChanged on DDDW
CASE 1281 // Clicked
IF is_object = 按钮名称 THEN
//按钮单击处理
END IF
CASE 2314 // Right Mouse Button Clicked
CASE 2311 // MouseMove
is_object = ldwc_Child.GetObjectAtPointer()
END CHOOSE
END IF
3、原理:
在PB6.0(^)中,pbm_command带3个参数,其中hwndchild(long)与notificationcode(unsignedinteger)即DDDW的Handle和Event ID。
⒉DDDW 的Event ID 列表:
Event Event ID
-------------------------------
Clicked 1281
RowFocusChanged 2048
RightMouseButtonDown 2314
Left Button Up 2313
Retreive End 769
MouseMove 2311
...

--------------------------------------------------------------------------------

以前的精华贴,现在找不到了:(
如何获得dwo
方法是:
DWObject ldwo_use,ldwo_abc
ldwo_use = dw_1.Object
ldwo_abc = ldwo_use.__get_attribute("name",FALSE)
MessageBox('',String(ldwo_abc.Name))
PB7 uses "__get_attribute" instead of "get_attribute".

--------------------------------------------------------------------------------
------------------------------------------------------------------

http://expert.csdn.net/Expert/topic/1345/1345088.xml?temp=8.149356E-02
我发的,大家也看看啊~~支持啊!

--------------------------------------------------------------------------------

http://expert.csdn.net/Expert/topic/1345/1345088.xml?temp=8.149356E-02
ehxz(郝晓宗):
Q:如何用DOS下的FTP命令与服务器进行文件上传、下载?
A:
1、建立一个批处理文件如下:ftpdemo.bat
ftp -s:c:/ftp.txt 127.0.0.1
2、建立文件ftp.txt在相关路径下
username
password
……
bye
//完成
说明:第一行为FTP用户名,第二行为FTP密码
后面部分可输入在FTP上的操作。
附FTP的使用说明(英文)
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-w:buffersize Overrides the default transfer buffer size of 4096.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.

--------------------------------------------------------------------------------

myclife的:[转]PB资料收集(myclife)也很不错,,,:)
http://expert.csdn.net/Expert/TopicView1.asp?id=1336172

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值