Watermark Text In PowerBuilder
Hidden text in PowerBuilder for the meaning of the columns to enter data.
Example code
n_dw_banner from nonvisualobject
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | forward global type n_dw_banner from nonvisualobject end type end forward global type n_dw_banner from nonvisualobject end type global n_dw_banner n_dw_banner type variables Protected: datawindow idw_requestor Private: Constant String cis_compute_prefix = "c_cuebanner_" Boolean ib_italic end variables forward prototypes public function integer of_register (string as_column, string as_prompt) public subroutine of_setitalic (boolean ab_switch) public subroutine of_setrequestor (datawindow adw_requestor) end prototypes public function integer of_register (string as_column, string as_prompt);string ls_compute, ls_x, ls_y, ls_height, ls_width, ls_fontFace, ls_fontHeight string ls_backColor, ls_band, ls_error, ls_modify, ls_border ls_compute = cis_compute_prefix + as_column ls_height = idw_requestor.describe ( as_column + ".height" ) ls_width = idw_requestor.describe ( as_column + ".width" ) ls_x = idw_requestor.describe ( as_column + ".x" ) ls_y = idw_requestor.describe ( as_column + ".y" ) ls_backColor = idw_requestor.describe ( as_column + ".background.color" ) ls_band = idw_requestor.describe ( as_column + ".band" ) ls_fontFace = idw_requestor.describe ( as_column + ".font.face" ) ls_fontHeight = idw_requestor.describe ( as_column + ".font.height" ) ls_border = idw_requestor.describe ( as_column + ".border" ) ls_modify = "create compute (band=" + ls_band + & " name= " + ls_compute + & " expression='~"" + as_prompt + "~"'" + & " height='" + ls_height + "'" + & " width='" + ls_width + "'" + & " x='" + ls_x + "'" + & " y='" + ls_y + "'" + & " background.color='" + ls_backColor + "'" + & " font.face ='" + ls_fontFace + "'" + & " font.height ='" + ls_fontHeight + "'" + & " color='8421504'" + & " border='" + ls_border + "'" + & " visible='1~tif(len(" + as_column + ")>0,0,1)'" if ib_italic then ls_modify += " font.italic='1'" end if ls_modify += ")" ls_error = idw_requestor.modify ( ls_modify ) if len(ls_error) > 0 then messageBox ( "error", ls_error ) end if return 1 end function public subroutine of_setitalic (boolean ab_switch);ib_italic = ab_switch end subroutine public subroutine of_setrequestor (datawindow adw_requestor);idw_requestor = adw_requestor end subroutine on n_dw_banner.create call super::create TriggerEvent( this, "constructor" ) end on on n_dw_banner.destroy TriggerEvent( this, "destructor" ) call super::destroy end on |
u_sle from singlelineedit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | forward global type u_sle from singlelineedit end type end forward global type u_sle from singlelineedit integer width = 402 integer height = 112 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 string text = "none" borderstyle borderstyle = stylelowered! end type global u_sle u_sle type variables Public: String #prompt Private: Long EM_SETCUEBANNER = 5377 end variables on u_sle.create end on on u_sle.destroy end on event constructor;If Len ( #prompt ) > 0 Then Send ( Handle ( This ), EM_SETCUEBANNER, 1, #prompt ) End If end event |
u_dw from datawindow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | forward global type u_dw from datawindow end type end forward global type u_dw from datawindow integer width = 686 integer height = 400 string title = "none" boolean livescroll = true borderstyle borderstyle = stylelowered! end type global u_dw u_dw type variables Public: n_dw_banner inv_cuebanner end variables forward prototypes public subroutine of_setcuebanner (boolean ab_switch) end prototypes public subroutine of_setcuebanner (boolean ab_switch);//==================================================================== // Function: u_dw.of_setcuebanner() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments: // value boolean ab_switch //-------------------------------------------------------------------- // Returns: (none) //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/11/01 //-------------------------------------------------------------------- // Usage: u_dw.of_setcuebanner ( boolean ab_switch ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== If ab_switch Then If Not IsValid ( inv_cuebanner ) Then inv_cuebanner = Create n_dw_banner inv_cuebanner.of_setRequestor ( This ) End If Else If IsValid ( inv_cuebanner ) Then Destroy inv_cuebanner End If End If end subroutine on u_dw.create end on on u_dw.destroy end on |
w_main from window
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | forward global type w_main from window end type type dw_2 from u_dw within w_main end type type dw_1 from u_dw within w_main end type type sle_password from u_sle within w_main end type type sle_user from u_sle within w_main end type type gb_1 from groupbox within w_main end type type gb_2 from groupbox within w_main end type type gb_3 from groupbox within w_main end type end forward global type w_main from window integer width = 1161 integer height = 996 boolean titlebar = true string title = "Watermark Text" boolean controlmenu = true boolean minbox = true boolean maxbox = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true dw_2 dw_2 dw_1 dw_1 sle_password sle_password sle_user sle_user gb_1 gb_1 gb_2 gb_2 gb_3 gb_3 end type global w_main w_main on w_main.create this.dw_2=create dw_2 this.dw_1=create dw_1 this.sle_password=create sle_password this.sle_user=create sle_user this.gb_1=create gb_1 this.gb_2=create gb_2 this.gb_3=create gb_3 this.Control[]={this.dw_2,& this.dw_1,& this.sle_password,& this.sle_user,& this.gb_1,& this.gb_2,& this.gb_3} end on on w_main.destroy destroy(this.dw_2) destroy(this.dw_1) destroy(this.sle_password) destroy(this.sle_user) destroy(this.gb_1) destroy(this.gb_2) destroy(this.gb_3) end on type dw_2 from u_dw within w_main integer x = 27 integer y = 680 integer width = 1074 integer height = 188 integer taborder = 50 string dataobject = "d_login" boolean border = false borderstyle borderstyle = stylebox! end type event constructor;call super::constructor;of_setCueBanner ( True ) inv_cuebanner.of_register ( "user", "Username" ) inv_cuebanner.of_register ( "pass", "Password" ) InsertRow ( 0 ) end event type dw_1 from u_dw within w_main integer x = 27 integer y = 384 integer width = 1074 integer height = 188 integer taborder = 20 string dataobject = "d_login" boolean border = false borderstyle borderstyle = stylebox! end type event constructor;call super::constructor;of_setCueBanner ( True ) inv_cuebanner.of_setItalic ( True ) inv_cuebanner.of_register ( "user", "Username" ) inv_cuebanner.of_register ( "pass", "Password" ) InsertRow ( 0 ) end event type sle_password from u_sle within w_main integer x = 59 integer y = 176 integer width = 992 integer height = 96 integer taborder = 10 string text = "" string #prompt = "Password" end type type sle_user from u_sle within w_main integer x = 59 integer y = 64 integer width = 992 integer height = 96 integer taborder = 10 string text = "" string #prompt = "Username" end type type gb_1 from groupbox within w_main integer x = 14 integer width = 1120 integer height = 308 integer taborder = 30 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "Singleline" end type type gb_2 from groupbox within w_main integer x = 9 integer y = 308 integer width = 1120 integer height = 292 integer taborder = 40 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "DW - Italic" end type type gb_3 from groupbox within w_main integer x = 9 integer y = 604 integer width = 1120 integer height = 292 integer taborder = 30 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "DW - Standard" end type |
datawindow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | release 10.5; datawindow(units=0 timer_interval=0 color=67108864 ) header(height=0 color="536870912" ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=188 color="536870912" ) table(column=(type=char(255) updatewhereclause=yes name=user dbname="user" ) column=(type=char(255) updatewhereclause=yes name=pass dbname="pass" ) ) column(band=detail id=1 alignment="0" tabsequence=10 border="5" color="33554432" x="32" y="4" height="72" width="992" format="[general]" html.valueishtml="0" name=user visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="1073741824" ) column(band=detail id=2 alignment="0" tabsequence=20 border="5" color="33554432" x="32" y="104" height="72" width="992" format="[general]" html.valueishtml="0" name=pass visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="1073741824" ) htmltable(border="1" ) htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" ) xhtmlgen() cssgen(sessionspecific="0" ) xmlgen(inline="0" ) xsltgen() jsgen() export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" ) export.xhtml() |
Find Projects On Github click here
Good Luck!
Your site is very useful for me i liked it
Really
Thanks for you ❤
I want away to upload files to google drive please
Thank you for sharing your knowledge!
https://clinicalobserver.tumblr.com/
https://blogsonresearch.blogspot.com
https://clinicalobserverblog.wordpress.com/