topic
stringlengths
1
63
text
stringlengths
1
577k
Change focus
Hi ! There are several controls of the type TGET, when you press the up and down arrow keys, the focus changes. Can I prevent the focus from changing when these keys are pressed ?
Change focus
If I understood the question... [code=fw:2dr5ob97]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> GETASYNCKEY<span style="color: #000000;">&#40;</span> VK_UP <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// in vkey.ch</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> GETASYNCKEY<span style="color: #000000;">&#40;</span> VK_DOWN <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:2dr5ob97] Regards, saludos.
Change focus
Thanks for your help ! And what the ReadKey() function does not work ?
Change fonts on wbrowse & xbrowse
Hello, Can anyone give me an example how to change font in sàome rows in a wbrowse / xbrowse? I know how change color for each line, but did'n found an example for changing fonts. Thanks, Marc
Change fonts on wbrowse & xbrowse
Marc, e.g:[code=fw:2s2217yk]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-8</span> BOLD<br />oCol:<span style="color: #000000;">oDataFont</span> := oFont</div>[/code:2s2217yk] <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=8043">viewtopic.php?f=3&t=8043</a><!-- l --> or:[code=fw:2s2217yk]<div class="fw" id="{CB}" style="font-family: monospace;">oCol:<span style="color: #000000;">oDataFont</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ..., oFont1, oFont2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:2s2217yk] <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=12704">viewtopic.php?f=6&t=12704</a><!-- l -->
Change fonts on wbrowse & xbrowse
Thanks Frank, Regards, Marc
Change headers in xbrowse
Hi, How can I change the Headers in xBrowse while it is displayed? Thanks, Marc
Change headers in xbrowse
Hello Marc, Change and Test all xBrowse-Settings at Runtime ( Header, Footer, Fonts, Background, Cells .... : I think, You want to set new values for the header on Button-click ?. Can You tell me the values, You want to change ? Download : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/BRWTools5.zip">http://www.pflegeplus.com/fw_downloads/BRWTools5.zip</a><!-- m --> [img:7wm2gker]http&#58;//www&#46;pflegeplus&#46;com/pictures/header5&#46;jpg[/img:7wm2gker] Regards Uwe : <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P -->
Change headers in xbrowse
Uwe, I want the customer to be able to change the header of the xBrowse. In this example 'Marc' or 'Jan' [img:2ym0kjbb]http&#58;//www&#46;vms&#46;be/FWTest/xbrowseHeader&#46;jpg[/img:2ym0kjbb] In tsbrowse I did something like this: [code:2ym0kjbb]oBrw&#58;SetHeaders( , , ahoofding, , , , ) oBrw&#58;DrawHeaders() [/code:2ym0kjbb] Regards, Marc
Change headers in xbrowse
[code:nwqlotxd] oBrw&#58;Jan&#58;cHeader &#58;= 'cChangedJan' oBrw&#58;Refresh() [/code:nwqlotxd]
Change headers in xbrowse
NageswaraRao, This is not working. Jan is the text that is in this sample in the cHeader of the 2e row. It's not a variable. Regards, Marc
Change headers in xbrowse
Hello Marc, any selected Mouse-Clicks inside the xBrowse, will change the Header-Text Choose one, to do the defined Column-Title-Change ( You can use also VAR'S ). Another option could be, to change the Head-color as well. [code:2k0ylfkb] // Old Column-Titles // ------------------------ oLbx&#58;aCols&#91; 1 &#93;&#58;cHeader = Padr("No&#46;", 3) oLbx&#58;aCols&#91; 2 &#93;&#58;cHeader = Padr("Start", 19) // Define New Column-Titles on any Mouse-Click // ----------------------------------------------------- for nFor &#58;= 1 to 2 // 2 Columns oLbx&#58;aCols&#91; nFor &#93;&#58;bRClickHeader &#58;= ; {|r,c,f,o| IIF( o&#58;nCreationOrder = 1, o&#58;cHeader &#58;= "Text 1", o&#58;cHeader &#58;= "Text 2"), oLbx&#58;Refresh() } oLbx&#58;aCols&#91; nFor &#93;&#58;bLClickFooter &#58;= ; {|r,c,f,o| IIF( o&#58;nCreationOrder = 1, o&#58;cHeader &#58;= "Text 1", o&#58;cHeader &#58;= "Text 2"), oLbx&#58;Refresh() } oLbx&#58;aCols&#91; nFor &#93;&#58;bRClickFooter &#58;= ; {|r,c,f,o| IIF( o&#58;nCreationOrder = 1, o&#58;cHeader &#58;= "Text 1", o&#58;cHeader &#58;= "Text 2"), oLbx&#58;Refresh() } oLbx&#58;aCols&#91; nFor &#93;&#58;blDClickData &#58;= ; {|r,c,f,o| IIF( o&#58;nCreationOrder = 1, o&#58;cHeader &#58;= "Text 1", o&#58;cHeader &#58;= "Text 2"), oLbx&#58;Refresh() } oLbx&#58;aCols&#91; nFor &#93;&#58;bRClickData &#58;= ; {|r,c,f,o| IIF( o&#58;nCreationOrder = 1, o&#58;cHeader &#58;= "Text 1", o&#58;cHeader &#58;= "Text 2"), oLbx&#58;Refresh() } next [/code:2k0ylfkb] Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Change headers in xbrowse
Thank you Uwe, It's working very nice now!! <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Regards, Marc
Change htaccess for access to 1 folder
I once changed my htaccess file in order to forward ALL link, access and calls to the oldsite to the new site. I have a FIVEWIN folder on it in order to upload images to post insite the forum here, but that also forward all pictures to the new index of the new domain. My hosting says to look at the internet for a sample to do so <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: --> <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: --> I 'm not able to do it and tried some samples, but it is tuff... Any ideas ? This is now insite it (just renamed my site to 'mysite' tekst sample : <!-- w --><a class="postlink" href="http://www.maveco.be/fivewin/test.jpg">www.maveco.be/fivewin/test.jpg</a><!-- w --> will bring you to my site and not post the pic here as usual... File : # ~~advancedcms landing start~~ # Code generated by <!-- m --><a class="postlink" href="http://www.301-redirect.online">http://www.301-redirect.online</a><!-- m --> RewriteEngine on #RewriteCond %{QUERY_STRING} ^$ #RewriteRule $ <!-- m --><a class="postlink" href="https://www.mysite.be/">https://www.mysite.be/</a><!-- m --> [R=301,L] #RewriteCond %{REQUEST_URI}!^/fivewin/ #RewriteRule ^(.*)$ <!-- m --><a class="postlink" href="https://www.mysite.be/">https://www.mysite.be/</a><!-- m --> [R=301,L] RewriteRule !^fivewin($|/) <!-- m --><a class="postlink" href="https://mysite.be/">https://mysite.be/</a><!-- m --> [L,R=301] RewriteRule !^eshop($|/) <!-- m --><a class="postlink" href="https://mysite.be/">https://mysite.be/</a><!-- m --> [L,R=301] <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> Options +SymLinksIfOwnerMatch -MultiViews RewriteEngine on RewriteRule . - [E=REWRITEBASE:/] RewriteCond %{REQUEST_URI} /$ RewriteCond %{QUERY_STRING} !(^|&)rand= RewriteCond %{QUERY_STRING} !(^|&)mylogout= RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php?fc=module&module=advancedcms&controller=adcms&id_cms=22&rewrite=Maveco_Main [L] </IfModule>
Change htaccess for access to 1 folder
Dear Marc, With mod_harbour CGI version we do it this way: [code=fw:1bnjgc24]<div class="fw" id="{CB}" style="font-family: monospace;"><Directory C:/xampp/htdocs><br />  RewriteEngine <span style="color: #0000ff;">on</span><br />  RewriteRule ^<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>a-zA-Z<span style="color: #000000;">&#93;</span>*<span style="color: #000000;">&#41;</span>$ /cgi-bin/modharbour.exe?$<span style="color: #000000;">1</span> <span style="color: #000000;">&#91;</span>NC,QSA<span style="color: #000000;">&#93;</span><br /></Directory></div>[/code:1bnjgc24] [url:1bnjgc24]https&#58;//github&#46;com/FiveTechSoft/mod_harbour/tree/master/cgi[/url:1bnjgc24] I wasn't aware of [url:1bnjgc24]http&#58;//www&#46;301-redirect&#46;online[/url:1bnjgc24] thank you
Change oBrw:aSelected outsite xbrowse
Can we change the status of aSelected? The idea is that I call several functions (one by one) with a different ordscope() selection. The result records of that selection should be set to .t. in de aSelected Next again a ordscope with other results, but these also need to be set .t. in aselected. etc... Finaly all selections are made and oBrw:aSelected contains all record from different searches/selections. redraw of xbrowse should show all the records in aSelected.
Change oBrw:aSelected outsite xbrowse
Purpose of oBrw:aSelected is totally different. What you want is you prepare an array of record numbers, which you want to show in xbrowse. In this sample, aRecs represent the array aSelected you are referring to: [code=fw:31h355qz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBrw<br />   <span style="color: #00C800;">local</span> aRecs    := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">20</span> <span style="color: #000000;">&#125;</span><br /><br />   USE STATES<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FILTER BY ARRAY"</span><br /><br />   @ <span style="color: #000000;">80</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE <span style="color: #ff0000;">"STATES"</span> ;<br />      COLUMNS <span style="color: #ff0000;">"RECNO()"</span>, <span style="color: #ff0000;">"CODE"</span>, <span style="color: #ff0000;">"NAME"</span> ;<br />      HEADERS <span style="color: #ff0000;">"REC"</span> PICTURES <span style="color: #ff0000;">"999"</span> ;<br />      CELL LINES NOBORDER ;<br />      ROWS aRecs<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"CHANGE RECORDS"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span> := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">23</span>, <span style="color: #000000;">47</span> <span style="color: #000000;">&#125;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:31h355qz] [url=https&#58;//imageshack&#46;com/i/pnXtlT4hg:31h355qz][img:31h355qz]https&#58;//imagizer&#46;imageshack&#46;com/img923/7705/XtlT4h&#46;gif[/img:31h355qz][/url:31h355qz]
Change oBrw:aSelected outsite xbrowse
Thanks for sending me in the correct direction !! In every lookup function (afther selection) I will add records to the array with a dbeval(....aadd()..)
Change of control owner
Hi, There are 2 controls on the window - a [b:1e4txqrl]Tbutton[/b:1e4txqrl] and a [b:1e4txqrl]TPanel[/b:1e4txqrl]. I need to tell the [b:1e4txqrl]TButton[/b:1e4txqrl] that it belongs to the [b:1e4txqrl]TPanel[/b:1e4txqrl]. How can this problem be solved ?
Change of control owner
Dear Yuri, When you create the TButton you use .. OF <TPanelObject> Another way is to use Windows API function SetParent() [url:1y3waedg]https&#58;//learn&#46;microsoft&#46;com/en-us/windows/win32/api/winuser/nf-winuser-setparent[/url:1y3waedg]
Change of structure during development
Hey, Every couple of day, while my program grows, I have to change (add) more fields into the online database Now I go into my phpMyadmin and change the structure and continue. I've seen that there are functions to change it from FWH. What approach do you mostly take ?
Change of structure during development
Hi Marc Sorry for my bad english, i use this code for add columns if fieldpos("c_emdirec") < 1 gci_sqlexe("ALTER TABLE gci_empresas ADD c_emdirec CHAR(60) DEFAULT '' NOT NULL AFTER c_emname2") gci_sqlexe("ALTER TABLE vcnewbos ADD tas_detrac NUMERIC(5,2) DEFAULT '0.00' NOT NULL AFTER des_newbos") end if if you need change colums this code : if len(cdo_cuenta) == 12 gci_sqlexe("ALTER TABLE vcpatpcg MODIFY cdo_cuenta CHAR(14) DEFAULT '' NOT NULL") end if gci_sqlexe is my function to invoke mysql in ADO or TDolphin maybe have other names
Change of structure during development
FWH implementation Examples: Adding a numeric column [code=fw:wkr8jdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">AddColumn</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"mytale"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"columnname"</span>, <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> --> lSuccess<br />&nbsp;</div>[/code:wkr8jdlx] Altering a column. Assuming we have a column with name "member_name" with width 20. We want to alter the width as 30 [code=fw:wkr8jdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">AlterColumn</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"mytable"</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"member_name"</span>, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:wkr8jdlx] Second parameter is like the column specification in our familiar DBF structure. Rename a column: [code=fw:wkr8jdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">RenameColumn</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"mytable"</span>, <span style="color: #ff0000;">"oldcolumnname"</span>, <span style="color: #ff0000;">"newcolumnname"</span> <span style="color: #000000;">&#41;</span> --> lSucess<br />&nbsp;</div>[/code:wkr8jdlx] If we have a table without primary key and (a) we want to add an auto-increment field as primary key [code=fw:wkr8jdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">AddAutoInc</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"tablename"</span>, <span style="color: #ff0000;">"columnname"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:wkr8jdlx] (b) we want to make one of the existing columns as primary key [code=fw:wkr8jdlx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCn:<span style="color: #000000;">MakePrimaryKey</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"tablename"</span>, <span style="color: #ff0000;">"columnname"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:wkr8jdlx]
Change of structure during development
Exactly what I needed. Thanks all.
Change on Vertical show with xbrowse
Antonio publishes on Topic Utilitades/planitllas this sample to show vertical a record on xbrowse [code=fw:1nfo3uj0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oCol, aRecord, nAt := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;USE Customer<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;aRecord = Array<span style="color: #000000;">&#40;</span> Customer-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY aRecord <span style="color: #B900B9;">// AUTOSORT</span><br /><br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">&#123;</span> || Customer-><span style="color: #000000;">&#40;</span> FieldName<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"FieldName"</span> &nbsp; <br /><br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">&#123;</span> || Customer-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"Value"</span> &nbsp; <br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> = MARQSTYLE_HIGHLROW<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bKeyCount</span> = <span style="color: #000000;">&#123;</span> || Customer-><span style="color: #000000;">&#40;</span> FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">oClient</span> = oBrw &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br />&nbsp;</div>[/code:1nfo3uj0] This show all fields of customer.dbf But If we want show only some fields of this dbf How We can do ? sample If we create two array sample : aFields:={First,Last ,state,salary } aNames:={"Name","surname" ,"State","salary" } and call a function Ut_BrwColVert(cDbf,aFields,aNames) I tried to create this function but not run well because not take the right field FUNCTION Ut_BrwColVert(cDbf,aTitles,aFields) local oDlgVista, oBrw Local nBottom := 33 Local nRight := 66 Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 ) Local nHeight := nBottom * DLG_CHARPIX_H lOCAL aStruct IF LEN(aFields)=0 aStruct := (cdbf)->( DbStruct() ) ELSE aStruct :=aFields eNDIF IF nType =1 If Len( aStruct) != Len(aTitles) msginfo("Error on titles - fields","ATTENtION!") return nil ENDIF DEFINE DIALOG oDlgVista SIZE nWidth, nHeight ; Title "Visualizzazione verticale" @ 0,0 XBROWSE oBrw OF oDlgVista COLUMNS 1 HEADERS "Campi" ; COLSIZES 140; ARRAY aStruct CELL LINES NOBORDER SIZE -1,-20 ADD TO oBrw DATA (cdbf)->(FieldGet(oBrw:nArrayAt)) TITLE "Valori" oBrw:aCols[ 1 ]:bEditValue := { ||aTitles[ oBrw:nArrayAt ] } oBrw:aCols[ 1 ]:nWidth := 200 oBrw:aCols[ 2 ]:nWidth := 300 oBrw:CreateFromCode() @ 230, 193 BUTTON oBtn PROMPT "&Uscita" OF oDlgVista SIZE 40, 15; PIXEL ACTION oDlgVista:end() ACTIVATE DIALOG oDlgVista center return nil
Change on Vertical show with xbrowse
If you want just the same functionality of the above sample, i.e, without editing and navigation of dbf, this simple function works for you. [code=fw:xxx5nyvp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Name"</span>, &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"First"</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SurName"</span>, &nbsp; <span style="color: #ff0000;">"Last"</span> &nbsp; <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"State"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">"State"</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Salary"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"Salary"</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp; &nbsp;CUST-><span style="color: #000000;">&#40;</span> Ut_BrwColVert<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CLOSE CUST<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">function</span> Ut_BrwColVert<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, cAlias<br /><br />&nbsp; &nbsp;cAlias &nbsp; := <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> cAlias<br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE aCols ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->&<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"ColumnName"</span>, <span style="color: #ff0000;">"ColumnValue"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:xxx5nyvp]
Change on Vertical show with xbrowse
I suggest you first compile and test the code above. Here I am posting a more elaborate function. This function provides (1) editing the field (2) buttons to navigate the dbf (3) resizes the dialog to fit the contents of the browse. [code=fw:2u15cv5m]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />*<br />*  XBRVERT.PRG<br />*  Apr 29-2013 05:13 AM<br />*<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aCols    := <span style="color: #000000;">&#123;</span> ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Name"</span>,      <span style="color: #ff0000;">"First"</span>  <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SurName"</span>,   <span style="color: #ff0000;">"Last"</span>   <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"State"</span>,     <span style="color: #ff0000;">"State"</span>  <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Salary"</span>,    <span style="color: #ff0000;">"Salary"</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span><br /><br />   USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />   GO TOP<br /><br />   CUST-><span style="color: #000000;">&#40;</span> FldVertBrowse<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   CLOSE CUST<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #0000ff;">init</span> procedure PrgInit<br /><br />   SET DATE ITALIAN<br />   SET CENTURY <span style="color: #0000ff;">ON</span><br />   SET TIME FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HH:MM:SS"</span><br />   SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">YEAR</span><span style="color: #000000;">&#40;</span>DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-50</span><br /><br />   SET DELETED <span style="color: #0000ff;">ON</span><br />   SET EXCLUSIVE OFF<br /><br />   RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br />   XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'E'</span>, .t. <span style="color: #000000;">&#41;</span><br />   SetKinetic<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />   SetGetColorFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> FldVertBrowse<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, oFont, nRec, hRes<br />   <span style="color: #00C800;">local</span> nSelect  := <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aBrw     := AClone<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />   nRec           := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   <span style="color: #B900B9;">// --------- BUTTONS FOR NAVIGATION OF DBF --------------------//</span><br /><br />   hRes           := GetResources<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   SET RESOURCES <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"PREV32.DLL"</span><br /><br />   @ <span style="color: #000000;">05</span>, <span style="color: #000000;">10</span> BUTTONBMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> BITMAP <span style="color: #ff0000;">"Top2"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">05</span>, <span style="color: #000000;">30</span> BUTTONBMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> BITMAP <span style="color: #ff0000;">"Previous2"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">00</span>,<span style="color: #000000;">050</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"RecNo"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">09</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">050</span> <span style="color: #0000ff;">GET</span> nRec <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">UPDATE</span> ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">05</span>, <span style="color: #000000;">95</span> BUTTONBMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> BITMAP <span style="color: #ff0000;">"Next2"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">05</span>,<span style="color: #000000;">115</span> BUTTONBMP <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> BITMAP <span style="color: #ff0000;">"Bottom2"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   SetResources<span style="color: #000000;">&#40;</span> hRes <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">//------------ XBROWSE DEFINITION --------------------//</span><br /><br />   @ <span style="color: #000000;">30</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">280</span>,<span style="color: #000000;">260</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE aBrw ;<br />      COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> &<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />      HEADERS  <span style="color: #ff0000;">"Column"</span>, <span style="color: #ff0000;">"ColumnValue"</span> ;<br />      CELL LINES NOBORDER FASTEDIT <span style="color: #0000ff;">UPDATE</span><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">lHScroll</span>       := .f.<br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, oBrw:<span style="color: #000000;">nRecSelColor</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />         :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> |o,x,n| <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n != VK_ESCAPE .and. DbRLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />               <span style="color: #000000;">&#40;</span> FieldPut<span style="color: #000000;">&#40;</span> FieldPos<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, x <span style="color: #000000;">&#41;</span>, DbRUnlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      END<br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #B900B9;">// -------------- ACTIVATE DIALOG -------------------//</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> DlgInit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DlgInit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg     := oBrw:<span style="color: #000000;">oWnd</span><br />   <span style="color: #00C800;">local</span> aDim     := <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">nWidth</span>, oBrw:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">// ----- RESIZE DIALOG TO FIT THE CONTENTS OF BROWSE -------//</span><br /><br />   oBrw:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">nWidth</span> < <span style="color: #000000;">284</span><br />      oBrw:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">284</span><br />      oBrw:<span style="color: #000000;">nStretchCol</span>  := <span style="color: #000000;">2</span><br />   <span style="color: #00C800;">endif</span><br />   oDlg:<span style="color: #000000;">nWidth</span>    += <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nWidth</span>  - aDim<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">nHeight</span>   += <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nHeight</span> - aDim<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">ColStretch</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">Center</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br /><span style="color: #00C800;">return</span> .f.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2u15cv5m] I have used 'prev32.dll' for the button bitmaps. If your dll name is different, please change in the program.
Change on Vertical show with xbrowse
Thanks Mr. Rao, this is that I mean!
Change on Vertical show with xbrowse
I made some modifies : I insert a buttonbar and insert your buttons and get....[b:2nfhbeqr]only the say is not transparent [/b:2nfhbeqr] ( Isaw on rpreview but not run ok) [img:2nfhbeqr]http&#58;//img507&#46;imageshack&#46;us/img507/1643/vertg&#46;jpg[/img:2nfhbeqr] [code=fw:2nfhbeqr]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />   <span style="color: #B900B9;">/*<br />    *<br />    *  XBRVERT.PRG<br />    *  Apr 29-2013 05:13 AM<br />    *<br />    */</span><br /><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><br />      <span style="color: #00D7D7;">#define</span> LIGHTCYAN        nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">203</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span><br /><br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />    REQUEST DBFCDX<br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />    <span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />               <span style="color: #B900B9;">/*<br />       local aCols    := { ;<br />          { "Name",      "First"  }, ;<br />          { "SurName",   "Last"   }, ;<br />          { "State",     "State"  }, ;<br />          { "Salary",    "Salary" }  }<br />                 */</span><br /><br /><br />            <span style="color: #00C800;">local</span> aCols    := <span style="color: #000000;">&#123;</span> ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Name"</span>,<span style="color: #ff0000;">"FIRST"</span>  <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Surname"</span> , <span style="color: #ff0000;">"LAST"</span> <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Address"</span>,<span style="color: #ff0000;">"STREET"</span> <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"City"</span>,<span style="color: #ff0000;">"CITY"</span>   <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"State"</span>,<span style="color: #ff0000;">"STATE"</span>  <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"HireDate"</span>,<span style="color: #ff0000;">"HIREDATE"</span> <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Married"</span>,<span style="color: #ff0000;">"MARRIED"</span> <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Age"</span>,<span style="color: #ff0000;">"AGE"</span>    <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Salary"</span>,<span style="color: #ff0000;">"SALARY"</span> <span style="color: #000000;">&#125;</span>, ;<br />              <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Notes"</span>,<span style="color: #ff0000;">"NOTES"</span>  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br /><br /><br /><br /><br />       USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />       GO TOP<br /><br />       CUST-><span style="color: #000000;">&#40;</span> FldVertBrowse<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />       CLOSE CUST<br /><br />    <span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />    <span style="color: #0000ff;">init</span> procedure PrgInit<br /><br />       SET DATE ITALIAN<br />       SET CENTURY <span style="color: #0000ff;">ON</span><br />       SET TIME FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HH:MM:SS"</span><br />       SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">YEAR</span><span style="color: #000000;">&#40;</span>DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-50</span><br /><br />       SET DELETED <span style="color: #0000ff;">ON</span><br />       SET EXCLUSIVE OFF<br /><br />       RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br />       XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'E'</span>, .t. <span style="color: #000000;">&#41;</span><br />       SetKinetic<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />       SetGetColorFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">return</span><br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />    <span style="color: #00C800;">function</span> FldVertBrowse<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">local</span> oDlg, oBrw, oFont, nRec, hRes<br />       <span style="color: #00C800;">local</span> nSelect  := <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">local</span> aBrw     := AClone<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #00C800;">Local</span> nBottom   := <span style="color: #000000;">37</span><br />        <span style="color: #00C800;">Local</span> nRight    := <span style="color: #000000;">75</span><br />        <span style="color: #00C800;">Local</span> nWidth :=  <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br /><br />          nRec           := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg  <span style="color: #0000ff;">SIZE</span> nWidth,nHeight ;<br />       <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">"Visualizzazione verticale"</span> <span style="color: #0000ff;">FONT</span> oFont ;<br />       GRADIENT <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>,CLR_WHITE, LIGHTCYAN <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />       <span style="color: #B900B9;">//------------ XBROWSE DEFINITION --------------------//</span><br /><br />       @ <span style="color: #000000;">14</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">296</span>,<span style="color: #000000;">250</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />          DATASOURCE aBrw ;<br />          COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> &<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />          HEADERS  <span style="color: #ff0000;">"Colonna"</span>, <span style="color: #ff0000;">"Valore"</span> ;<br />          CELL LINES NOBORDER FASTEDIT <span style="color: #0000ff;">UPDATE</span><br /><br />       WITH OBJECT oBrw<br />          :<span style="color: #000000;">lHScroll</span>       := .f.<br />          oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, oBrw:<span style="color: #000000;">nRecSelColor</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />          oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">100</span><br />          oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">200</span><br />          WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />             :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />             :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> |o,x,n| <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n != VK_ESCAPE .and. DbRLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                   <span style="color: #000000;">&#40;</span> FieldPut<span style="color: #000000;">&#40;</span> FieldPos<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, x <span style="color: #000000;">&#41;</span>, DbRUnlock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />          END<br />          <span style="color: #B900B9;">//</span><br />          :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       END<br /><br /><br /><br /><br />       @ <span style="color: #000000;">138</span>,<span style="color: #000000;">98</span> <span style="color: #0000ff;">Button</span> <span style="color: #ff0000;">"&Exit"</span> <span style="color: #0000ff;">Action</span> odlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span><br /><br />       <span style="color: #B900B9;">// -------------- ACTIVATE DIALOG -------------------//</span><br /><br />       <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>DlgInit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span>,oDlgBar<span style="color: #000000;">&#40;</span>oDlg,oBrw,nSelect,nRec<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />       <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br />        <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> oDlgBar<span style="color: #000000;">&#40;</span>oDlg,oBrw,nSelect,nRec<span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">Local</span> oBar,oFontBar,oSay,oRec<br />           <span style="color: #00C800;">Local</span> hRes:= GetResources<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           SET RESOURCES <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"PREV32.DLL"</span><br /><br /><br /><br />           <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">24</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">OF</span> oDlg  <span style="color: #000000;">2007</span><br /><br />                 <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />                 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Top2"</span>       ;<br />                 <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span> ;<br />                 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <span style="color: #000000;">&#41;</span>,oRec:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                 oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />                 NOBORDER<br /><br /><br />                 <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />                 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Previous2"</span>  ;<br />                 <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span> ;<br />                 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span>,oRec:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                 oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                 NOBORDER<br /><br /><br /><br />                  @ <span style="color: #000000;">2</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span>  <span style="color: #ff0000;">"RecNo :"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span><br /><br />                  @ <span style="color: #000000;">2</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">GET</span> oRec <span style="color: #0000ff;">VAR</span>  nRec <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">65</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">UPDATE</span> ;<br />                        <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nRec <span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                       oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />                 @ <span style="color: #000000;">2</span>,<span style="color: #000000;">290</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span>  <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0.5</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">CENTER</span>   <span style="color: #0000ff;">FONT</span> oFontBar<br />                  oSay:<span style="color: #000000;">lTransparent</span> = .T.<br /><br />                    <span style="color: #00D7D7;">#define</span> NULL_BRUSH <span style="color: #000000;">5</span><br />                     FixSays<span style="color: #000000;">&#40;</span> oBar:<span style="color: #000000;">hWnd</span>, GetStockObject<span style="color: #000000;">&#40;</span> NULL_BRUSH <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br /><br /><br /><br />                 <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />                 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Next2"</span>      ;<br />                 <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span>,oRec:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                 oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                 NOBORDER<br /><br />                 <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />                 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Bottom2"</span>    ;<br />                 <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdKeyNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> < OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                 <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nSelect <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nRec := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,oRec:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                 oDlg:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />                 NOBORDER<br />                SetResources<span style="color: #000000;">&#40;</span> hRes <span style="color: #000000;">&#41;</span><br /><br />         <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />    <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DlgInit<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">local</span> oDlg     := oBrw:<span style="color: #000000;">oWnd</span><br />       <span style="color: #00C800;">local</span> aDim     := <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">nWidth</span>, oBrw:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#125;</span><br /><br />       <span style="color: #B900B9;">// ----- RESIZE DIALOG TO FIT THE CONTENTS OF BROWSE -------//</span><br /><br />       oBrw:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">nWidth</span> < <span style="color: #000000;">284</span><br />          oBrw:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">284</span><br />          oBrw:<span style="color: #000000;">nStretchCol</span>  := <span style="color: #000000;">2</span><br />       <span style="color: #00C800;">endif</span><br />       oDlg:<span style="color: #000000;">nWidth</span>    += <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nWidth</span>  - aDim<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />       oDlg:<span style="color: #000000;">nHeight</span>   += <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nHeight</span> - aDim<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />       WITH OBJECT oBrw<br />          :<span style="color: #000000;">ColStretch</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />          :<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">Center</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />          :<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       END<br /><br />    <span style="color: #00C800;">return</span> .f.<br /><br />    <span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2nfhbeqr] I'd like insert it on lookup xbrowse main ( I create a button bar where I call XBRVERT.PRG) and how I can to create acols from xbrowse ? I thiked this : LOCAL nLen := Len( oBrowse:aCols ) LOCAL aHeader [ nLen ] LOCAL aShow [ nlen ] LOCAL aSizes [ nLen ] LOCAL aArray [ nLen ] FOR n := 1 TO nLen aHeader [ n ] := oBrowse:aCols[ n ]:cHeader aShow [ n ] := ! oBrowse:aCols[ n ]:value aArray [ n ] := {aHeader[n],aShow[n]} NEXT xbrowse.....oBrw:SetArray(aArray) it can run ?
Change on Vertical show with xbrowse
[img:1kvqcpyy]http&#58;//img33&#46;imageshack&#46;us/img33/9710/vertjo&#46;jpg[/img:1kvqcpyy] I made ( but it run bad) oBrowse is the main xbrowse table [code=fw:1kvqcpyy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Function</span> testsilvio<span style="color: #000000;">&#40;</span>cDbf, oBrowse<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nLen := Len<span style="color: #000000;">&#40;</span> oBrowse:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> aHeader <span style="color: #000000;">&#91;</span> nLen <span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">LOCAL</span> aShow <span style="color: #000000;">&#91;</span> nlen <span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">LOCAL</span> aSizes <span style="color: #000000;">&#91;</span> nLen <span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">LOCAL</span> aArray <span style="color: #000000;">&#91;</span> nLen <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nLen<br />&nbsp; &nbsp; &nbsp; &nbsp;aHeader <span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> := oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aShow <span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> := oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;aArray <span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span>aHeader<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>,aShow<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><br /><span style="color: #B900B9;">//call your vertical function </span><br />&nbsp; &nbsp;FldVertBrowse<span style="color: #000000;">&#40;</span>aArray <span style="color: #000000;">&#41;</span><br /><br />&nbsp;RETUR <span style="color: #00C800;">NIL</span></div>[/code:1kvqcpyy] strange If I made xbrowser aArray I can see good !!!
Change parent
Hi all !I want to take MDICHILD dialog(from external MDI application) and change him parent on my window. It's OK. But I not chage size or move this MDICHILD dialog - error external MDI application.What's that ?
Change parent
Natter,Please provide a small and self contained PRG to reproduce the error, thanks
Change parent
How may know list name styles of external application window ?
Change position of Modal Dialog?
Hi my friends! How I can change the position ( Top and Left ) of a modal dialog at runtime? It's possible? Thanks for all!
Change position of Modal Dialog?
Julio, oDlg:nTop = ... oDlg:nLeft = ...
Change position of Modal Dialog?
[quote="Antonio Linares":1z27jg6e]Julio, oDlg:nTop = ... oDlg:nLeft = ...[/quote:1z27jg6e] First, thanks Antonio... This is my situation: [code:1z27jg6e] DEFINE DIALOG oDlg RESOURCE "GRID_SELECTION" OF oDlgP &#46;&#46;&#46; ACTIVATE DIALOG oDlg ON INIT &#40; oDlg&#58;move&#40; oDlgP&#58;nTop, oDlgP&#58;nLeft,,, &#46;T&#46; &#41; &#41; [/code:1z27jg6e] But, the method move() put the top and left of the main window, not of the oDlgP. I'm crazy? hehehe I want this: the dialog oDlg get the bottom and left position of the oDlgP!
Change position of Modal Dialog?
Try with functions WndTop(oDlgp:hWnd) and WndLeft(oDlgp:hWnd)
Change position of Modal Dialog?
[quote="Biel EA6DD":1j5neruu]Try with functions WndTop(oDlgp:hWnd) and WndLeft(oDlgp:hWnd)[/quote:1j5neruu] Gabriel.... this not fun! <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Change position of Modal Dialog?
Hello Cesar, maybe you can try with oDlg:Move(20,20,700,800,.t.) Regards, Otto [code:k3s2qaeb] // //DEFINE DIALOG oDlg RESOURCE "GRID_SELECTION" OF oDlgP //&#46;&#46;&#46; //ACTIVATE DIALOG oDlg ON INIT &#40; oDlg&#58;move&#40; oDlgP&#58;nTop, oDlgP&#58;nLeft,,, &#46;T&#46; &#41; &#41; //EMG #include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oDlg, oBtn LOCAL oGet1, oGet2 LOCAL cVar1 &#58;= SPACE&#40; 30 &#41; LOCAL cVar2 &#58;= SPACE&#40; 60 &#41; DEFINE DIALOG oDlg @ 1, 1 GET oGet1 VAR cVar1 @ 1, 1 GET oGet2 VAR cVar2 @ 3, 1 BUTTON oBtn PROMPT "Scientific"; ACTION CHANGE&#40; oDlg, oBtn, oGet1, oGet2 &#41; ACTIVATE DIALOG oDlg; ON INIT oGet2&#58;Hide&#40;&#41; RETURN NIL STATIC FUNCTION CHANGE&#40; oDlg, oBtn, oGet1, oGet2 &#41; IF oBtn&#58;GetText&#40;&#41; = "Scientific" oDlg&#58;SetSize&#40; 500, , &#46;T&#46; &#41; oDlg&#58;Move&#40;200,300,700,800,&#46;t&#46;&#41; oBtn&#58;SetText&#40; "Standard" &#41; oGet1&#58;Hide&#40;&#41; oGet2&#58;Show&#40;&#41; ELSE oDlg&#58;SetSize&#40; 300, , &#46;T&#46; &#41; oDlg&#58;Move&#40;20,20,700,800,&#46;t&#46;&#41; oBtn&#58;SetText&#40; "Scientific" &#41; oGet1&#58;Show&#40;&#41; oGet2&#58;Hide&#40;&#41; ENDIF RETURN NIL[/code:k3s2qaeb]
Change position of Modal Dialog?
[quote="Otto":2z09x1p5]Hello Cesar, maybe you can try with oDlg:Move(20,20,700,800,.t.) Regards, Otto [code:2z09x1p5] // //DEFINE DIALOG oDlg RESOURCE "GRID_SELECTION" OF oDlgP //&#46;&#46;&#46; //ACTIVATE DIALOG oDlg ON INIT &#40; oDlg&#58;move&#40; oDlgP&#58;nTop, oDlgP&#58;nLeft,,, &#46;T&#46; &#41; &#41; //EMG #include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oDlg, oBtn LOCAL oGet1, oGet2 LOCAL cVar1 &#58;= SPACE&#40; 30 &#41; LOCAL cVar2 &#58;= SPACE&#40; 60 &#41; DEFINE DIALOG oDlg @ 1, 1 GET oGet1 VAR cVar1 @ 1, 1 GET oGet2 VAR cVar2 @ 3, 1 BUTTON oBtn PROMPT "Scientific"; ACTION CHANGE&#40; oDlg, oBtn, oGet1, oGet2 &#41; ACTIVATE DIALOG oDlg; ON INIT oGet2&#58;Hide&#40;&#41; RETURN NIL STATIC FUNCTION CHANGE&#40; oDlg, oBtn, oGet1, oGet2 &#41; IF oBtn&#58;GetText&#40;&#41; = "Scientific" oDlg&#58;SetSize&#40; 500, , &#46;T&#46; &#41; oDlg&#58;Move&#40;200,300,700,800,&#46;t&#46;&#41; oBtn&#58;SetText&#40; "Standard" &#41; oGet1&#58;Hide&#40;&#41; oGet2&#58;Show&#40;&#41; ELSE oDlg&#58;SetSize&#40; 300, , &#46;T&#46; &#41; oDlg&#58;Move&#40;20,20,700,800,&#46;t&#46;&#41; oBtn&#58;SetText&#40; "Scientific" &#41; oGet1&#58;Show&#40;&#41; oGet2&#58;Hide&#40;&#41; ENDIF RETURN NIL[/code:2z09x1p5][/quote:2z09x1p5] Yes, I tried! But this is the problem.... is a Dialog opened from another Dialog... the value must be from the first Dialog, but it get a value of top and left from the main window! I'm crazy, that's it!!! Really, I want one thing: The second dialog must be show exactly on top of first dialog, with top and left!
Change position of Modal Dialog?
Julio, You need to turn absolute coordinates into relative ones. Please review function ScreenToClient() Please make a search for ScreenToClient in these forums. There are several examples of its use
Change position of Modal Dialog?
Cesar, I think you are right. There is no function opposite to the SetWindowPos = GetWindowPos in FIVEWIN. oDlg:nTop() returns 0 in my tests @ 3, 16 BUTTON "Top" SIZE 40, 12 ACTION msginfo(oDlg:nTop()) Maybe you can store the nTop of the first DIALOG in a STATIC and then use this STATIC for the second DIALOG. If you move the first you must change the STATIC VAR too. Regards, Otto
Change position of Modal Dialog?
As Biel pointed, WndTop( oDlg:hWnd [,nNewTop] ) should work similar to oDlg:nTop
Change position of Modal Dialog?
Antonio, where do you get nNewTop from? Regards, Otto
Change position of Modal Dialog?
Otto, Its a new value for nTop. oWnd:nTop is equivalent to WndTop( oWnd:hWnd ) and oWnd:nTop := 5 is equivalent to WndTop( oWnd:hWnd, 5 )
Change position of Modal Dialog?
Cesar, maybe this is what you need. Regards, Otto [code:3mbfaxds]#include "fivewin&#46;ch" STATIC nTop, nLeft STATIC oWnd function main&#40;&#41; local oWnd DEFINE WINDOW oWnd TITLE "oWnd1" ; FROM 5, 5 TO 24, 64 ACTIVATE WINDOW oWnd on Init f_dlg&#40;&#41; return nil func f_dlg local oDlg, oIco, cTest &#58;= "Hello world! " local nTop DEFINE ICON oIco FILE "&#46;&#46;\icons\fivewin&#46;ico" DEFINE DIALOG oDlg TITLE "I am a DialogBox" COLOR "W+/B" ; ICON oIco of Ownd @ 1, 3 GET cTest @ 3, 5 BUTTON "Ok" SIZE 40, 12 ; ACTION &#40; xCheck&#40; oDlg &#41;, f_dlg2&#40;&#41; &#41; DEFAULT ACTIVATE DIALOG oDlg CENTERED ; VALID MsgYesNo&#40; "Do you want to end ?" &#41; return nil function xCheck&#40; oDlg &#41; local aPoint &#58;= &#123; 0, 0 &#125; aPoint = ClientToScreen&#40; oDlg&#58;hWnd, aPoint &#41; if aPoint&#91; 1 &#93; > 32768 aPoint&#91; 1 &#93; -= 65535 endif if aPoint&#91; 2 &#93; > 32768 aPoint&#91; 2 &#93; -= 65535 endif nTop&#58;= aPoint&#91; 1 &#93; - 20 nLeft&#58;= aPoint&#91; 2 &#93; //msginfo&#40;STR&#40;nTop&#41; + " " +str&#40;nLeft&#41; &#41; return nil func f_dlg2&#40;&#41; local oDlg, oIco, cTest &#58;= "Hello world! " DEFINE DIALOG oDlg TITLE "I am a DialogBox" of oWnd @ 3, 5 BUTTON "&Ok" SIZE 40, 12 ; ACTION oDlg&#58;End&#40;&#41; DEFAULT ACTIVATE DIALOG oDlg ON INIT oDlg&#58;Move&#40;nTop,nLeft,,,&#46;t&#46;&#41; return nil [/code:3mbfaxds]
Change position of Modal Dialog?
[quote="Antonio Linares":d5tvhl0b]Julio, You need to turn absolute coordinates into relative ones. Please review function ScreenToClient() Please make a search for ScreenToClient in these forums. There are several examples of its use[/quote:d5tvhl0b] Yes Antonio.... with ScreenToClient() , It's work fine! Otto, thanks too! Thanks very much! With much strenght!! <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->
Change size on a Ribbon Group
I must change the size of a group of a Tab of RibbonBar MENUITEM "Change Size" ACTION ( nwidthnew:= ChangeSize(oGrp:nWidth,"Change the size to group "+" ["+oGrp:cCaption+"]"),; oGrp:End(),oGrp:=( oRBar:AddGroup(nwidthnew,cCaption,nGroup)),; oRBar:Calcpos(), oRBar:display(),oRBar:refresh() ) I understood I must destroy the group and add a new group with the same nIndex ( number of Goup) [b:2w1cgr03] oGrp:End(),oGrp:=( oRBar:AddGroup(nwidthnew,cCaption,nGroup)),;[/b:2w1cgr03] but with oGrp:End() the ribbonbar make error ....or there is a bug on the ribbonbar class ChangeSize function is a simply dialog with a get to change the number size
Change size on a Ribbon Group
With the first Release of the Ribbonbar-Class < 08.2009 > I started with a Painter, but stopped the work on it. [color=#4000FF:1j8kw8z7]I understood I must destroy the group and add a new group with the same nIndex ( number of Goup) oGrp:End(),oGrp:=( oRBar:AddGroup(nwidthnew,cCaption,nGroup)),; but with oGrp:End() the ribbonbar make error ....or there is a bug on the ribbonbar class [/color:1j8kw8z7] [color=#FF0000:1j8kw8z7]I repainted the complete Ribbonbar on a Button-Action after changes ![/color:1j8kw8z7] My Solution : A painted Ribbonbar on the Main-Window. A Tool-window with Folders, to add / change Settings. ( the same Logic, I use in all my other tools ) With a Draw-button, I distroyed and repainted the Ribbonbar with the new Settings on the Main-Window. It works fine and I could add / resize Tabs, Groups , changing Colors ..... I think, to change / add something from inside the Ribbonbar, doesn't work and is to difficult to manage. As soon You want to create a PRG- and EXE-File, You have to define a Preview-Function of a Window with the Ribbonbar and the used Vars from the Folderpages. ( On the bottom of this post You can see, how to do it ( a Part of Code-Creation from the Button-Tools ) [img:1j8kw8z7]http&#58;//www&#46;pflegeplus&#46;com/pictures/ribbonb1&#46;jpg[/img:1j8kw8z7] Maybe it gives You a Idea, how to create it. Creating PRG- and EXE-File ( it is not easy and takes some Time ) [code=fw:1j8kw8z7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> MAKE_EXE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// c_path := CURDRIVE() + ":\" + GETCURDIR() </span><br /><span style="color: #00C800;">IF</span> FILE <span style="color: #000000;">&#40;</span>c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.PRG"</span><span style="color: #000000;">&#41;</span><br />   DELETE FILE  c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.PRG"</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> FILE <span style="color: #000000;">&#40;</span>c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.EXE"</span><span style="color: #000000;">&#41;</span><br />   DELETE FILE  c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.EXE"</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #B900B9;">// create the PRG</span><br />DO_SOURCE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> FILE <span style="color: #000000;">&#40;</span> c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.PRG"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// File exists open with Editor</span><br />   WAITRUN<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Angelwriter.exe "</span> + c_path  + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.prg"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// copy from .PRG</span><br />   <span style="color: #B900B9;">// Close Editor and create EXE-File</span><br />   <span style="color: #00C800;">IF</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Do you want to Create / Run : PROJECT.exe ?"</span>,<span style="color: #ff0000;">"PROJECT"</span><span style="color: #000000;">&#41;</span><br />      WAITRUN<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"GO.BAT"</span>  <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// the LINK-File !!!!</span><br />      <span style="color: #00C800;">IF</span> FILE <span style="color: #000000;">&#40;</span> c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.EXE"</span> <span style="color: #000000;">&#41;</span><br />         WINEXEC<span style="color: #000000;">&#40;</span> c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.EXE"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ELSE</span><br />         MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"The file : PROJECT.EXE "</span> + CRLF + ;<br />         <span style="color: #ff0000;">"is not created !"</span>,<span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">ELSE</span><br />   MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"The File : "</span> + CRLF + ;<br />      <span style="color: #ff0000;">"PROJECT.PRG"</span> + CRLF + ;<br />      <span style="color: #ff0000;">"is not created !"</span>, <span style="color: #ff0000;">"Error"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br />SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// ------- The Main-Window with Exit-Button --------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DO_SOURCE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />oText := TTxtFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\P</span>ROJECT.PRG"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> oText:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'#include "FiveWin.ch"'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'#include "Image.ch"'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"static oWnd, oButtFont, oSkinB"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FUNCTION Main()"</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'LOCAL oBtn1, oBtn2, hDC, oBrush, oImage'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LOCAL nWidth := GetSysMetrics(0)"</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LOCAL nHeight := GetSysMetrics(1)"</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SET _3DLOOK ON"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SetBalloon( .T. )"</span> <span style="color: #000000;">&#41;</span> <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'c_path := CURDRIVE() + ":<span style="color: #000000;">\"</span> + GETCURDIR()'</span><span style="color: #000000;">&#41;</span> <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'oProgFont := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. ) '</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'DEFINE WINDOW  oWnd  TITLE "Buttonbar- and Button-Test" '</span><span style="color: #000000;">&#41;</span> <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'oButtFont := TFont():New("Arial",0,-16,.F.,.T.,0,0,0,.T. ) '</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'DEFINE IMAGE oImage FILENAME c_path + "<span style="color: #000000;">\I</span>mages<span style="color: #000000;">\B</span>ACKGRD.JPG" '</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"@ nHeight - 160, nWidth - 420 BTNBMP oBtn1 SIZE 200, 60 OF oWnd  2007 ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'FILENAME c_path + "<span style="color: #000000;">\I</span>mages<span style="color: #000000;">\s</span>elect.bmp" ;'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LEFT ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'PROMPT "  &Preview Buttons " ; '</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FONT oButtFont ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ACTION Buttons(oWnd)"</span> <span style="color: #000000;">&#41;</span>  <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"oBtn1:lTransparent = .t. "</span> <span style="color: #000000;">&#41;</span>  <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'oBtn1:cTooltip :=  { "Open" + CRLF + ;'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'       "the Button-Test","Button-Test", 1, CLR_BLACK, 14089979 }'</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"@ nHeight - 160, nWidth - 200 BTNBMP oBtn2 SIZE 150, 60 OF oWnd  2007 ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'FILENAME c_path + "<span style="color: #000000;">\I</span>mages<span style="color: #000000;">\e</span>xit.bmp" ;'</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LEFT ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'PROMPT "  &Exit  " ;'</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FONT oButtFont ;"</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ACTION oWnd:End()"</span> <span style="color: #000000;">&#41;</span>  <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"oBtn2:lTransparent = .t."</span> <span style="color: #000000;">&#41;</span>   <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'oBtn2:cTooltip :=  { "Close" + CRLF + ;'</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'        "the VTitle-Painter","Close Window", 1, CLR_BLACK, 14089979 }'</span> <span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'ACTIVATE WINDOW oWnd MAXIMIZED ;'</span><span style="color: #000000;">&#41;</span> <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'ON PAINT ( DRAWBITMAP( hdc, oImage:hbitmap, 0, 0, nWidth, nHeight ) ) ;'</span><span style="color: #000000;">&#41;</span> <br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'VALID MsgYesNo( "Do you want to end?" )'</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"oProgFont:End()"</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"oButtFont:End()"</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />   oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'RETURN( NIL )'</span><span style="color: #000000;">&#41;</span> <br />   ....<br />   ....<br />   ....<br />   <span style="color: #B900B9;">// Call any Functions You need</span><br />   BAR_PART<span style="color: #000000;">&#40;</span> oText <span style="color: #000000;">&#41;</span> <br />   ....<br />   oText:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>  <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> <br /><span style="color: #B900B9;">// -- Numeric Vars use like ( Position ) : oText:Add("@ " + ALLTRIM(STR(nTop)) + ',' + ALLTRIM(STR(nLeft)) ... </span><br /><br /><span style="color: #B900B9;">// ---------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BAR_PART<span style="color: #000000;">&#40;</span> oText <span style="color: #000000;">&#41;</span><br /><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'// -------------  Buttonbar --------------------------------------'</span> <span style="color: #000000;">&#41;</span>  <br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FUNCTION MAKEBBAR(oDlg, oTextFont)"</span><span style="color: #000000;">&#41;</span><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LOCAL oBar, oButt1, oButt2, oButt3, oButt4, oButt5, oButt6, oButt7"</span><span style="color: #000000;">&#41;</span><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DEFINE BUTTONBAR oBar OF oDlg SIZE "</span> + ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>B_WIDTH<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span> + ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>B_HEIGHT<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" 3DLOOK  2007 TOP"</span> <span style="color: #000000;">&#41;</span><br />...<br />...<br />oText:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RETURN NIL"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:1j8kw8z7] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Change size on a Ribbon Group
UWE not use prg extern... ogrp:SETSIZE (..) [b:2p08xmtb]...not run[/b:2p08xmtb] ogrp:Move() [b:2p08xmtb] not run[/b:2p08xmtb] Also I reaprint the orbar with ::calcpos(),::display() but not run !! try to set before 200 to nwidth of a group then try to insert a button ( trbtn ) and create an action ACTION ( ogrp:nwidth:=300, ogrp:refresh(), orbar:calcpos(),orbar:display(),orbar:refresh()) [b:2p08xmtb]NOT RUN[/b:2p08xmtb]or ACTION ( ogrp:nwidth:=300, ogrp:setsize(,ogrp:nwidth), orbar:calcpos(),orbar:display(),orbar:refresh()) [b:2p08xmtb]NOT RUN[/b:2p08xmtb]
Change size to dialog during execution program
Hello, I have a browse and four buttoms inside of a dialog and I need to expand the dialog and browse to adjust to screen resolution and move the buttons to other position. Does somebody know as doing it? Regards,
Change size to dialog during execution program
oDialog:nWidth = ... oDialog:nHeight = ... <oControl>:nTop = ... <oControl>:nLeft ... <oControl>:nWidth = ... <oControl>:nHeight = ...
Change size to dialog during execution program
Hi, CLASS TDialog FROM TWindow METHOD Autoresize(ntop,nleft) METHOD Autoresize(ntop,nleft) local i,rsl0,rsl1 DEFAULT ntop:=0 DEFAULT nleft:=0 rsl0:=getsysmetrics(0)/800 if rsl0<=1; return ; end //<=800*600, not needed rsl1:=getsysmetrics(1)/600 for i:=1 TO LEN(::acontrols) oCtrol = ::aControls[i] aRect = GetCoors( oCtrol:hWnd ) if oCtrol:classname()=="TCOMBOBOX" oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1) else oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1, (aRect[4] - aRect[2])*rsl0, (aRect[3] - aRect[1])*rsl1, .t. ) end next aRect = GetWndRect( ::hWnd ) ::Move( ntop,nleft,::nWidth*rsl0, ::nHeight*rsl1, .T. ) if ::lCentered WndCenter( ::hWnd ) else if Empty( ::cResName ) ::Move( ::nTop, ::nLeft ) endif endif return In you app define dialog odlg redefine controls ... ... activate dialog odlg on init odlg:autoresize() Regards, Shuming Wang
Change size to dialog during execution program
Thanks for your reply. But I have a problem, the fix text or literals in a dialog are not resized. Do you know how can I manage it to resize it? Thanks in advance, Jose Alfonso
Change size to dialog during execution program
So far,-1 Id not support yet. You could change like this: redefine say prompt ' ... ...' of odlg id 111 Regards Shuming Wang
Change sort order on browse when clicking on header
How do I interchange between a descending and ascending sort order in a Xbrowse? [code=fw:3p0ci2hb]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #0000ff;">SELECT</span> myfile<br />  DATABASE oDbfG<br />   <span style="color: #B900B9;">//create temporary index</span><br />  oDbfG:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> ,<span style="color: #ff0000;">"NumberD"</span>,<span style="color: #ff0000;">"myfile->number"</span>, ,.T.,.T.<span style="color: #000000;">&#41;</span><br />  oDbfG:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> ,<span style="color: #ff0000;">"Number"</span> , <span style="color: #ff0000;">"myfile->number"</span>, ,   ,.T.<span style="color: #000000;">&#41;</span><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Main"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Main"</span> <span style="color: #0000ff;">FONT</span> oFont<br />    oDbfG:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFuente <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">226</span>,<span style="color: #000000;">241</span>,<span style="color: #000000;">254</span><span style="color: #000000;">&#41;</span> ;<br />     AUTOSORT DATASOURCE oDbfG;<br />     FIELDS oDbfG:<span style="color: #000000;">number</span><br />     <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> HEADERS <span style="color: #ff0000;">"Number"</span> ;<br />     SIZES           <span style="color: #000000;">110</span><br />      <br />     WITH OBJECT oBrw<br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cSortOrder</span> := <span style="color: #ff0000;">"number"</span><br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span>  := oFont<br /><span style="color: #B900B9;">// Try this among dozen other combinations but will not work</span><br /><br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">&#123;</span> || nOrden++, IIF<span style="color: #000000;">&#40;</span>nOrden><span style="color: #000000;">2</span>, <span style="color: #000000;">&#123;</span>nOrder:=<span style="color: #000000;">0</span>, oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">cSortOrder</span>=<span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#125;</span>, ;<br />                                                    IIF<span style="color: #000000;">&#40;</span>nOrden=<span style="color: #000000;">1</span>, oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">cSortOrder</span>=<span style="color: #ff0000;">"number"</span>, ;<br />                                                                     oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">cSortOrder</span>=<span style="color: #ff0000;">"numberD"</span> <span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br />   END</div>[/code:3p0ci2hb] Ascending sort is working when clicking on header, but will not change to descending or back to none. Thanks Emiliano Llano Díaz
Change sort order on browse when clicking on header
Please try this sample. Click on header toggles ascending and descending orders. That is the default behavior, if not modified in the application program. Sample code: [code=fw:234awvzb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDbf, oDlg, oBrw, oFont<br /><br />&nbsp; &nbsp;USE \FWH\SAMPLES\STATES <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;DATABASE oDbf<br /><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"TMPCODE"</span>, <span style="color: #ff0000;">"CODE"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"TMPNAME"</span>, <span style="color: #ff0000;">"NAME"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TMPCODE"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-16</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE oDbf ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"CODE"</span>, <span style="color: #ff0000;">"NAME"</span> ; <span style="color: #B900B9;">// do not use FIELDS clause</span><br />&nbsp; &nbsp; &nbsp; SORT <span style="color: #ff0000;">"TMPCODE"</span>, <span style="color: #ff0000;">"TMPNAME"</span> ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;oDbf:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:234awvzb] [url=https&#58;//imageshack&#46;com/i/pnwscyU4g:234awvzb][img:234awvzb]https&#58;//imageshack&#46;com/a/img923/4564/wscyU4&#46;gif[/img:234awvzb][/url:234awvzb]
Change sort order on browse when clicking on header
As always, right on the point. Everything back to normal when changing FIELDS to COLUMNS. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> My final example (in case someone is stuck): [code=fw:b6i257l6]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-16</span> BOLD<br />  <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-14</span> BOLD<br /><br />  <span style="color: #0000ff;">Select</span> IsActive<br />  SET ORDER <span style="color: #0000ff;">TO</span> TAG <span style="color: #ff0000;">"ID"</span><br /><br />  <span style="color: #0000ff;">SELECT</span> MyFile<br />  DATABASE oDbfG<br /><br />   <span style="color: #B900B9;">//create temporary indexes: CreateIndex( [cFile], cTag, cKey, [lUnique], [lDescend], [lMemory] )</span><br />  oDbfG:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"Numbr"</span>, <span style="color: #ff0000;">"MyFile->Numbr"</span>                           , <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,.T.<span style="color: #000000;">&#41;</span><br />  oDbfG:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"cName"</span>, <span style="color: #ff0000;">"Left(PADR(ALLTRIM(MyFile->cName),25),25)"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,.T.<span style="color: #000000;">&#41;</span><br />  oDbfG:<span style="color: #000000;">CreateIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"Born"</span>,   <span style="color: #ff0000;">"DTOS(MyFile->fecnac)"</span>                     , <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>,.T.<span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oShow <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Show_Main"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Main"</span> <span style="color: #0000ff;">FONT</span> oFont<br />    oDbfG:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    oDbfG:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Numbr"</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #B900B9;">// reserve column 5 for a bitmap</span><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oShow <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">226</span>,<span style="color: #000000;">241</span>,<span style="color: #000000;">254</span><span style="color: #000000;">&#41;</span> ;<br />       DATASOURCE oDbfG;<br />       COLUMNS <span style="color: #ff0000;">"Numbr"</span>, <span style="color: #ff0000;">"cName"</span>, <span style="color: #ff0000;">"Born"</span>, <span style="color: #ff0000;">"Sex"</span>, <span style="color: #ff0000;">" "</span> ;<br />       SORT    <span style="color: #ff0000;">"Numbr"</span>, <span style="color: #ff0000;">"cName"</span>, <span style="color: #ff0000;">"Born"</span>, <span style="color: #00C800;">nil</span>  , <span style="color: #00C800;">nil</span> ;<br />       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> HEADERS <span style="color: #ff0000;">"ID"</span>,<span style="color: #ff0000;">"Name"</span>,<span style="color: #ff0000;">"Date"</span>,<span style="color: #ff0000;">"Sex"</span>,<span style="color: #ff0000;">"Active"</span> ;<br />       SIZES           <span style="color: #000000;">70</span>,  <span style="color: #000000;">220</span>,    <span style="color: #000000;">100</span>,  <span style="color: #000000;">70</span>,    <span style="color: #000000;">40</span> ;<br />       AUTOSORT CELL LINES NOBORDER <br />       <br />     WITH OBJECT oBrw<br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span>  := oFont1<br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span>  := oFont1<br /><br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'ON'</span> <span style="color: #000000;">&#41;</span><br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'OFF'</span> <span style="color: #000000;">&#41;</span><br />       :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bBmpData</span>:=<span style="color: #000000;">&#123;</span> || IIF<span style="color: #000000;">&#40;</span> IsActive-><span style="color: #000000;">&#40;</span>DBSEEK<span style="color: #000000;">&#40;</span>MyFile->Numbr<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />       :<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">&#123;</span>|nKey| Move_Line<span style="color: #000000;">&#40;</span>oShow, nKey, oBrw, cImages<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />       :<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span>|| Show_Register<span style="color: #000000;">&#40;</span>cImages, oBrw<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     END   <br /><br />  <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oShow <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>HB_SYMBOL_UNUSED<span style="color: #000000;">&#40;</span><span style="color: #00C800;">self</span><span style="color: #000000;">&#41;</span>,;<br />                  Show_Bar<span style="color: #000000;">&#40;</span>oShow,oBrw,@num,cImages<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />  oFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:b6i257l6] Thanks Emiliano Llano Díaz
Change sort order on browse when clicking on header
Why show_bar() function ON INIT? We can now create buttonbars for dialogs also just like in windows.
Change sort order on browse when clicking on header
You are right again. But in this particular case is because this depends on 3 different scenarios that I did not include on the sample: In my program it something like this: [code=fw:18mfqg9t]<div class="fw" id="{CB}" style="font-family: monospace;">Show_Bar<span style="color: #000000;">&#40;</span>aryFile,oShow,oBrw,@num,Company,cImages,nWhich<span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">//nWhich indicates the bar to display and options to hide or show</span><br /> </div>[/code:18mfqg9t]
Change style of a dialog or window ( Solved )
Define window ownd; STYLE ( WS_POPUP ) CAn i make it outside this call ? i want make as: oWnd:Style( WS_POPUP ) y tryed this: oWnd:nStyle:= nOr (WS_POPUP) ( no show error ) more no work how is when i do it in define window ....
Change style of a dialog or window ( Solved )
lailton, oWnd: nStyle -= WS_POPUP [quote="lailton.webmaster"]Define window ownd; STYLE ( WS_POPUP ) CAn i make it outside this call ? i want make as: oWnd:Style( WS_POPUP ) y tryed this: oWnd:nStyle:= nOr (WS_POPUP) ( no show error ) more no work how is when i do it in define window ....[/quote]
Change style of a dialog or window ( Solved )
Thanks more yet continue. it´s no work to me.
Change style of a dialog or window ( Solved )
Lailton, [code=fw:2shxbw3w]<div class="fw" id="{CB}" style="font-family: monospace;">oWnd:<span style="color: #000000;">nStyle</span> := nOr <span style="color: #000000;">&#40;</span>oWnd:<span style="color: #000000;">nStyle</span>, WS_POPUP<span style="color: #000000;">&#41;</span></div>[/code:2shxbw3w]
Change style of a dialog or window ( Solved )
Hello Lailton: You should use SetWindowLong function to change the window's style. The WS_POPUP style shouldn't be used alone but combined with at least another one eg WS_VISIBLE. Try this sample:[code=fw:3stv7p0k]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#define</span> GWL_STYLE         <span style="color: #000000;">-16</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">Local</span> oWnd<br /><br />   <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Window</span> oWnd <span style="color: #0000ff;">From</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">To</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"ok"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> ;<br />                  <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> SetWindowLong<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span>, GWL_STYLE, nOr<span style="color: #000000;">&#40;</span>  WS_VISIBLE, WS_POPUP <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                                    oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"End"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Window</span> oWnd<br />                                                              <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:3stv7p0k] Best regards. Manuel Mercado Gomez.
Change style of a dialog or window ( Solved )
mmercado and StefanHaupt, it´s work fine !! Thanks so much... <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Change style's to DATA
I'm with a trouble to change a Buttombmp style(especificaly WS_TABSTOP) and a LOT of good programmers don't know how to change the style in execution... I think that change the nStyle for logical Data will solve all this troubles... [code:fbni0hos] Ex&#46;&#58; Redefine ButtonBMP oBtn; ID 100 Prompt "Can be focused"; Update; Action CanFocus(oBtn) Procedure CanFocus(oObj) oObj&#58;&#91;red&#93;WS_TABSTOP&#91;/red&#93; &#58;= !oObj&#58;WS_TABSTOP if oObj&#58;WS_TABSTOP oObj&#58;settext( "Can't be focused" ) else oObj&#58;settext( "Can be focused" ) end oObj&#58;Refresh() Return [/code:fbni0hos] The only trouble I see is a lot of classes to be changed (or not I don't know how it can be done)
Change style's to DATA
You can use: SetWindowLong( oBtn:hWnd, GWL_STYLE, nXor( GetWindowLong( oBtn:hWnd, GWL_STYLE ), WS_TABSTOP ) )
Change style's to DATA
Thanks Linares, I already discover how to change <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> but it's difficult to understand.
Change style's to DATA
Windows API's rules <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Change style's to DATA
[quote="Antonio Linares":xcendhtc]Windows API's rules <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:xcendhtc] Where I can find these rules? PS.: If it was in portuguese is better for me...
Change style's to DATA
On MSDN. EMG
Change style's to DATA
Samir, <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms633591(VS.85">http://msdn.microsoft.com/en-us/library/ms633591(VS.85</a><!-- m -->).aspx <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms633584(VS.85">http://msdn.microsoft.com/en-us/library/ms633584(VS.85</a><!-- m -->).aspx
Change style's to DATA
Thanks, I will take a look <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Change system colors - 2007/2010 style
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=21910">viewtopic.php?f=3&t=21910</a><!-- l --> That would be wonderfull if we can change the color of 2007 clause and change the color of all system with that...
Change te picture of a get according the contents
Hello, A Belgium bank nr always have the same picture. 999-9999999-99 Sometimes the client is from another country and has a bank nr with another picture. How can I change the picture of the field when the window is running. The idea is to start all nrs with "BE" So the picture will be : "!!-999-9999999-99" where the first 2 characters will be by default "BE" When the get got focus the position of the cursor should be 4. When the content of the first 2 characters is "BE" the picture should have to be "!!-999-9999999-99" Otherwise the picture should be "!!-xxxxxxxxxxxxxxx" Does anybody have an idea how to fix this. Thanks Willy Hermans. Thanks, Willy
Change te picture of a get according the contents
You could try using ON CHANGE and changing the picture (oGet:oGet:cPicture). But I would just let the user type in whatever they want, then post process it to put it in the correct format and put it back into the GET. If it doesn't appear to be valid data, then you can turn the background a different color to signify that the data is invalid. James
Change te picture of a get according the contents
Thanks James, I have tried it this way, and indeed this is a better way. Thanks for the advice. Willy.
Change te picture of a get according the contents
Maybe you should use ComboBox (or other control) to let a user select approciated picture format himself? Vladimir Grigoriev
Change te picture of a get according the contents
Vladimir: You can change the get picture whenever you want with: IF CRUB==1 oPuni:oGet:Picture:='999,999.9999' oPuni:Refresh() ELSE oPuni:oGet:Picture:='999,999.99' oPuni:Refresh() ENDIF Regards,
Change text button Toolbar
Hi, how is possible to change the text of a button in a toolbar? Thank you
Change text button Toolbar
Have you tried: oBtn:setText("New Text")?
Change text button Toolbar
Riccardo, You have to add this method to Class TToolBar: [code:1sebn8sr] METHOD SetText&#40; nButton, cText &#41; INLINE TBSetText&#40; &#58;&#58;hWnd, nButton, cText &#41; [/code:1sebn8sr] And this code to your app: [code:1sebn8sr] #pragma BEGINDUMP #include <hbapi&#46;h> #include <Windows&#46;h> #include <CommCtrl&#46;h> HB_FUNC&#40; TBSETTEXT &#41; &#123; HWND hToolBar = &#40; HWND &#41; hb_parnl&#40; 1 &#41;; TBBUTTONINFO tbi; memset&#40; &#40; char * &#41; &tbi, 0, sizeof&#40; tbi &#41; &#41;; tbi&#46;dwMask = TBIF_TEXT | TBIF_BYINDEX; tbi&#46;cbSize = sizeof&#40; TBBUTTONINFO &#41;; tbi&#46;pszText = hb_parc&#40; 3 &#41;; tbi&#46;cchText = hb_parclen&#40; 3 &#41;; SendMessage&#40; hToolBar, TB_SETBUTTONINFO, hb_parni&#40; 2 &#41; - 1, &#40; LPARAM &#41; &tbi &#41;; &#125; [/code:1sebn8sr] Then use it this way: [code:1sebn8sr] oToolbar&#58;SetText&#40; 1, "Hello" &#41; // set first button text [/code:1sebn8sr]
Change text button Toolbar
Antonio, thank you, works fine. I've modify the Method Commad of the TToolBar to have the nId of the buttom when pressed: Eval( bAction, Self ) -> Eval( bAction, Self, nID ) Bye Riccardo
Change text button Toolbar
Riccardo, > Eval( bAction, Self ) -> Eval( bAction, Self, nID ) Ok, we have also modified it here, though we may finally create a new Class TTBButton and the TBButton object will be supplied instead of nID.
Change text color and background of tRadio
I do like this: [code=fw:3ubew6jg]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">RADIO</span> ::<span style="color: #000000;">oRad760_DadosCobranca</span> ;<br />    <span style="color: #0000ff;">VAR</span> ::<span style="color: #000000;">oDs_ClientesEdit</span>:<span style="color: #000000;">COBRANCA</span> ;<br />    <span style="color: #0000ff;">ID</span> <span style="color: #000000;">761</span>,<span style="color: #000000;">762</span>,<span style="color: #000000;">763</span>,<span style="color: #000000;">764</span>  <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oFldDetalhes</span>:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> ;<br />    <span style="color: #0000ff;">Color</span> G_COLOR_SYS<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>,G_COLOR_SYS<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <br /> </div>[/code:3ubew6jg] In this example, G_COLOR_SYS (2) is white and G_COLOR_SYS (1) is the background. I can't change the colors of the text or the background of tRadio. Already tried the Bj: nClrText: = also does not work. This also happens with CheckBox. Would anyone know any method to make this possible? [img:3ubew6jg]https&#58;//i&#46;postimg&#46;cc/1Xm04z8X/SH-22-Nov-20-11-25&#46;jpg[/img:3ubew6jg]
Change text color and background of tRadio
As far as I know it is a problem to have active themes (also for checkboxes). This may work although for me it has never been a good solution. [code=fw:qapv5kuz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; SetWindowTheme<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oRad760_DadosCobranca</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:qapv5kuz]
Change text color and background of tRadio
When executing I get the message: [code=fw:1rgevfb7]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> &nbsp;<span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TRADMENU</span>:<span style="color: #000000;">HWND</span></div>[/code:1rgevfb7]
Change text color and background of tRadio
Sorry, try [code=fw:3umasqj0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SetWindowTheme<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oRad760_DadosCobranca</span>:<span style="color: #000000;">aItems</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3umasqj0]
Change text color and background of tRadio
Thanks, it worked. I better change the tRadio class so I don't have to mess with the whole system. I am creating a kind of Dark Theme, and if I could not change certain controls, it would not work. [code=fw:x837ev5i]<div class="fw" id="{CB}" style="font-family: monospace;">  ::<span style="color: #000000;">oDlgCadastro</span>:<span style="color: #000000;">bInit</span> := <||<br />    AEval<span style="color: #000000;">&#40;</span> lc_oSelf:<span style="color: #000000;">oCliDetConta</span>:<span style="color: #000000;">oRad760_DadosCobranca</span>:<span style="color: #000000;">aItems</span>,;<br />           <span style="color: #000000;">&#123;</span>|_oRadSeq|SetWindowTheme<span style="color: #000000;">&#40;</span> _oRadSeq:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />  > <span style="color: #B900B9;">//cEnd</span><br /> </div>[/code:x837ev5i] [img:x837ev5i]https&#58;//i&#46;postimg&#46;cc/D0Mq5JQN/SH-24-Nov-20-12-37&#46;jpg[/img:x837ev5i]
Change text color and background of tRadio
Ok, but I don't like the 3dlook style Try using also this and tell me if it works with redefined controls [code=fw:26w3sr9a]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Ctl3DLook<span style="color: #000000;">&#40;</span> <yourobjectcontrol>:<span style="color: #000000;">hWnd</span>, .F. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:26w3sr9a]
Change text color and background of tRadio
Giovany, Your design is very good, congratulations
Change text color and background of tRadio
I thought the [b:8wlbr73c]Set3DLook(.F.)[/b:8wlbr73c] function would solve this question
Change text color and background of tRadio
[quote="cnavarro":1xstv44c]Giovany, Your design is very good, congratulations[/quote:1xstv44c] Thank you Navarro. We have to show that Fivewin is beyond what we think we can do. Via Activex Integration [img:1xstv44c]https&#58;//i&#46;postimg&#46;cc/nhcZb3mB/SH-25-Nov-20-13-03&#46;jpg[/img:1xstv44c] Other controls [img:1xstv44c]https&#58;//i&#46;postimg&#46;cc/yd5yh6qn/SH-26-Nov-20-13-07&#46;jpg[/img:1xstv44c]
Change text color and background of tRadio
[quote="Giovany Vecchi":wqrs4a61][quote="cnavarro":wqrs4a61]Giovany, Your design is very good, congratulations[/quote:wqrs4a61] Thank you Navarro. We have to show that Fivewin is beyond what we think we can do. [/quote:wqrs4a61] [b:wqrs4a61][size=150:wqrs4a61]The limit is our imagination, without any doubt[/size:wqrs4a61][/b:wqrs4a61] [quote="Giovany Vecchi":wqrs4a61] I thought the Set3DLook(.F.) function would solve this question [/quote:wqrs4a61] Have you managed to solve the 3D effect?
Change text color and background of tRadio
[quote:3v0olq0a]Have you managed to solve the 3D effect?[/quote:3v0olq0a] I did not make it. I noticed that even putting at the beginning of the program the option Set3dLook (.F.) OR .T., Does not change anything.
Change the ""90% of resources"" for a REAL percentua
Antonio, I think it would be great if you can do this for FW/FWH, because When I have problems with decreasing resources, I have no idea where to see in which percentual it is, and on Win XP the FWH always returns 90%. Thanks, Kleyber Derick
Change the ""90% of resources"" for a REAL percentua
Kleyber, Googling it, we have found this interesting page: <!-- m --><a class="postlink" href="http://msdn.microsoft.com/msdnmag/issues/03/01/GDILeaks/default.aspx">http://msdn.microsoft.com/msdnmag/issue ... fault.aspx</a><!-- m --> Lets see if it may help.
Change the ""90% of resources"" for a REAL percentua
Here we can get a free GDI inspector: <!-- m --><a class="postlink" href="http://ltearno.free.fr/dpus/">http://ltearno.free.fr/dpus/</a><!-- m -->
Change the ""90% of resources"" for a REAL percentua
Antonio, Very interesting... is there a chance to put this in a simpler way inside FWH? Regards, Kleyber Derick