topic
stringlengths
1
63
text
stringlengths
1
577k
A problem in Vista
Marco, >Probably it it could happen in other situations but not in XP pro, Windows Server and Windows 7 As long as I have been programming in xbase (since the beginning of dBase) I have never seen an index that was affected by the Windows version, so from my experience it seems unlikely that this is what you are experiencing. Can you repeat the problem multiple times at will under Vista, and not under any other Windows version? Using the exact same EXE, DBFs and indexes? Can you repeat it on more than one PC running Vista? Can you create a small example program that shows the problem? I don't have Vista running here, but perhaps someone else can test it under Vista. Perhaps your index is corrupted? Try rebuilding the index. Regards, James
A problem in Vista
Hi Marco, [quote="MarcoBoschi":2l0elbua] Is there any known problem concerning Vista? [/quote:2l0elbua] The only problem I know with Vista is in a network environment. Here you have to disable [url=https://secure.wikimedia.org/wikipedia/en/wiki/Server_Message_Block:2l0elbua]SMB 2.0[/url:2l0elbua].
A problem in Vista
Marco, Perhaps it is a disk buffer issue. As a workaround, you could try a dbcommit() or closing and then reopening the database between creation and viewing the list where the invoice currently doesn't show. Regards, James
A problem in Vista
Marco, i have a windows 64 bit Home premium , and I have problem with ordsetfocus and sertorder ( cdx) , I worked on it from a week but the same cose run ok on wn xp prof 2600 also sp 3 then My friend Eduardo Freni of Florence sad me was happened : I erase the antivirus ( avira) from my computer and now it run ok, I not Know why ... I purchased the antivirus 3 licenses but I cannot use it perhaps I must use avg
A problem in Vista
Falconi, Did you exclude scanning of DBFs and index files? Perhaps that would solve the problem. Databases and indexes should always be excluded at least for performance reasons. James
A problem in Vista
I will return the next day and then I will try Thanks to everybody marco
A problem in Vista
jAMES , I not Know why... for a sample now I have a strange problem with xbrowse for the bitmaps on header at right (line 8714) but on xp professional this not happen, it is perhaps windows seven ? I saw also the avira take cdx files as spyware...
A problem in Vista
news: In today's session: - I disable from norton antivirus the folder of the application. - first test: OK - second test After an Invoice creation: - I return to main Menu (there is a CLOSE DATABASE instruction) - I select "Invoce" - a list of all invoices appears except last five invoices - with emagdbu, the most useful Enrico program I open invoices table and I've seen them all If I Exit from application and re-run it IF I select "Invoice" now the Invoice is visible. In my opinion this is a big problem of Vista
A problem in Vista
Erase all antivirus and spyware Avg seem run ok
A problem in Vista
Silvio: Ok
A problem in Vista
Marco, May I suggest this simple test. Use a copy of the invoice file and indexes. Create a simple program to open the file, add several new indexes, then close the file. Then reopen the file and use a browse to see if the new records are visible. You could probably do this with 20 lines of code or so. This test would eliminate your main program code as being an issue. Regards, James
A problem in Vista
Marco If you are in a network environment, you may consider disabling smb2 , this is also true for vista If not try to delete your index and build it again Hth Richard
A problem in Vista
There are only two pc. This Vista PC has a shared volume This problem occur in this PC, locally. I will creat this simple test Thanks again
A problem in xBrowse to change from Row to Col-preview ???
Hello, i noticed a problem from changing Row- to Col-preview.Row-Colors[img:2igkngzj]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting10&#46;jpg[/img:2igkngzj]Column-Colors[img:2igkngzj]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting11&#46;jpg[/img:2igkngzj]The switching works only once. I can switch from Row-colors to Col-colors.To switch back from Cols to Rows, doesn't work.The Browser shows still the Col-colors after switching.[code:2igkngzj] &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; THE SWITCH SELECTION ------ oLbx14 &#58;= TXBrowse&#40;&#41;&#58;New&#40; oFld&#58;aDialogs&#91;3&#93; &#41; oLbx14&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW oLbx14&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oLbx14&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oLbx14&#58;SetArray&#40; aBRSTYLE1 &#41; oLbx14&#58;aCols&#91; 1 &#93;&#58;cHeader = Padr&#40;"No&#46;", 3&#41; oLbx14&#58;aCols&#91; 2 &#93;&#58;cHeader = Padr&#40;"Style", 20&#41; oLbx14&#58;nRecSelColor = 15512898 oLbx14&#58;bClrSelFocus = &#123; || &#123; 16777215, 15512898 &#125; &#125; oLbx14&#58;bClrSel = &#123; || &#123; 16777215, 15512898 &#125; &#125; oLbx14&#58;lHScroll &#58;= &#46;F&#46; oLbx14&#58;lVScroll &#58;= &#46;F&#46; oLbx14&#58;lFooter &#58;= &#46;T&#46; oLbx14&#58;nFooterHeight &#58;= 15 oLbx14&#58;bLClicked &#58;= &#123; | nRow, nCol | &#40; BR_STYLE1 &#58;= oLbx14&#58;nRowSel, ; IIF&#40; BR_STYLE1 = 1, BRW_ROWS&#40;oLbx0&#41;, BRW_COLS&#40;oLbx0&#41; &#41; &#41; &#125; oLbx14&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Horizont"&#41; oLbx14&#58;aCols&#91; 2 &#93;&#58;AddResource&#40;"Vertikal"&#41; oLbx14&#58;aCols&#91; 2 &#93;&#58;bBmpData &#58;= &#123;|| oLbx14&#58;nArrayAt &#125; oLbx14&#58;aCols&#91; 2 &#93;&#58;bStrData &#58;= &#123;|| oLbx14&#58;aRow&#91;2&#93; &#125; oLbx14&#58;nArrayAt &#58;= 1 oLbx14&#58;nRowSel &#58;= 1 oLbx14&#58;CreateFromResource&#40; 140 &#41; &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46; // ---------------------------------------- FUNCTION BRW_ROWS&#40;oLbx0&#41; oLbx0&#58;bClrStd &#58;= &#123;|| IF &#40; EVAL &#40; oLbx0&#58;bKeyno, NIL, oLbx0 &#41; %2 == 0, ; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#41; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "Row-Colors","Attention" &#41; RETURN&#40; NIL &#41; // ---------------------------------------- FUNCTION BRW_COLS&#40;oLbx0&#41; oLbx0&#58;aCols&#91; 1 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;aCols&#91; 2 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL2 &#125; &#125; oLbx0&#58;aCols&#91; 3 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "Column-Colors","Attention" &#41; RETURN&#40; NIL &#41; // -------- a TEST-FUNCTION -------------------------------- FUNCTION SWITCHTEST&#40;oLbx0&#41; oLbx0&#58;bClrStd &#58;= &#123;|| IF &#40; EVAL &#40; oLbx0&#58;bKeyno, NIL, oLbx0 &#41; %2 == 0, ; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#41; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "ROW" &#41; oLbx0&#58;aCols&#91; 1 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;aCols&#91; 2 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL2 &#125; &#125; oLbx0&#58;aCols&#91; 3 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "COL" &#41; // ----- From this point no change !!!! -------------- oLbx0&#58;bClrStd &#58;= &#123;|| IF &#40; EVAL &#40; oLbx0&#58;bKeyno, NIL, oLbx0 &#41; %2 == 0, ; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#41; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "ROW" &#41; oLbx0&#58;aCols&#91; 1 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;aCols&#91; 2 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL2 &#125; &#125; oLbx0&#58;aCols&#91; 3 &#93;&#58;bClrStd &#58;= &#123;|| &#123; ROW_TEXT, ROW_COL1 &#125; &#125; oLbx0&#58;Refresh&#40;&#41; MsgAlert&#40; "COL" &#41; RETURN&#40; NIL &#41; [/code:2igkngzj]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
Hello,After some more tests, i found the situation for the problem :I start a browser with col-display like this :oLbx0:aCols[ 1 ]:bClrStd := {|| { ROW_TEXT, ROW_COL1 } } oLbx0:aCols[ 2 ]:bClrStd := {|| { ROW_TEXT, ROW_COL2 } } oLbx0:aCols[ 3 ]:bClrStd := {|| { ROW_TEXT, ROW_COL1 } } oLbx0:Refresh() After showing the col-display, i change to row-display.oLbx0:bClrStd := {|| IF ( EVAL ( oLbx0:bKeyno, NIL, oLbx0 ) %2 == 0, ; { ROW_TEXT, ROW_COL1 }, { ROW_TEXT, ROW_COL2 } ) } oLbx0:Refresh() Nothing happens.If i do it the other way : changing from Row-display to Col-display, it works.What can be wrong ?RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
I think that after oCol:bClrStd is set it has preference on oBrw:bClrStd.When a column is created the default value from oCol:bClrStd is oBrw:bClrStd , this means that oCol:bClrStd is only set when it is nilMaybe you have always to set oCol:bClrStd (for each column) :[code:50sykta3] FOR EACH oCol IN oLbx0&#58;aCols oCol&#58;bClrStd &#58;= &#123;|| IF &#40; EVAL &#40; oLbx0&#58;bKeyno, NIL, oLbx0 &#41; %2 == 0, &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#41; &#125; NEXT oLbx0&#58;Refresh&#40;&#41; [/code:50sykta3]
A problem in xBrowse to change from Row to Col-preview ???
>I think that after oCol:bClrStd is set it has preference on oBrw:bClrStd.When a column is created the default value from oCol:bClrStd is oBrw:bClrStd , this means that oCol:bClrStd is only set when it is nil>Yes. For obvious reasons.>IF ( EVAL ( oLbx0:bKeyno, NIL, oLbx0 ) %2 == 0,>Simpler way to write this is " If( oLbx0:KeyNo() % 2 == 0 ), ....... ">Maybe you have always to set oCol:bClrStd (for each column) :>That is one way of doing it.But more elegant way is something like this:nClr1 := .... , nClr2 := .... , nClr3 := ... , nClr4 := ....oCol:bClrStd := { || If( oLbx:KeyNo() % 2 == 0, { nCrl1, nClr2 }, {nClr3,nClr4} }After this we do not have to change the code blocks.Simply assign whatever new colors we want to nClr1, nClr2, etc.Browse will automatically paint with whatever colors the variables nClr1, nClr2, ... etc. represent.This would be the simplest way and code also is much more clear.Note:I have a slightly different way of programming.local aClrCol := { { clr1, clr2 }, { clr3, clr4 } }oCol:bClrStd := { || aClrCol[ oBrw:KeyNo % 2 + 1 ] }Now whenever I need, I just change the value of the relevant element in the array aClrCol. Example: aClrCol[ 2 ][ 2 ] := CLR_YELLOWNow next refresh will use this color
A problem in xBrowse to change from Row to Col-preview ???
Thank you very much for all the help.The work on the tools i can finish with this solution.Nearly all possible xBrowse-settings are tested and can be changed at runtime. This weekend, i create a download-link in the forum,hoping, the tools will be a help for the users.The final release will come after FWH-version 8.09 is out,because Antonio want's to fix the brush-problem :adjustment to data-area-size.Best RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
Hello,I changed the function BRW_HORIZ( oLbx0 ).The row-color-changes working fine.But there is still the problem :After switching to => BRW_VERTIC(oLbx0)the Row-display changes to Col-display.Calling BRW_HORIZ(oLbx0) again,the browser is not repainted.A download of the tools( nearly finished, the final-version comes this weekend ).If you like to view the problem on Folderpage 3 :This Version is for testing at runtime !!<!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_download/testbrw.zip">http://www.pflegeplus.com/fw_download/testbrw.zip</a><!-- m -->A version with dialog-preview :<!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_download/Browsetest1.zip">http://www.pflegeplus.com/fw_download/Browsetest1.zip</a><!-- m -->BRW_HORIZ(oLbx0) ==> display is okBRW_VERTIC(oLbx0) ==> display is okBRW_HORIZ(oLbx0) ==> doesn't work anymore !!!![code:rhpxg6ep] FUNCTION BRW_HORIZ&#40;oLbx0&#41; LOCAL hDC aClrCol &#58;= &#123; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#125; oLbx0&#58;bClrStd &#58;= &#123; || aClrCol&#91; oLbx0&#58;KeyNo % 2 + 1 &#93; &#125; oLbx0&#58;Refresh&#40;&#41; RETURN&#40; NIL &#41; // ---------------------------------------- FUNCTION BRW_VERTIC&#40;oLbx0&#41; Maybe to have something like in BRW_HORIZ&#40;oLbx0&#41; for Col-color-changing ??? // --------- CHANGES every 2&#46; Column ------------------------------- FUNCTION BRW_VERTIC&#40;oLbx0&#41; LOCAL nFOR aClrCol &#58;= &#123; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#125; lSELECT &#58;= &#46;T&#46; FOR nFOR &#58;= 1 TO LEN&#40; oLbx0&#58;aCols &#41; IF lSELECT = &#46;T&#46; oLbx0&#58;aCols&#91;nFOR&#93;&#58;bClrStd &#58;= &#123; || aClrCol&#91; nFOR % 2 + 1 &#93; &#125; lSELECT &#58;= &#46;F&#46; ELSE oLbx0&#58;aCols&#91;nFOR&#93;&#58;bClrStd &#58;= &#123; || aClrCol&#91; nFOR % 2 + 2 &#93; &#125; lSELECT &#58;= &#46;T&#46; ENDIF NEXT oLbx0&#58;Refresh&#40;&#41; RETURN&#40; NIL &#41; [/code:rhpxg6ep]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
Hello,It seems, there is another runtime problem like the left record-bar :I changed the display from runtime to a extra dialog ( same like for the Rec-bar ).There it works.You can test this version, if you like :Download :<!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Browsetest1.zip">http://www.pflegeplus.com/fw_downloads/Browsetest1.zip</a><!-- m -->Row-display :[img:2wjg7mee]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting12&#46;jpg[/img:2wjg7mee]Col-display :[img:2wjg7mee]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting13&#46;jpg[/img:2wjg7mee]With this solution, i can switch as often as i like.When it isn't possible, to do this with the main-browser,that wouldn't be nice, because it can be, i want to show special values in a colored Column and switch back to row-display.Maybe any solution ?RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
In the example above, you use oLbx0:bClrStd := { || aClrCol[ oLbx0:KeyNo % 2 + 1 ] } I don't see KeyNo as a data holder in xBrowse. There is a function. Can you explain this to me, or is there a change necessary for xbrowse ? I also noticed that the alternating color bars for xbrowse using this method don't always alternate. I assume that is the result of non-displayed, but deleted, records in the database.
A problem in xBrowse to change from Row to Col-preview ???
Hello Tim, there is nothing to add or to change. You can use the sample [color=#FF0000:345cqogo]testxbr2.prg [/color:345cqogo] for a Test and add some lines. Row-Color-Change [img:345cqogo]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwcol1&#46;jpg[/img:345cqogo] Column-Color-Change ( Add the Line for < Lost-Focus-Color > from Your other Question ) [img:345cqogo]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwcol2&#46;jpg[/img:345cqogo] [code=fw:345cqogo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />...<br /><span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span> <br />      oCol := oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span> <br />      oCol:<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span> <br />      oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">&#123;</span>|o, v, n| iif<span style="color: #000000;">&#40;</span> n != VK_ESCAPE, FieldPut<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">nCreationOrder</span>, v <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br /><span style="color: #00C800;">next</span> <br /><br /><span style="color: #B900B9;">// Choose the Color-Display You need.</span><br /><span style="color: #B900B9;">// Add these Lines :</span><br /><span style="color: #B900B9;">// --------------------</span><br /><span style="color: #B900B9;">// BRW_VERTIC(oBrw)</span><br />BRW_HORIZ<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /><br />oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />...<br />...<br /><span style="color: #B900B9;">// --------------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BRW_HORIZ<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> hDC<br /><span style="color: #00C800;">LOCAL</span> aClrCol := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">15122321</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">16509392</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br /><br />oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || aClrCol<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">KeyNo</span> % <span style="color: #000000;">2</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <br /><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</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 /><span style="color: #B900B9;">// --------- CHANGES every 2. Column -------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BRW_VERTIC<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nFOR<br /><span style="color: #00C800;">LOCAL</span> aClrCol := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">15122321</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">16509392</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br /><br />lSELECT := .T.<br /><span style="color: #00C800;">FOR</span> nFOR := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">IF</span> lSELECT = .T. <br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>nFOR<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || aClrCol<span style="color: #000000;">&#91;</span> nFOR % <span style="color: #000000;">2</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />      lSELECT := .F.<br />   <span style="color: #00C800;">ELSE</span><br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>nFOR<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || aClrCol<span style="color: #000000;">&#91;</span> nFOR % <span style="color: #000000;">2</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />      lSELECT := .T.<br />   <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</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 /> </div>[/code:345cqogo] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse to change from Row to Col-preview ???
Dear Rao, [quote="nageswaragunupudi":2rfyz8so]> oCol:bClrStd := { || If( oLbx:KeyNo() % 2 == 0, { nCrl1, nClr2 }, {nClr3,nClr4} } [/quote:2rfyz8so] I've used this following but it shows below image. What's wrong? oTbw:KeyNo() is show on the most right column. [code=fw:2rfyz8so]<div class="fw" id="{CB}" style="font-family: monospace;">oTbw:<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> iif<span style="color: #000000;">&#40;</span> GST->GST_GSTYPE=<span style="color: #ff0000;">'V'</span> , CLR_HRED , CLR_BLACK <span style="color: #000000;">&#41;</span>, iif<span style="color: #000000;">&#40;</span>oTbw:<span style="color: #000000;">Keyno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>%<span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>,<span style="color: #000000;">15122321</span>,<span style="color: #000000;">16509392</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span></div>[/code:2rfyz8so] [url=http&#58;//img509&#46;imageshack&#46;us/i/keyno2&#46;jpg/:2rfyz8so][img:2rfyz8so]http&#58;//img509&#46;imageshack&#46;us/img509/5655/keyno2&#46;th&#46;jpg[/img:2rfyz8so][/url:2rfyz8so] Regards, Dutch
A problem in xBrowse to change from Row to Col-preview ???
Mr Dutch If you are using ADSCDX of RDDADS, you experience this problem. In that case, replace "obrw:keyno" in your expression as "(oBrw:cAlias)->( OrdKeyNo() )" This gives correct count for the color block
A problem in xBrowse to change from Row to Col-preview ???
Dear Rao, Yes, master. You are absolutely right. I used "ADSCDX" and your comment is correctly. Thanks master, Dutch
A problem in xBrowse with => oBrw:nRecSelColor
Hello, I want to change the Rec-Select-Color at runtime.It seems, there is a problem.The background-color of the pointer changes.[code:lxjsk26z] oLbx20&#58;bLClicked &#58;= &#123; | nRow, nCol | ROW_POS6 &#58;= oLbx20&#58;nRowSel, ; SELCOLOR &#58;= NEW_SELCOL&#40;&#41;, ; // new selected color oLbx0&#58;SetBackGround&#40; &#41;, ; // tested erase background &#40; doesn't help &#41; oLbx0&#58;nRecSelColor &#58;= SELCOLOR, ; // new Color for record select oLbx0&#58;Refresh&#40;&#41; &#125; [/code:lxjsk26z][img:lxjsk26z]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting5&#46;jpg[/img:lxjsk26z]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse with => oBrw:nRecSelColor
As of now, we can not change it at runtime
A problem in xBrowse with => oBrw:nRecSelColor
Thank you very much,for the moment i leave it like that.I hope, it works with BITMAPS and BRUSHES.It is the next test.RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse with => oBrw:nRecSelColor
Hello,It seems, the complete Record-selector-part doesn't work at runtime.The background-color is disabled and the old pointer is still visible.( It means, for folder-page-preview No. 5, i have to open a extrapreview-dialog )[img:cl2r0zq8]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting6&#46;jpg[/img:cl2r0zq8][code:cl2r0zq8] // Brush Select // ------------------ REDEFINE BUTTONBMP oBtn40 ID 50 OF oFld&#58;aDialogs&#91;5&#93; ; ACTION &#40; cFilter &#58;= "BMP &#40;*&#46;bmp&#41;|*&#46;bmp|" , ; cNewBITM &#58;= cGetFile32&#40; cFilter,"Select a Picture"&#41;, ; IIF&#40; empty&#40; cNewBITM &#41;, ; MsgAlert&#40; "No file selected !","ATTENTION" &#41;, NIL &#41;, ; BRSELECT1 &#58;= cFileNoPath&#40; cNewBITM &#41;, oBRSELECT1&#58;Refresh&#40;&#41;, ; oLbx0&#58;hBrushRecSel&#40; BRSELECT1 &#41;, oLbx0&#58;Refresh&#40;&#41; &#41; ; BITMAP "bitmap" PROMPT " &Brush" TEXTRIGHT oBtn40&#58;cToolTip = &#123; "Select a " + CRLF + "xBrowse-Brush", "Brush-Select", 1, CLR_BLACK, 14089979 &#125; [/code:cl2r0zq8]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem in xBrowse with => oBrw:nRecSelColor
How i solved the problem :A copy of the original Browser is shown in a extra dialog.I think, nobody will change this at runtime in his application.It is just for the tools. That was the rest of the visual-part, i had to test. I couldn't find any other problems in xBrowse. [img:3740r8wv]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting7&#46;jpg[/img:3740r8wv]I tested BMP ( 15 x 15 with a red circle )Is there a special format to be used ?It looks a bit funny.oBmp5 := ReadBitmap( 0, BRSELECT2 ) // the BitmapoLbx0:hBmpRecSel( oBmp5 )[img:3740r8wv]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting8&#46;jpg[/img:3740r8wv]i don't know why, but this didn't workDEFINE BRUSH oBrush5 FILE BRSELECT1 // the BrushoLbx0:hBrushRecSel( oBrush5 )RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem saving linecolors ( new image ) with xImage
Hello, I noticed a problem using xImage [color=#0000FF:19ydm99k]<[b:19ydm99k] save and paste [/b:19ydm99k]>[/color:19ydm99k] painting on a image and past as a new image from clipboard, the pen-color gets lost using past in any other programs like word it works. I think nobody did any paintings on a image before to see the result. [color=#4000FF:19ydm99k][b:19ydm99k]paintings inside the original[/b:19ydm99k][/color:19ydm99k] [img:19ydm99k]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/XImg1&#46;jpg[/img:19ydm99k] The result with white lines <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> [img:19ydm99k]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/XImg2&#46;jpg[/img:19ydm99k] [b:19ydm99k][color=#0000FF:19ydm99k]paste in word or any other program like pixelformer works[/color:19ydm99k][/b:19ydm99k] <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> [img:19ydm99k]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/XImg3&#46;jpg[/img:19ydm99k] [img:19ydm99k]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/draw3&#46;jpg[/img:19ydm99k] it seems to be something wrong in [b:19ydm99k]METHOD Save( lAsViewed, cFile, nQuality ) METHOD Paste()[/b:19ydm99k] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem saving linecolors ( new image ) with xImage
1) Try "SaveAsViewed" and save as bmp file. 2) Can you post your code how are you drawing on the image?
A problem saving linecolors ( new image ) with xImage
I used it otherwise the painting is not included [quote:1d5mmkv7]1) Try "SaveAsViewed" and save as bmp file.[/quote:1d5mmkv7] The same usage but with a quality-difference // xImage DEFINE BUTTON OF oDlg:oBar PROMPT "Save xImage" CENTER ; ACTION ( oImage1:Save( .T., c_path1 + "EXPORT\" + "SAVED1.JPG", 100 ), ; MsgInfo( "saved as saved1.jpg" ) ) // TImage DEFINE BUTTON OF oDlg:oBar PROMPT "Save Image" CENTER ; ACTION ( oImage2:SaveImage( c_path1 + "EXPORT\" + "SAVED2.JPG", 2, 100 ), ; MsgInfo( "saved as saved2.jpg" ) ) With the test it is possible to save with Timage or xImage the EXE and PRG is included usage : 1. with mouse-dblclick activate drawing 2. with mouse-dblclick stop drawing 3. after finish drawing select < new from clipboard > using this button Your drawing is saved to the clipboard and painted inside a new dialog. 4. next You can save the image with xImage or TImage 5. View the saved image with < show image-export >. Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/XIMG2.zip">http://www.pflegeplus.com/DOWNLOADS/XIMG2.zip</a><!-- m --> [img:1d5mmkv7]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/xImg12&#46;jpg[/img:1d5mmkv7] combination You can switch between free draw and line from x to y a line startposition is auto-connected to the end-position of free draw. [img:1d5mmkv7]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/xImg14&#46;jpg[/img:1d5mmkv7] loaded from clipboard [img:1d5mmkv7]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/xImg13&#46;jpg[/img:1d5mmkv7] save-results 1. save with xImage 2. show saved file ( white lines ) 3. save with TImage 4. show saved file ( OK ) [img:1d5mmkv7]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/xImg15&#46;jpg[/img:1d5mmkv7] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem to display last column using oBrw:GoRightMost()
Hello, because of many columns, I use [color=#0040FF:3t5u2w2l][b:3t5u2w2l]oBrw:GoRightMost() [/b:3t5u2w2l][/color:3t5u2w2l]on buttonaction to show the end-results. The last column is not shown complete. Normal crolling shows the full size of the last column. [img:3t5u2w2l]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Rightmost&#46;jpg[/img:3t5u2w2l] any idea, to solve the problem ? best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem to display last column using oBrw:GoRightMost()
Mr Ukoenig, Perhaps, a workaround: [code=fw:il3yisox]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> GO_RIGHT_MOST <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GoRightMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:il3yisox] Regards
A problem to display last column using oBrw:GoRightMost()
I added : oBrw:GoRight() NO difference, only a part of the last column is shown. best regards Uwe <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
A problem to display last column using oBrw:GoRightMost()
Ok, Now try: [code=fw:3sv8x1ye]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> GO_RIGHT_MOST <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">GoRightMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoLeft</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">GoRight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:3sv8x1ye]
A problem to display last column using oBrw:GoRightMost()
I found a solution : COLUMNS { "NACHNAME", "VORNAME", "RTYP", ; "KOST_RZH", "KOST_BEI", "KOST_PRI", ; "KRK", "KRX", ; "FK0", "PFX0", "PFK1", "PFX1", "PFK2", "PFX2", "PFK3", "PFX3", ; "B1X", "PBK", "PBX", "B2X", ; "PRA", "VPK", "VPX", "PRI", "BERG", "SUMME", "PKT_SUMME", "RECH_DATUM", [color=#0000FF:9b7w0fw9]"RECH_DATUM"[/color:9b7w0fw9] } ; It works with the last column defined twice and column-size 1 [color=#008000:9b7w0fw9]oCol := oBrw1:oCol( "RECH_DATUM" ) oCol:bStrData := { || (cMUmsName)->RECH_DATUM } oCol:cHeader := "Erstellt" oCol:nWidth := 90 oCol:nDataStrAlign := AL_CENTER oCol:nHeadStrAlign := AL_CENTER[/color:9b7w0fw9] [color=#0000FF:9b7w0fw9]oCol := oBrw1:oCol( "RECH_DATUM" ) oCol:bStrData := { || (cMUmsName)->RECH_DATUM } oCol:cHeader := "" oCol:nWidth := 1 oCol:nDataStrAlign := AL_CENTER oCol:nHeadStrAlign := AL_CENTER[/color:9b7w0fw9] [img:9b7w0fw9]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Rightmost1&#46;jpg[/img:9b7w0fw9] maybe any other solution ? best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem to display last column using oBrw:GoRightMost()
Thank You very much. The solution with the combination works fine. The GORIGHT - selection : REDEFINE BTNBMP oBtn3 OF oFld:aDialogs[ 1 ] ; ID 302 PIXEL 2007 ; BORDER ; FILENAME c_Pfad1 + "Rechts.Bmp" ; [color=#0000FF:1538byon]ACTION ( oBrw1:GoRightMost(), oBrw1:GoLeft(), oBrw1:GoRight(), oBrw1:Refresh() ) ;[/color:1538byon] CENTER best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A problem to display last column using oBrw:GoRightMost()
you're welcome best regards
A problem using METRO Menu ?
Hello, I noticed testing TOUCH.prg from /Samples DEFINE METROPANEL oMetro OF oWnd TITLE "Finances" ; COLOR CLR_WHITE, CLR_BLUE [color=#FF0000:ddpy01l1][b:ddpy01l1]oMetro:lDesignMode := .T. oMetro:nMetroTop = 250 oMetro:nMetroMargin = 100 oMetro:nBtnSize = 110 oMetro:nSliderTop = 170[/b:ddpy01l1][/color:ddpy01l1] DEFINE METROBUTTON oBtn OF oMetro LARGE ; GROUP 2 ; COLOR CLR_BLUE, CLR_HGREEN ; CAPTION "sample menu" ; ALIGN "BOTTOMCENTER" ; BODYTEXT "This is;Multi-line;sample menu" ; [color=#4000FF:ddpy01l1][b:ddpy01l1]MENU Touchmenu1(ometro)[/b:ddpy01l1][/color:ddpy01l1] ----------- [color=#FF0000:ddpy01l1][b:ddpy01l1]all values of oMenu are used on oMetro as well !!! [/b:ddpy01l1][/color:ddpy01l1] ----------- STATIC function touchmenu1(ometro) LOCAL OBTN IF oMenu == nil DEFINE METROPANEL oMenu OF oWnd TITLE "Menus....." COLOR CLR_WHITE, CLR_GREEN [color=#0000FF:ddpy01l1][b:ddpy01l1]oMenu:lDesignMode := .T. oMenu:nMetroTop = 250 oMenu:nMetroMargin = 300 oMenu:nBtnSize = 50 oMenu:nSliderTop = 270[/b:ddpy01l1][/color:ddpy01l1] ... ... is it possible, to define different sizes for oMetro and oMenu ? best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem using METRO Menu ?
It is not possible because these are CLASSDATA of TMetroPanel class.
A problem using METRO Menu ?
Mr. Rao, thank You very much for Your help. The logic is working fine now and gives me the basics, to add the dialogs I noticed a problem on EXIT [color=#FF0000:mtdpna8j][b:mtdpna8j]ACTION oMetro:End()[/b:mtdpna8j][/color:mtdpna8j] The buttons are not working anymore the second time. Better using : [color=#0000FF:mtdpna8j][b:mtdpna8j]ACTION WINEXEC( "RESTART MYEXEFILE.exe " + Str( oWnd:hWnd ), 0 ) [/b:mtdpna8j][/color:mtdpna8j] RELAUNCHING the program with Daniel's C-function !!! <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=20477&p=109206&hilit=restart#p108559">viewtopic.php?f=3&t=20477&p=109206&hilit=restart#p108559</a><!-- l --> best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A problem with < oCtrl:cVarName > from TRadio and TDatepick
Hello, I noticed a problem using < [color=#0000FF:2jtq88ht]oCtrl:cVarName [/color:2jtq88ht]> that returns the object-name. [color=#0000FF:2jtq88ht][b:2jtq88ht]The function shows all infos of a object on focus[/b:2jtq88ht][/color:2jtq88ht] [img:2jtq88ht]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Focus2&#46;jpg[/img:2jtq88ht] because of the error ( NIL ) I replaced the info with ??? On TRADIO and TDATEPICK [color=#0000FF:2jtq88ht]::cVarName [/color:2jtq88ht]exists but returns NIL All other controls are working. from : METHOD cGenPRG( lDlgUnits ) CLASS [color=#0000FF:2jtq88ht]TDatePick[/color:2jtq88ht] ... ... cPrg += CRLF + " @ " + cTop + ", " + cLeft + ; " DTPICKER " + ::cVarName + ' VAR ' + "d" + SubStr( [color=#0000FF:2jtq88ht]::cVarName[/color:2jtq88ht], 2 ) + ' ' + ; " ;" + CRLF + ' SIZE ' + cWidth + ", " + cHeight + ; " PIXEL OF " + ::oWnd:cVarName + CRLF and from : METHOD cGenPRG( lDlgUnits ) CLASS [color=#0000FF:2jtq88ht]TRadio[/color:2jtq88ht] ... ... cPrg += CRLF + " @ " + cTop + ", " + cLeft + ; " RADIOITEM " + [color=#0000FF:2jtq88ht]::cVarName [/color:2jtq88ht]+ ' PROMPT "' + ::cCaption + '"' + ; " ;" + CRLF + ' SIZE ' + cWidth + ", " + cHeight + ; " PIXEL OF " + ::oWnd:cVarName + " ;" + CRLF + ; ' RADIOMENU ' + ::oRadMenu:cVarName + CRLF [code=fw:2jtq88ht]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />SetKey<span style="color: #000000;">&#40;</span> VK_F2, <span style="color: #000000;">&#123;</span> || OBJ_INFO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//--------- on FOCUS -------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> OBJ_INFO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oCtrl := oWndFromHwnd<span style="color: #000000;">&#40;</span> GetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br /><br />aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := oCtrl:<span style="color: #000000;">cVarName</span><br /><span style="color: #00C800;">IF</span> aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = <span style="color: #00C800;">NIL</span><br />    aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"???"</span><br /><span style="color: #00C800;">ENDIF</span><br />aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>oCtrl:<span style="color: #000000;">nTop</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <br />aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span> oCtrl:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <br />aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span> oCtrl:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>oCtrl:<span style="color: #000000;">nHeight</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</span> oCtrl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"TRADIO"</span> <span style="color: #B900B9;">// to be calculated !</span><br />     <span style="color: #B900B9;">//aCors[1] := oCtrl:oRadMenu:cVarName</span><br />     aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span> oCtrl:<span style="color: #000000;">nTop</span> - ; <br />                      <span style="color: #000000;">&#40;</span> oCtrl:<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>oCtrl:<span style="color: #000000;">nHeight</span> * ;<br />                      LEN<span style="color: #000000;">&#40;</span> oCtrl:<span style="color: #000000;">oRadMenu</span>:<span style="color: #000000;">aItems</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Dialog title : "</span> + oCtrl:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + CRLF + ;<br /><span style="color: #ff0000;">"Dialog obj. : "</span> + oCtrl:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">cVarName</span> + CRLF + ;<br /><span style="color: #ff0000;">"Focused object : "</span> + oCtrl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + CRLF + ;<br /><span style="color: #ff0000;">"Called from: "</span>+ ProcName<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + CRLF + ;<br /><span style="color: #ff0000;">"ProcLine : "</span> + ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span> ProcLine<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + CRLF + CRLF + ;<br /><span style="color: #ff0000;">"Obj. name : "</span> + aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> + CRLF + ; <br /><span style="color: #ff0000;">"Top :     "</span> + aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> + CRLF + ; <br /><span style="color: #ff0000;">"Left :     "</span> + aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> + CRLF + ; <br /><span style="color: #ff0000;">"Width : "</span>  + aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> + CRLF + ;<br /><span style="color: #ff0000;">"Hight :  "</span> + aCors<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /> </div>[/code:2jtq88ht] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with < BringWindowToTop >
Hello, To define a area, I want to keep the SAY visible on top in DESIGN-mode but < BringWindowToTop > doesn't help. Moving the SAY, it is shown behind all other objects. [img:xlf9rk83]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Cropped8&#46;jpg[/img:xlf9rk83] I can crop anything from the dialog with resize and image-format-export [img:xlf9rk83]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Cropped9&#46;jpg[/img:xlf9rk83] a right mouseclick inside the dialog creates a transparent SAY in DESIGN-mode A short test without image ( NO extras needed ) Right mouseclick. Next move the say to the browser-area. [code=fw:xlf9rk83]<div class="fw" id="{CB}" style="font-family: monospace;"><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;">STATIC</span> oDlg, nClicked := <span style="color: #000000;">0</span>, oCSay <br /><span style="color: #00C800;">STATIC</span> oFont1, oFont2 <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: #00C800;">LOCAL</span> oBrw, aArray := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, oGet, cGet := <span style="color: #ff0000;">"    "</span>, oSay1<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1  <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;">-16</span> BOLD<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2  <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;">-12</span> BOLD<br /><br /><span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />    aArray := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span>,<span style="color: #ff0000;">"four"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span>,<span style="color: #ff0000;">"four"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span>,<span style="color: #ff0000;">"four"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span>,<span style="color: #ff0000;">"four"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Crop-Sample"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>, <span style="color: #000000;">600</span> TRUEPIXEL<br /><br />@ <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">320</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />COLUMNS <span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#125;</span> ;<br />HEADERS <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Btn Trans - 1"</span>,<span style="color: #ff0000;">"Btn Trans - 2"</span>,<span style="color: #ff0000;">"Header - 3"</span>,<span style="color: #ff0000;">"Header - 4"</span><span style="color: #000000;">&#125;</span> ;<br />ARRAY aArray LINES CELL  <span style="color: #0000ff;">PIXEL</span> <br />oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /><br />oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span>CLR_BLACK, CLR_CYAN <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><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;">300</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont2 <span style="color: #0000ff;">PIXEL</span><br />@ <span style="color: #000000;">300</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGET <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W/G"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> <span style="color: #0000ff;">PIXEL</span><br /><br />oDlg:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">&#123;</span>| nRow, nCol | nClicked++, IIF<span style="color: #000000;">&#40;</span> nClicked = <span style="color: #000000;">1</span>, ;<br />                          MAKE_AREA<span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span>, MSG_AREA<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 /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <br /><br />oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oFont2:<span style="color: #000000;">End</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><br /><br /><span style="color: #B900B9;">//---------------------------- </span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAKE_AREA<span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #B900B9;">//New( nRow, nCol, bText, oWnd, cPicture, oFont,;</span><br /><span style="color: #B900B9;">//               lCentered, lRight, lBorder, lPixels, nClrText, nClrBack,;</span><br /><span style="color: #B900B9;">//               nWidth, nHeight, lDesign, lUpdate, lShaded, lBox, lRaised,;</span><br /><span style="color: #B900B9;">//               lAdjust, cVarName, lUnicode, lVCenter ) CONSTRUCTOR</span><br /><br />oCSay := TSAY<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nRow, nCol, <span style="color: #00C800;">NIL</span>, oDlg, <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">NIL</span>,;<br />               <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">NIL</span>, .T., .T., <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">NIL</span>,;<br />               <span style="color: #000000;">150</span>, <span style="color: #000000;">150</span>, .T., .T., .T. <span style="color: #000000;">&#41;</span> <br /><br />oCSay:<span style="color: #000000;">lTransparent</span> := .T.<br />oCSay:<span style="color: #000000;">bGet</span> := <span style="color: #00C800;">nil</span><br />oCSay:<span style="color: #000000;">lWantClick</span> := .T.<br />BringWindowToTop<span style="color: #000000;">&#40;</span> oCSay:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> <br />oCSay:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</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 /><span style="color: #B900B9;">//------------------------------ </span><br /><br /><span style="color: #00C800;">FUNCTION</span> MSG_AREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />aRect := GETCLIENTRECT<span style="color: #000000;">&#40;</span> oCSay:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />nTop :=  oCSay:<span style="color: #000000;">nTop</span><br />nLeft := oCSay:<span style="color: #000000;">nLeft</span><br />nBottom := aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />nRight := aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br />oCSay:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Top : "</span> + STR<span style="color: #000000;">&#40;</span>nTop<span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"Left : "</span> + STR<span style="color: #000000;">&#40;</span>nLeft<span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"Height : "</span> + ;<br />           STR<span style="color: #000000;">&#40;</span>nBottom<span style="color: #000000;">&#41;</span> + CRLF + <span style="color: #ff0000;">"Width : "</span> + STR<span style="color: #000000;">&#40;</span>nRight<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"Selected area"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:xlf9rk83] any idea ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with < BringWindowToTop >
Uwe, Your code is quite similar to FWH\samples\design.prg and design.prg does it right... I have been testing your example and can't understand why BringWindowToTop() is not working there
A problem with < BringWindowToTop >
Antonio, I only added some controls ( browser, say and get )to the original sample [color=#0040FF:2tat17hx]FWH\samples\design.prg[/color:2tat17hx] The only control that stays on top in DESIGN-mode is the listbox ( but only getting the focus ). Loosing the focus, it is covered as well. [img:2tat17hx]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Design1&#46;jpg[/img:2tat17hx] [img:2tat17hx]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Design2&#46;jpg[/img:2tat17hx] [code=fw:2tat17hx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Dialogs designer</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;">"xBrowse.ch"</span><br /><br /><span style="color: #00C800;">static</span> oDlg, lDesign := .T.<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: #00C800;">local</span> oBrw, aArray := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, oGet, cGET := <span style="color: #ff0000;">"Test"</span><br /><br /><span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />    aArray := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span><span style="color: #000000;">&#125;</span>,;<br />        <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"three"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dialog designer"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">300</span> ;<br />      <span style="color: #0000ff;">STYLE</span> nOr<span style="color: #000000;">&#40;</span> WS_THICKFRAME, WS_SYSMENU <span style="color: #000000;">&#41;</span><br /><br />   oDlg:<span style="color: #000000;">cVarName</span> = <span style="color: #ff0000;">"oDlg"</span><br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">180</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span>  <span style="color: #0000ff;">PIXEL</span><br />@ <span style="color: #000000;">50</span>, <span style="color: #000000;">180</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGET <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W/G"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> <span style="color: #0000ff;">PIXEL</span><br /><br />@ <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;">130</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />COLUMNS <span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span><span style="color: #000000;">&#125;</span> ;<br />HEADERS <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Btn Trans - 1"</span>,<span style="color: #ff0000;">"Btn Trans - 2"</span>,<span style="color: #ff0000;">"Header - 3"</span><span style="color: #000000;">&#125;</span> ;<br />ARRAY aArray LINES CELL <span style="color: #0000ff;">PIXEL</span>  <br />oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /><br />oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span>CLR_BLACK, CLR_CYAN <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><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: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span>  <span style="color: #000000;">&#40;</span> <span style="color: #B900B9;">/* oDlg:nOpacity := 150,*/</span>  PlaceControl<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign, DrawGrid<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span>, hDC, cPS, <span style="color: #000000;">8</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">CLICK</span> EditDialog<span style="color: #000000;">&#40;</span> nRow, nCol, oDlg <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2tat17hx] regards Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
A problem with GDIP_IMAGEFROMFILE() [Solved]
Dear friends, I have a problem with the funcion GDIP_IMAGEFROMFILE(): normally it works fine but in one of my source code it just quit the program without messages or log files. I'm using it in this way: [code=fw:qcvcw7gp]<div class="fw" id="{CB}" style="font-family: monospace;">hImg = GDIP_IMAGEFROMFILE<span style="color: #000000;">&#40;</span> cFile, .T., .T. <span style="color: #000000;">&#41;</span></div>[/code:qcvcw7gp] If I replace it with [code=fw:qcvcw7gp]<div class="fw" id="{CB}" style="font-family: monospace;">hImg = PALBMPREAD<span style="color: #000000;">&#40;</span> , cFile <span style="color: #000000;">&#41;</span></div>[/code:qcvcw7gp] it works fine (only with BMP, of course). Any ideas? EMG
A problem with GDIP_IMAGEFROMFILE() [Solved]
We recommend using FW_ReadImage( nil, cAnyImageSource, [aSize], [lGDIP] ) --> aImage Elements of aImage: { hBitmap, hPalette, nBmpWidth, nBmpHeight, lAlpha, cName, lResource, cType, nZeroClr } Destroy with PalBmpFree( aImage )
A problem with GDIP_IMAGEFROMFILE() [Solved]
Solved adding [code=fw:te2hk686]<div class="fw" id="{CB}" style="font-family: monospace;">REQUEST GDIBMP</div>[/code:te2hk686] EMG
A problem with GETCURSORPOS() and widescreen-monitor ?
I tested one of my old colorpicker-solutions. It seems with my widescreen-monitor it doesn't work anymore ? The cursor returns a wrong screenarea ( must return the color on mouseposition ). I remember with my old monitor 4:3 it was ok. [img:3jr6g5rx]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Getcurs1&#46;jpg[/img:3jr6g5rx] DEFINED [color=#0000FF:3jr6g5rx]local hDeskTop := GETDC(0) local a := GETCURSORPOS() local nColor := GETPIXEL( hDeskTop, a[2], a[1] ) ... ...[/color:3jr6g5rx] any changes needed because of the monitor-resolution ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with GETCURSORPOS() and widescreen-monitor ?
Look if this sample can be of any help: [code=fw:2yv2zo6k]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> DRAGDLG<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <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> DRAGDLG<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> aCoo := GETWNDRECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> aOrg := GETCURSORPOS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> aPos<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">WHILE</span> GETKEYSTATE<span style="color: #000000;">&#40;</span> VK_LBUTTON <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aPos = GETCURSORPOS<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; MOVEWINDOW<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span>, aCoo<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + aPos<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> - aOrg<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aCoo<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + aPos<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> - aOrg<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, , , .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2yv2zo6k] EMG
A problem with GETCURSORPOS() and widescreen-monitor ?
Enrico, it is a test with a existing tool that worked before. The problem is not the dialog it is the area of the mousecaption. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=31155&p=180185&hilit=colorpicker#p180185">viewtopic.php?f=3&t=31155&p=180185&hilit=colorpicker#p180185</a><!-- l --> Download : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/TestPick2.zip">http://www.pflegeplus.com/DOWNLOADS/TestPick2.zip</a><!-- m --> regards Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
A problem with GETCURSORPOS() and widescreen-monitor ?
I tested some samples like zoomer2.prg with the same wrong results The cursor must return the cursor area but returns something else. Maybe < [color=#FF0000:1izfwtw3]GetCursorPos() [/color:1izfwtw3]> does not work ? [img:1izfwtw3]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Zoomer1&#46;jpg[/img:1izfwtw3] [b:1izfwtw3]From sample < zoomer2.prg >[/b:1izfwtw3] [color=#0000FF:1izfwtw3]FUNCTION getcolor(ownd,nzoom) local hDeskTop := GetDC(0) local a := GetCursorPos() local nColor := GetPixel( hDeskTop, a[2], a[1] ) local hDC := oWnd:GetDC() local nTop := 0 local nLeft := 0 local nWidth := 200 local nHeight := 200 StretchBlt( hDC, nLeft, nTop, nWidth, nHeight, hDeskTop, a[2]-(nWidth/(nZoom*2)), a[1]-(nHeight/(2*nZoom)), nWidth/nZoom, nHeight/nZoom, 13369376 ) oWnd:ReleaseDC() ReleaseDC( 0, hDeskTop ) RETURN nil [/color:1izfwtw3] [b:1izfwtw3]result of sample < Zoomer.prg >[/b:1izfwtw3] like You can see, the cursorposition is different [img:1izfwtw3]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Zoomer2&#46;jpg[/img:1izfwtw3] any idea ? regards Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
A problem with GETCURSORPOS() and widescreen-monitor ?
Can we see a reduced, yet complete, sample of the problem, please? EMG
A problem with GETCURSORPOS() and widescreen-monitor ?
Enrico, I used the [color=#0000FF:3sn9cdeg][b:3sn9cdeg]original FWH-samples [/b:3sn9cdeg][/color:3sn9cdeg] < zoomer.prg and zoomer2.prg > to show the results. regards Uwe <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
A problem with GETCURSORPOS() and widescreen-monitor ?
I just tried zoomer.prg and found it perfectly working. EMG
A problem with GETCURSORPOS() and widescreen-monitor ?
Enrico, maybe the problem is the selected screenresolution ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with GETCURSORPOS() and widescreen-monitor ?
Uwe What resolution use? What monitor ?
A problem with GETCURSORPOS() and widescreen-monitor ?
Cristobal, I found the reason : with the monitor it is possible to define a [color=#0000FF:3co3rsue]RESIZE-factor[/color:3co3rsue]. Normally 100 % is used ( tested and that works !!! ) Because to get a bigger display I used [color=#FF0000:3co3rsue][b:3co3rsue]125 %[/b:3co3rsue][/color:3co3rsue] THAT IS NOT SUPPORTED ! [color=#0000FF:3co3rsue][b:3co3rsue]Monitor settings[/b:3co3rsue][/color:3co3rsue] [img:3co3rsue]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Screen1&#46;jpg[/img:3co3rsue] regards Uwe
A problem with GETCURSORPOS() and widescreen-monitor ?
Yes, I assumed it was that It happened to me when I developed the menus
A problem with GETCURSORPOS() and widescreen-monitor ?
[quote="ukoenig":3rrln1om]Cristobal, do You think there is any solution to respect this setting and adjust the returnvalues of < GetCursorPos() > ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:3rrln1om] It's possible with DPI SCaling, but developing a function may be complicated to adjust DPI Scaling Level Value data Smaller 100% (default) 96 Medium 125% 120 Larger 150% 144 Extra Large 200% 192 Custom 250% 240 Custom 300% 288 Custom 400% 384 Custom 500% 480 This value think is into register windows
A problem with GETCURSORPOS() and widescreen-monitor ?
Cristobal, do You think there is any solution to respect this setting and adjust the returnvalues of < GetCursorPos() > ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with GETCURSORPOS() and widescreen-monitor ?
I found this HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics But this is better [code=fw:orhv3u3e]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSX &nbsp; &nbsp;<span style="color: #000000;">88</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSY &nbsp; &nbsp;<span style="color: #000000;">90</span><br /><br /><span style="color: #00C800;">Function</span> GetLogPixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDCM &nbsp; &nbsp; := oMWnd:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSX <span style="color: #000000;">&#41;</span>, GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMWnd:<span style="color: #000000;">ReleaseDC</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><br /><br /><br />&nbsp;</div>[/code:orhv3u3e]
A problem with GETCURSORPOS() and widescreen-monitor ?
And for know zoom active [code=fw:1p3ivoou]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSX    <span style="color: #000000;">88</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSY    <span style="color: #000000;">90</span><br /><span style="color: #00D7D7;">#define</span> ASPECTX                     <span style="color: #000000;">40</span><br /><span style="color: #00D7D7;">#define</span> ASPECTY                     <span style="color: #000000;">42</span><br /><span style="color: #00D7D7;">#define</span> ASPECTXY                    <span style="color: #000000;">44</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> GetLogPixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> hDCM     := oMWnd:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ? GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSX <span style="color: #000000;">&#41;</span>, GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSY <span style="color: #000000;">&#41;</span>, ;<br />     GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, ASPECTX <span style="color: #000000;">&#41;</span>, GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, ASPECTY <span style="color: #000000;">&#41;</span><br />   ? GetScaleFactorForDevice<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   oMWnd:<span style="color: #000000;">ReleaseDC</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><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />DLL32 <span style="color: #00C800;">FUNCTION</span> GetScaleFactorForDevice<span style="color: #000000;">&#40;</span> deviceType AS DWORD <span style="color: #000000;">&#41;</span> AS LONG PASCAL LIB <span style="color: #ff0000;">"Shcore.dll"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />&nbsp;</div>[/code:1p3ivoou] And I do not know if this function performs the coordinate conversion correctly [code=fw:1p3ivoou]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> AdjustPos<span style="color: #000000;">&#40;</span> aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nZoom &nbsp;:= GetScaleFactorForDevice<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nPorc &nbsp;:= nZoom / <span style="color: #000000;">96</span><br />&nbsp; &nbsp;aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> / nPorc, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> / nPorc, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> aPoint<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />&nbsp;</div>[/code:1p3ivoou]
A problem with GETCURSORPOS() and widescreen-monitor ?
And generic function for calculate, please test it and tell me [code=fw:vql5vct1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #B900B9;">// Calculate nZoom and/or DPIs</span><br /><span style="color: #00C800;">Function</span> CalcZoom<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// { nZoom, DPIs }</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> aZooms := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">096</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">115</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">120</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">140</span>, <span style="color: #000000;">134</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">144</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">160</span>, <span style="color: #000000;">154</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">173</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">225</span>, <span style="color: #000000;">216</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">288</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">384</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">480</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> nZoom<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nDPIs &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nPos &nbsp; &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDCM &nbsp; &nbsp; := oWnd:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nLogX &nbsp; &nbsp;:= GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSX <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nLogY &nbsp; &nbsp;:= GetDeviceCaps<span style="color: #000000;">&#40;</span> hDCM, LOGPIXELSY <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nPos &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := AsCan<span style="color: #000000;">&#40;</span> aZooms, <span style="color: #000000;">&#123;</span> | a | a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == nLogX <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Not found in array predefined modes</span><br />&nbsp; &nbsp; &nbsp; nDPIs &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">96</span> &nbsp;+ <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> nLogX * <span style="color: #000000;">24</span> / <span style="color: #000000;">25</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nZoom &nbsp; &nbsp; &nbsp; := <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> nDPIs * <span style="color: #000000;">100</span> / <span style="color: #000000;">96</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Found in array predefined modes</span><br />&nbsp; &nbsp; &nbsp; nDPis &nbsp; &nbsp; &nbsp; := nLogX<br />&nbsp; &nbsp; &nbsp; nZoom &nbsp; &nbsp; &nbsp; := aZooms<span style="color: #000000;">&#91;</span> nPos <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span> nZoom, nDPIs <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />&nbsp;</div>[/code:vql5vct1]
A problem with GETCURSORPOS() and widescreen-monitor ?
Cristobal, all tests are using [color=#0000FF:dhorgvil]FUNCTION GETCOLOR() local hDeskTop := GETDC(0) local a := GETCURSORPOS() local nColor := GETPIXEL( hDeskTop, a[2], a[1] ) local hDC := oDlg:GETDC() local hPen := CREATEPEN( PS_SOLID, 1.5, CLR_HRED ) local hOldPen local nTop, nLeft local nWidth, nHeight[/color:dhorgvil] Isn't it possible to modify the function [color=#0000FF:dhorgvil]GETCURSORPOS()[/color:dhorgvil] to show the correct cursorposition-area ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with GETCURSORPOS() and widescreen-monitor ?
Yes, that should be the next step, but I need if you can prove it right Ok?
A problem with GETCURSORPOS() and widescreen-monitor ?
Cristobal I adjusted the top / left values of < GETCURSORPOS() > with a factor [color=#FF0000:3excx0mm]1.25[/color:3excx0mm] -> 1920 x 1080 of 125 % zoom linear with a factor [color=#FF0000:3excx0mm]1.5[/color:3excx0mm] -> 1920 x 1080 of 150 % zoom I tested all monitor areas with perfect results. maybe we doen't need any complicted calculations and can work with a fixed factor ? other resolution with a factor [color=#FF0000:3excx0mm]1.25[/color:3excx0mm] -> 1600 x 900 of 125 % zoom works as well. it means only 2 possible adjustments are needed : factor 1,25 for 125 % zoom and 1.5 if 150 % zoom is used. I tested : nZoom := GetScaleFactorForDevice( 0 ) MsgAlert( nZoom, "Zoom-factor" ) > returns 100 % ( 125 % is needed ) Is there maybe another function or calculation ? Your function -> CalcZoom() also doesn't return 125 % [img:3excx0mm]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Colorpick14&#46;jpg[/img:3excx0mm] FUNCTION GETCOLOR() local hDeskTop := GETDC(0) local a := GETCURSORPOS() // Left Top local nColor := GETPIXEL( hDeskTop, a[2] * [color=#FF0000:3excx0mm]1.25[/color:3excx0mm], a[1] * [color=#FF0000:3excx0mm]1.25[/color:3excx0mm] ) local hDC := oDlgChild:GETDC() local hPen := CREATEPEN( PS_SOLID, 1.5, CLR_HRED ) local hOldPen local nTop, nLeft local nWidth, nHeight nTop := 5 nLeft := 5 nWidth := 90 nHeight := 90 MOVETO( hDC, nLeft-1, nTop-1) LINETO( hDC, nLeft + nWidth+1, nTop-1 ) LINETO( hDC, nLeft + nWidth+1, nTop+nHeight+1 ) LINETO( hDC, nLeft -1, nTop+nHeight+1 ) LINETO( hDC, nLeft-1, nTop-1) STRETCHBLT( hDC, nLeft, nTop, nWidth, nHeight, hDeskTop, ; a[2] * [color=#FF0000:3excx0mm]1.25 [/color:3excx0mm]-(nWidth/(nZoom*2)), a[1] * [color=#FF0000:3excx0mm]1.25 [/color:3excx0mm]-(nHeight/(2*nZoom)), ; nWidth/nZoom, nHeight/nZoom, 13369376 ) ... ... regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
A problem with GETCURSORPOS() and widescreen-monitor ?
Uwe, run OK with all factor zoom and all resolutions ? ( 125% is 1.25 )
A problem with GETCURSORPOS() and widescreen-monitor ?
Cristobal other resolution with a factor 1.25 -> 1600 x 900 with 125 % zoom I tested and works as well !! I think there is not much to do, we only have to define the selected zoom-factor. of the possible selection of [color=#0040FF:6xkf32nf]100, 125, 150 or 175 [/color:6xkf32nf]( zoom ) regards Uwe
A problem with GETCURSORPOS() and widescreen-monitor ?
[quote="ukoenig":3hhmlvgy]Cristobal other resolution with a factor 1.25 -> 1600 x 900 with 125 % zoom I tested and works as well !! it is only the possible selection of [color=#0040FF:3hhmlvgy]100, 125, 150 or 175 [/color:3hhmlvgy]( zoom ) regards Uwe[/quote:3hhmlvgy] And with zoom different to 125 run OK also?
A problem with GETCURSORPOS() and widescreen-monitor ?
Christobal, windows offers only these 4 values from a list I found only 125 % is making sense to get bigger symbols visible on the desktop [img:1qk887h1]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Zoom10&#46;jpg[/img:1qk887h1] regards Uwe
A problem with GETCURSORPOS() and widescreen-monitor ?
Yes, I know this, but You are used 1.25 number for adjust You are tested with zoom selected 175 ?
A problem with GETCURSORPOS() and widescreen-monitor ?
Christobal, 175 % tested and works as well ( but to big ) [img:32xfivaz]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Zoom11&#46;jpg[/img:32xfivaz] There is also a function for monitor [color=#0000FF:32xfivaz]STDAPI GetScaleFactorForMonitor( _In_ HMONITOR hMon, _Out_ DEVICE_SCALE_FACTOR *pScale );[/color:32xfivaz] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
A problem with GradientBrush()
In the sample gradbrus.prg, please try to click on "First" button, then on "Another" button and then close and reopen the second dialog many times. Now move the second dialog over the first. You will see that the first dialog is now painted with robbish. Any hint on how to fix this behavior? EMG
A problem with GradientBrush()
A reduced sample of the problem. Just click on the button and move the second dialog over the first. You will see the problem: [code=fw:3gxslcoc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> TEST<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;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3gxslcoc] EMG
A problem with GradientBrush()
Dear EMG, I tested your sample code but I did not experience the problem which you have explained. For me it is working fine. I am using Vista Business, FWH 9.08. Regards Anser
A problem with GradientBrush()
So the problem is at least under XP. EMG
A problem with GradientBrush()
[quote:2mw42t9n]So the problem is at least under XP.[/quote:2mw42t9n] or with the recent versions of FWH ( after 9.08 ) Anser
A problem with GradientBrush()
Yes. I'm using 9.12. EMG
A problem with GradientBrush()
This is a workaround: [code=fw:3fdspgcd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> WM_PAINT <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3fdspgcd] Any better ideas? EMG
A problem with GradientBrush()
Even worst. In the following sample, try to move the second dialog and you will see that the first dialog is painted: [code=fw:6er1mxv1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> TEST<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;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> WM_PAINT <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:6er1mxv1] EMG
A problem with GradientBrush()
It looks like the gradient technique is currently not usable. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
A problem with GradientBrush()
Enrico, like Anser, I use Vista as well. I call the Gradient-painting ON INIT using Function GRADIENTBRUSH Pushing the < Test-button >, opens Dialog 2 [img:2yb4cb8f]http&#58;//www&#46;pflegeplus&#46;com/pictures/move5&#46;jpg[/img:2yb4cb8f] Using a 2. Dialog, moving over Dialog 1 [img:2yb4cb8f]http&#58;//www&#46;pflegeplus&#46;com/pictures/move6&#46;jpg[/img:2yb4cb8f] It is not a XP-problem. Maybe a change in Function < GRADIENTBRUSH > needed ? [code=fw:2yb4cb8f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><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 /><span style="color: #00C800;">LOCAL</span> oDlg1<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1<br /><br />@ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">CENTER</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> GRADBRUSH<span style="color: #000000;">&#40;</span> oDlg1, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">14198567</span>, <span style="color: #000000;">16117445</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, .T. <span style="color: #000000;">&#41;</span>, ;<br />                 oDlg1:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">110</span>, <span style="color: #000000;">460</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">215</span>, .f. <span style="color: #000000;">&#41;</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;">// -----------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg2<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">CENTER</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> GRADBRUSH<span style="color: #000000;">&#40;</span> oDlg2, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">16117445</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, .T. <span style="color: #000000;">&#41;</span>, ;<br />                 oDlg2:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">500</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">215</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />*<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg2:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> WM_PAINT <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;">FUNCTION</span> GradBrush<span style="color: #000000;">&#40;</span> oDlg, aColors, lPos <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hDC, hBmp, hBmpOld, oBrush<br /><br /><span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />      hDC = CreateCompatibleDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      hBmp = CreateCompatibleBitMap<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />      hBmpOld = SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />      GradientFill<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors, lPos <span style="color: #000000;">&#41;</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />      oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />      oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CreatePatternBrush<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> <br />      SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />      oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span>   <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2yb4cb8f] A working Solution using [color=#FF0000:2yb4cb8f]ON PAINT [/color:2yb4cb8f]only with [color=#FF0000:2yb4cb8f]GradientFill[/color:2yb4cb8f] : ( GRADIENTBRUSH was created, to solve the Transparent-Problem ) [img:2yb4cb8f]http&#58;//www&#46;pflegeplus&#46;com/pictures/move7&#46;jpg[/img:2yb4cb8f] [code=fw:2yb4cb8f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00C800;">Static</span> hDC<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: #00C800;">LOCAL</span> oDlg1<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1<br /><br />@ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span>  DLG_GRAD<span style="color: #000000;">&#40;</span> hDC, oDlg1, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">14198567</span>, <span style="color: #000000;">16117445</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, .T. <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg1:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">110</span>, <span style="color: #000000;">460</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">215</span>, .f. <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;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg2<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">CENTER</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DLG_GRAD<span style="color: #000000;">&#40;</span> hDC, oDlg2, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">16117445</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, .T. <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg2:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">500</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">215</span>, .f. <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;">// --------------  GRADIENT --------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> DLG_GRAD<span style="color: #000000;">&#40;</span> hDC, oDlg, aGrad, lPos <span style="color: #000000;">&#41;</span><br /><br />GradientFill<span style="color: #000000;">&#40;</span> hDC,  <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aGrad, lPos <span style="color: #000000;">&#41;</span><br /><br />RELEASEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2yb4cb8f] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem with GradientBrush()
This seems to work fine but the checkbox is not transparent. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> Why? [code=fw:2cpm3fg2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> lVar := .F.<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRANSPARENT<br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">CHECKBOX</span> lVar<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">oBrush</span> := GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TRANSPARENT<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">oBrush</span> := GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld, oBrush<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oBrush = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> , , , , hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> oBrush</div>[/code:2cpm3fg2] EMG
A problem with GradientBrush()
Enrico, the transparent-painting for the checkbox works, but uses a wrong gradient ( from top ) with same colors ( no gradient ) : GRADIENTBRUSH( oDlg1, { { 1, RGB( 103, 154, 194 ), RGB( 103, 154, 194 ) } } ) [img:2oe7zcgg]http&#58;//www&#46;pflegeplus&#46;com/pictures/tr1&#46;jpg[/img:2oe7zcgg] Moving the checkbox to Dialog-Top-position : GRADIENTBRUSH( oDlg1, { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } } ) [img:2oe7zcgg]http&#58;//www&#46;pflegeplus&#46;com/pictures/tr2&#46;jpg[/img:2oe7zcgg] to solve this problem, I used only the checkbox-square and a extra text. [img:2oe7zcgg]http&#58;//www&#46;pflegeplus&#46;com/pictures/tr3&#46;jpg[/img:2oe7zcgg] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem with GradientBrush()
[quote="ukoenig":2vierfdi]to solve this problem, I used only the checkbox-square and a extra text.[/quote:2vierfdi] It doesn't solve the problem because also the radio buttons are not transparent. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
A problem with GradientBrush()
This is one more sample that unfortunately still shows the first problem I reported: [code=fw:191t3wxc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><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<br /><br />    <span style="color: #00C800;">LOCAL</span> lVar := .F.<br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />           TRANSPARENT<br /><br />    @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    @ <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">CHECKBOX</span> lVar<br /><br />    oDlg:<span style="color: #000000;">oBrush</span> = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</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;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />           TRANSPARENT<br /><br />    oDlg:<span style="color: #000000;">oBrush</span> = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</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;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br /><br />    hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />    hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br /><br />    hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br /><br />    GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br /><br />    DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br /><br />    oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />    oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span>  = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br /><br />    SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br /><br />    DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br />    oDlg:<span style="color: #000000;">ReleaseDC</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:191t3wxc] EMG
A problem with GradientBrush()
Solution for the first sample posted. ( I have set another gradient brush to the second dialog also.) [code=fw:172gzyr1]<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, oBrush  <span style="color: #B900B9;">// added oBrush</span><br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush   <span style="color: #B900B9;">// inserted</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />    @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #B900B9;">// inserted</span><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> oDlg, oBrush<br />  <br />    <span style="color: #B900B9;">// gradient brush for this dialog also</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush  <br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">CENTER</span> ;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, CLR_RED, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br /><br /><br />    <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br /><br />    <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />        hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />        hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />        GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br />        DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />        oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />        oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />        oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">cBmpfile</span> = LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// inserted to trick the aBrushes behavior</span><br />        SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />        DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br />        oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">ENDIF</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:172gzyr1]
A problem with GradientBrush()
You da man!!! Many many thanks! EMG
A problem with GradientBrush()
It would seem that we now need to move these changes into TDialog so one doesn't have to write code for each dialog using a brush. Regards, James
A problem with GradientBrush()
Rao, Many thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Lets see if we can migrate those changes into FWH classes
A problem with GradientBrush()
Enrico, Your examples on Windows 7 work fine Going to test them on XP...
A problem with GradientBrush()
Enrico, Statements like these should not be used: [code=fw:20tyqe6a]<div class="fw" id="{CB}" style="font-family: monospace;">oDlg:<span style="color: #000000;">oBrush</span> = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:20tyqe6a] because the above does not respect the FWH brushes reuse implementation. Instead, method oWnd:SetBrush( oBrush ) should be used.
A problem with GradientBrush()
Can I use [code=fw:3d1625vv]<div class="fw" id="{CB}" style="font-family: monospace;">oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">&#40;</span> TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:3d1625vv] ? EMG
A problem with GradientBrush()
Enrico, I'm still testing as well the Gradients and Brushes. I need a working example to adjust a Brush to Dialog-Size ( a Image is used ). I don't know what's wrong, but anyway, i don't get it working. The results don't look as aspected. // a. Now any image file ( jpg, png, etc. ) can be used to create a Brush. // b. Brush can also be created from a bitmap handle by // specifying the handle as the fifth parameter of TBrush():New() method. must be used like : TBrush():New( nil, nil, nil, nil, [color=#FF0000:3q0das35]hBmp[/color:3q0das35] ) Do You have a working example for this ? Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
A problem with GradientBrush()
Yes, all my samples now work fine with Rao change. EMG
A problem with GradientBrush()
One more problem. How can I get transparent controls (ie. the SAY in the following sample) and [b:3b8eist1]not[/b:3b8eist1] transparent image control at the same time? [code=fw:3b8eist1]<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;">"Image.ch"</span><br /><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<br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />           TRANSPARENT<br /><br />    @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"This is a test"</span><br /><br />    @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">IMAGE</span>;<br />           <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span>;<br />           FILE <span style="color: #ff0000;">"e:<span style="color: #000000;">\f</span>wharbour<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\s</span>elect.bmp"</span>;<br />           NOBORDER <span style="color: #0000ff;">ADJUST</span><br /><br />    oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">&#40;</span> TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</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;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">216</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">238</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">103</span>, <span style="color: #000000;">154</span>, <span style="color: #000000;">194</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> GRADIENTBRUSH<span style="color: #000000;">&#40;</span> oDlg, aColors <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> hDC, hBmp, hBmpOld<br /><br />    hDC = CREATECOMPATIBLEDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />    hBmp = CREATECOMPATIBLEBITMAP<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br /><br />    hBmpOld = SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br /><br />    GRADIENTFILL<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aColors <span style="color: #000000;">&#41;</span><br /><br />    DELETEOBJECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br /><br />    oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />    oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span>  = CREATEPATTERNBRUSH<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br /><br />    SELECTOBJECT<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br /><br />    DELETEDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br />    oDlg:<span style="color: #000000;">ReleaseDC</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:3b8eist1] EMG
A problem with GradientBrush()
Enrico, Yes, you can use: [code=fw:2f746siu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">&#40;</span> TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2f746siu] but never use: [code=fw:2f746siu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDlg:<span style="color: #000000;">oBrush</span> = TBrush<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:2f746siu] because this way the brush "counter" does not get incremented.