topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Changing font from oSay | Try this: oSay:SetFont( oNewFont )
After changing font do: oSay:SetTex( oSay:cCaption ) to check the change. It would be OK. |
Changing font from oSay | Manuramos,
Thank you very much , this i needed to complete to make windows resizing the controls , also with the font.
You may see the result in the thread from silvio (controls ...)
Frank |
Changing itemlist in a combobox | Hello,
I think I asked this question some years ago, but I can't it find it anymore, nore do I remember the solution that was given then.
This is my question:
In a window, I use a combobox. The list that is defined, need to be changed, depending on changing the data in the window.
How can I change a itemlist of an active combobox in my window?
Thank you very much in advance for any help. |
Changing itemlist in a combobox | Changing the Array ?
[url:3jc4se7k]http://fivetechsupport.com/forums/viewtopic.php?p=253129&sid=3f9d268fcc951d1bf053930a22ed9d1e#p253129[/url:3jc4se7k] |
Changing itemlist in a combobox | Driessen:
Algo asi?
[code=fw:iwn36vsh]<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;">function</span> Prue_Combo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oDlg, oCom1, oCom2, cVar1, cVar2<br /> <span style="color: #00C800;">local</span> aList1, aList2<br /><br /> aList1 := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion1"</span>,<span style="color: #ff0000;">"Opcion2"</span><span style="color: #000000;">}</span><br /><br /> aList2 := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion 1 - Item 1"</span>, <span style="color: #ff0000;">"Opcion 1 - Item2"</span>, <span style="color: #ff0000;">"Opcion 1 - Iteme3"</span><span style="color: #000000;">}</span><br /> <br /> cVar1 := aList1<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br /> cVar2 := aList2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Combobox Relacionados"</span><br /><br /> @ <span style="color: #000000;">20</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> oCom1 <span style="color: #0000ff;">VAR</span> cVar1 <span style="color: #0000ff;">ITEMS</span> aList1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">130</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> aList2:=MiFunction<span style="color: #000000;">(</span>oCom1<span style="color: #000000;">)</span>,oCom2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aList2 <span style="color: #000000;">)</span>, oCom2:<span style="color: #000000;">Set</span><span style="color: #000000;">(</span>aList2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">160</span> <span style="color: #0000ff;">COMBOBOX</span> oCom2 <span style="color: #0000ff;">VAR</span> cVar2 <span style="color: #0000ff;">ITEMS</span> aList2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">130</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <br /> @ <span style="color: #000000;">100</span>,<span style="color: #000000;">(</span><span style="color: #000000;">300</span>/<span style="color: #000000;">2</span><span style="color: #000000;">)</span>-<span style="color: #000000;">(</span><span style="color: #000000;">100</span>/<span style="color: #000000;">2</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Ok"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> MiFunction<span style="color: #000000;">(</span>oCom1<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> aResp<br /><span style="color: #00C800;">IF</span> oCom1:<span style="color: #000000;">nAt</span> = <span style="color: #000000;">1</span><br /> aResp := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion 1 - Item 1"</span>, <span style="color: #ff0000;">"Opcion 1 - Item 2"</span>, <span style="color: #ff0000;">"Opcion 1 - Iteme 3"</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">ELSE</span> <br /> aResp := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion 2 - Item 1"</span>, <span style="color: #ff0000;">"Opcion 2 - Item 2"</span>, <span style="color: #ff0000;">"Opcion 2 - Item 3"</span>,<span style="color: #ff0000;">"Opcion 2 - Item 4"</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">Return</span> aResp<br /> </div>[/code:iwn36vsh] |
Changing the Toolbar content | I have for example a toolbar with initial button images on top and on the left I have outlook style butons.
[img:1hat10ss]http://i65.photobucket.com/albums/h235/codemaker_bg/toolbar1.jpg[/img:1hat10ss]
What I need is to [b:1hat10ss]dynamicaly change[/b:1hat10ss] the set of icons on the toolbar when I click some button on any of the vertical left buttons.
The program initialy starts for example with 7 buttons (each has a specific ACTION assigned) in the toolbar and the first button on vertical left is activated.
Now I want to click on the 3rd button on the left and I need to change all the toolbar icons and their coresponding ACTIONs, because the new set of icons will do another set of jobs.
Then later, I need to be able to click on the left on some other button and again, all set of toolbar buttons (and ACTIONS) must change.
Is this possible or I need to do some coding by replacing the each button image in toolbar and assign a new ACTION to it? And also, hide the rest of the buttons etc...
I just started to use Toolbars and I might ask some stupid question, but the documentation for Toolbars is not extensive so I need some help
Thanks |
Changing the Toolbar content | Hello Codemaker,
[b:2qhi053s]A Sample to show the Logic changing BMP's and using the same Button with different Actions:[/b:2qhi053s]
1. define a Array for the used BMP's
2. use => ACTION [color=#FF0000:2qhi053s]oButt3:SetFile( aBtn[4][1], aBtn[4][2] )[/color:2qhi053s] ;
That will replace on Button-action 2 the Button 3 ( TRASH.BMP )
with the defined BMP's in Arrayelement 4 ( PENDRIVE.BMP )
To use different Actions with on Button,
You need another Array => .T. or .F. for each Button.
With the BMP-change change the Status as well.
It means : .T. = Action 1, .F. = Action 2
In this sample, Button 3 shows on Action the Message : Action 1 ( aAct[3] := .T. ).
After the BMP-change the Action shows the Message : Action 2 ( aAct[3] := .F. defined in Button 2-action ).
Maybe You want to show a [color=#FF0000:2qhi053s]BMP disabled [/color:2qhi053s]as well ?
The Array can be : aBtn[5][4] => BTN_UP, BTN_DOWN, [color=#FF0000:2qhi053s]BTN_DISABLE[/color:2qhi053s], BTN_OVERMOUSE
FUNCTION changed in FWH 12.01 !!! ( Drive is included )
c_path := [color=#FF0000:2qhi053s]GETCURDIR() [/color:2qhi053s]+ "\"
maybe You have to use :
c_path := CURDRIVE() + ":\" + GETCURDIR() + "\"
[img:2qhi053s]http://www.pflegeplus.com/pictures/btnchg.jpg[/img:2qhi053s]
[code=fw:2qhi053s]<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;">static</span> oWnd, oBar, oBrush, cFile, oButtFont, oCursorHand<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hDCo, oButt1, oButt2, oButt3, oButt4, oButt5, oButt6<br /><span style="color: #00C800;">LOCAL</span> aBtn<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, aAct<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span><br /><br />c_path := GETCURDIR<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> <br /><br />// can be : aBtn[5][4] => BTN_UP, BTN_DOWN, BTN_DISABLE, BTN_OVERMOUSE <br /><br />aBtn[1][1] := c_path + "</span>\project\ICHAT.BMP<span style="color: #ff0000;">"<br />aBtn[1][2] := c_path + "</span>\project\ICHAT.BMP<span style="color: #ff0000;">"<br />aAct[1] := .T.<br /><br />aBtn[2][1] := c_path + "</span>\project\EXPLORER.BMP<span style="color: #ff0000;">"<br />aBtn[2][2] := c_path + "</span>\project\EXPLORER.BMP<span style="color: #ff0000;">"<br />aAct[2] := .T.<br /><br />aBtn[3][1] := c_path + "</span>\project\TRASH.BMP<span style="color: #ff0000;">"<br />aBtn[3][2] := c_path + "</span>\project\TRASH.BMP<span style="color: #ff0000;">"<br />aAct[3] := .T.<br /><br />aBtn[4][1] := c_path + "</span>\project\PENDRIVE.BMP<span style="color: #ff0000;">"<br />aBtn[4][2] := c_path + "</span>\project\PENDRIVE.BMP<span style="color: #ff0000;">"<br />aAct[4] := .T.<br /><br />aBtn[5][1] := c_path + "</span>\project\PALM.BMP<span style="color: #ff0000;">"<br />aBtn[5][2] := c_path + "</span>\project\PALM.BMP<span style="color: #ff0000;">"<br />aAct[5] := .T.<br /><br />oDlgFont := TFont():New("</span>Arial<span style="color: #ff0000;">", ,-14,.F.,.F.,,,,.F.) <br />oButtFont := TFont():New("</span>Arial<span style="color: #ff0000;">",,-14,.F.,.F.,,,,.F.)<br />DEFINE CURSOR oCursorHand HAND<br />SetBalloon( .T. )<br /><br />// Style<br />// -------<br />DEFINE BRUSH oBrush STYLE "</span>BRICKS<span style="color: #ff0000;">" <br /><br />DEFINE WINDOW oWnd TITLE "</span>Testing Source <span style="color: #0000ff;">of</span> Bar-Tools<span style="color: #ff0000;">" ;<br />MENU TMenu():New() BRUSH oBrush<br /><br />DEFINE BUTTONBAR oBar OF oWnd SIZE 100,80 3DLOOK 2007 LEFT<br /><br />oBar:oFont := oButtFont<br />oBar:SetColor( 0)<br /><br />oBar:bClrGrad = { | lInvert | If( ! lInvert, ;<br /> { { 0.80,14853684,16314573 }, ;<br /> { 0.80,16314573,14853684 } }, ;<br /> { { 0.80,14853684,14853684 }, ;<br /> { 0.80,14853684,14853684 } } ) }<br /><br />DEFINE BUTTON oButt1 OF oBar FILE aBtn[1][1], aBtn[1][2] ;<br />MESSAGE "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">" ; <br />ACTION MsgAlert( "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">","</span>Attention<span style="color: #ff0000;">" ) ;<br />PROMPT "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">" <br /><br />oButt1:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">", "</span><span style="color: #000000;">1</span>. <span style="color: #0000ff;">Button</span><span style="color: #ff0000;">", 1, 0, 128 }<br /><br />DEFINE BUTTON oButt2 OF oBar FILE aBtn[2][1], aBtn[2][2] ;<br />MESSAGE "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">2</span><span style="color: #ff0000;">" ; <br />ACTION ( oButt3:SetFile( aBtn[4][1], aBtn[4][2] ), aAct[3] := .F. ) ;<br />PROMPT "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">2</span><span style="color: #ff0000;">" <br /><br />oButt2:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">2</span><span style="color: #ff0000;">", "</span><span style="color: #000000;">2</span>. <span style="color: #0000ff;">Button</span><span style="color: #ff0000;">", 1, 0, 128 }<br /><br />DEFINE BUTTON oButt3 OF oBar FILE aBtn[3][1], aBtn[3][2] ;<br />MESSAGE "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">3</span><span style="color: #ff0000;">" ; <br />ACTION ( oButt2:Enable(), ;<br /> IIF( aAct[3] = .T., MsgAlert( "</span><span style="color: #0000ff;">Action</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">" ), MsgAlert( "</span><span style="color: #0000ff;">Action</span> <span style="color: #000000;">2</span><span style="color: #ff0000;">" ) ) ) ;<br />PROMPT "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">3</span><span style="color: #ff0000;">" <br /><br />oButt3:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">3</span><span style="color: #ff0000;">", "</span><span style="color: #000000;">3</span>. <span style="color: #0000ff;">Button</span><span style="color: #ff0000;">", 1, 0, 128 }<br /><br />DEFINE BUTTON oButt4 OF oBar FILE aBtn[4][1], aBtn[4][2] ;<br />MESSAGE "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">4</span><span style="color: #ff0000;">" ; <br />ACTION oButt2:Disable() ;<br />PROMPT "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">4</span><span style="color: #ff0000;">" <br /><br />oButt4:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">4</span><span style="color: #ff0000;">", "</span><span style="color: #000000;">4</span>. <span style="color: #0000ff;">Button</span><span style="color: #ff0000;">", 1, 0, 128 }<br /><br />DEFINE BUTTON oButt5 OF oBar FILE aBtn[5][1], aBtn[5][2] ;<br />MESSAGE "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">" ; <br />ACTION MsgAlert( "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">","</span>Attention<span style="color: #ff0000;">" ) ;<br />PROMPT "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">" <br /><br />oButt5:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">", "</span><span style="color: #000000;">5</span>. <span style="color: #0000ff;">Button</span><span style="color: #ff0000;">", 1, 0, 128 }<br /><br /><br />DEFINE BUTTON oButt6 OF oBar FILE c_path + "</span>\project\Stop.bmp<span style="color: #ff0000;">" MESSAGE "</span>Close<span style="color: #ff0000;">" ; <br />ACTION ( oWnd:End() ) ;<br />PROMPT "</span>Close<span style="color: #ff0000;">" <br /><br />oButt6:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + "</span>Close BarTools<span style="color: #ff0000;">", "</span>Close<span style="color: #ff0000;">", 1, 0, 128 }<br /><br />AEval( oWnd:aControls, { | o | o:oCursor := oCursorHand } )<br /><br />SET MESSAGE OF oWnd TO "</span>Bar-Test<span style="color: #ff0000;">" ;<br />CENTERED CLOCK KEYBOARD 2007<br /><br />ACTIVATE WINDOW oWnd MAXIMIZED ;<br /><br />RETURN NIL<br /></span></div>[/code:2qhi053s]
[i:2qhi053s][b:2qhi053s]It seems, FWH is getting more and more popular.
I noticed sometimes more than 20 Guests online.[/b:2qhi053s][/i:2qhi053s]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Changing the Toolbar content | Thank you Uwe, I apreciate your attention.
I am on FW and this and old forum since the version 1.9.2 and as far as I can tell, the xHB/FWH combination is one of the best for middle sized projects. Even for bigger projects, because we can connect to SQL databases, so there is no much limitation. I use FWH all those years up to now and have no reason to switch to any other language. The only problem is that every new FWH version nakes me trouble in compatibility with xHB.... Have no idea why is that so, but this is a huge problem for me, because I don't have always time to spent days and days adjusting xHB and FWH...
And yes, FWH is very popular because of its efficiency and simplicity of use, giving us a very complex and useful resulting applications.
Regarding the problem I have, I probably was not clear anough, my fault.
I understand the sample you showed to me and this kind of logic works fine on my testings.
As you see I have a vertical array of buttons on the left and when I click on any of these vertical buttons, I need the upper horizontal Toolbar to completely redraw, this time with complete new buttons and actions.
I can use buton image replacements and assigning the new actions to each, but this will be my last option.
- For example, the first vertical button is related to road transportation. When clicked, the upper horizontal Toolbar will show buttons with images for road transport (cars, trucks etc...) and the actions will trigger dialogs about each vechicle in road transport.
- The second button is related to water transportation. When clicked, the upper horisontal Toolbar will show buttons with images for water transport (boats, ferry, ship etc...) and the actions will trigger dialogs about each vechicle in water transport.
- The hird button is related to air transportation. When clicked, the upper horisontal Toolbar will show buttons with images for air transport (planes, helicopters etc...) and the actions will trigger dialogs about each vechicle in air transport.
The problem is that each kind of transport can have different number of buttons. If road transport has 8 buttons in horizontal Toolbar, when the toolbar needs to show air transport which has 5 buttons, I ned to figure out how to "hide" and disable the 3 buttons which are left.
Also if the water transport needs 11 buttons, how can I show them because I am couple of buttons short regarding the road and air transport....
I thought maybe there is a way to ":END()" the existing horizontal toolbar and programatically redefine and show the new toolbar "on the fly" with new images and actions after each button is clicked, depending of the transportation selected.
Maybe I was now more precise, my english is probably not good enough to express myself clearely
Thanks
Boris |
Changing the Toolbar content | At first, Your English is fine and I understand Your Problem.
Maybe a complete replacement will be a Solution.
I will have a closer look at Your posted Problem.
Best regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Changing the Toolbar content | Boris,
You can create and manage as many toolbars as needed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
To switch from one toolbar to another is as easy as:
[code=fw:2dp3ar7q]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&ToolBar1..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar2, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar1, oToolBar2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar1:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 1"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"T&oolBar2..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar1, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar2, oToolBar1:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar2:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 2"</span><br /> </div>[/code:2dp3ar7q]
Here you have a complete working example:
[code=fw:2dp3ar7q]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Switching toolbars</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">static</span> oWnd, oToolBar1, oToolBar2<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FWH - Switching toolsbars"</span> ;<br /> <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oToolBar1 = BuildToolBar1<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /> oToolBar2 = BuildToolBar2<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /> oToolBar2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oTop</span> = oToolBar1<br /><br /> <span style="color: #0000ff;">DEFINE</span> STATUSBAR <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Toolbars test"</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oToolBar2:<span style="color: #000000;">nWidth</span> := oToolBar1:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span><br /> <br /> oToolBar1:<span style="color: #000000;">oImageList</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oToolBar2:<span style="color: #000000;">oImageList</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> BuildMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Project"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&ToolBar1..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar2, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar1, oToolBar2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar1:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 1"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"T&oolBar2..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar1, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar2, oToolBar1:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar2:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 2"</span><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Exit..."</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Exit"</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Edit"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Search..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Search"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Print..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Print"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Utilities"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Disable button..."</span> <span style="color: #0000ff;">ACTION</span> oToolBar:<span style="color: #000000;">EnableButton</span><span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, .f. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Enable button..."</span> <span style="color: #0000ff;">ACTION</span> oToolBar:<span style="color: #000000;">EnableButton</span><span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, .t. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #00C800;">function</span> BuildToolBar1<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oToolBar, oImageList<br /> <br /> <span style="color: #0000ff;">DEFINE</span> IMAGELIST oImageList <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>, <span style="color: #000000;">32</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"new"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"open"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"check"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"search"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> TOOLBAR oToolBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">58</span> ; <span style="color: #B900B9;">// 50, 50 ;</span><br /> IMAGELIST oImageList BALLOON <span style="color: #B900B9;">// tooltips balloon style</span><br /> <br /> oToolBar:<span style="color: #000000;">SetTextRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> oToolbar:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Hello"</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// Modify first button text</span><br /> TOOLTIP <span style="color: #ff0000;">"New"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&New project"</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"New"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> oToolBar:<span style="color: #000000;">SetChecked</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, .t. <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// Set pressed the second button </span><br /> TOOLTIP <span style="color: #ff0000;">"Open"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open project"</span> ;<br /> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Open"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBSEPARATOR <span style="color: #0000ff;">OF</span> oToolBar<br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBMENU <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Menu"</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Menu"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Menu"</span> ;<br /> <span style="color: #0000ff;">MENU</span> BuildPopup<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> oToolBar:<span style="color: #000000;">SetChecked</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, .f. <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// MsgInfo( "Search" ) ;</span><br /> TOOLTIP <span style="color: #ff0000;">"Search"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Search"</span><br /><br /><span style="color: #00C800;">return</span> oToolBar<br /><br /><span style="color: #00C800;">function</span> BuildToolBar2<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oToolBar, oImageList<br /> <br /> <span style="color: #0000ff;">DEFINE</span> IMAGELIST oImageList <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">32</span>, <span style="color: #000000;">32</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"print"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"internet"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"keys"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> IMGBITMAP <span style="color: #0000ff;">OF</span> oImageList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"quit"</span> <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> TOOLBAR oToolBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">58</span> ; <span style="color: #B900B9;">// 50, 50 ;</span><br /> IMAGELIST oImageList BALLOON <span style="color: #B900B9;">// tooltips balloon style</span><br /> <br /> oToolBar:<span style="color: #000000;">SetTextRows</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Print"</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Print a report"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Print a report"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> TBSEPARATOR <span style="color: #0000ff;">OF</span> oToolBar<br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Upgrade"</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Search for new versions"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Upgrade"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Users"</span> <span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"Users management"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Users"</span> <br /><br /> <span style="color: #0000ff;">DEFINE</span> TBSEPARATOR <span style="color: #0000ff;">OF</span> oToolBar<br /><br /> <span style="color: #0000ff;">DEFINE</span> TBBUTTON <span style="color: #0000ff;">OF</span> oToolBar ;<br /> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> TOOLTIP <span style="color: #ff0000;">"End Application"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span><br /> <br /><span style="color: #00C800;">return</span> oToolBar<br /><br /><span style="color: #00C800;">function</span> BuildPopup<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMenu<br /> <br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #0000ff;">POPUP</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"One"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"One"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Two"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Two"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Three"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Three"</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <br /><span style="color: #00C800;">return</span> oMenu <br /> </div>[/code:2dp3ar7q] |
Changing the Toolbar content | Codemaker,
done it this way:
[code=fw:13fc7q9r]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br /><span style="color: #B900B9;">// Define the maximal number of buttons and disable them</span><br /> nBtnMax := <span style="color: #000000;">40</span><br /> <span style="color: #00C800;">FOR</span> i := nBtnFree <span style="color: #0000ff;">TO</span> nBtnMax<br /> oBtn := TBtnBmp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">NewBar</span><span style="color: #000000;">(</span>,,,,,, IIf<span style="color: #000000;">(</span> i == nBtnFree, .T., .F. <span style="color: #000000;">)</span>, oBar, .F.,,, .F.,,,, <span style="color: #ff0000;">"B."</span> + AllTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> i <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,,,,,, Upper<span style="color: #000000;">(</span> <span style="color: #ff0000;">"BOTTOM"</span> <span style="color: #000000;">)</span>,,, .F. <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span> i<br />...<br /><span style="color: #B900B9;">// Define the buttons for the actual modul</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .T.<br /> <span style="color: #00C800;">IF</span> n <= nBtnMax<br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">Enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cCaption</span> := ...<br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cToolTip</span> := ...<br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cAction</span> := ...<br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">bAction</span> := ..<br /> n ++<br /> <span style="color: #00C800;">ELSE</span><br /> EXIT<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #B900B9;">// Next button</span><br /> <span style="color: #00C800;">ENDDO</span><br />...<br /><span style="color: #B900B9;">// delete all buttons if swichting the modul</span><br /> <span style="color: #00C800;">FOR</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nBtnMax<br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">""</span><br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">""</span><br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">cAction</span> := <span style="color: #ff0000;">""</span><br /> oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> :<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">NEXT</span> n<br /><span style="color: #B900B9;">// Define the buttons for the actual modul</span><br />...</div>[/code:13fc7q9r]
HTH |
Changing the Toolbar content | [quote="Antonio Linares":3n4m0r8v]Boris,
You can create and manage as many toolbars as needed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
To switch from one toolbar to another is as easy as:
[code=fw:3n4m0r8v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&ToolBar1..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar2, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar1, oToolBar2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar1:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 1"</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"T&oolBar2..."</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> == oToolBar1, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">oTop</span> := oToolBar2, oToolBar1:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oToolBar2:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"ToolBar 2"</span><br /> </div>[/code:3n4m0r8v]
[/quote:3n4m0r8v]
Antonio, thank you for this solution, it is exactly what I need.
Now I can move on <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
BTW: thanks to Uwe and frose too |
Changing the background color | [code=fw:3sv83gjq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveTouch.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</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 /> <span style="color: #0000ff;">SIZE</span> ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oDlg:<span style="color: #000000;">SetStyleSheet</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"QDialog"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"{"</span> + CRLF + ;<br /> <span style="color: #ff0000;">" background-color: #882244;"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"}"</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3sv83gjq] |
Changing the background color of a BUTTON | Hi Antonio
I can't see how to do it. Is it currently possible? If not could it be added? It would really help in my application. (I want to change the background color when a button is clicked and change it back again when another one is clicked).
Thanks
Doug
(xProgrammer) |
Changing the background color of a BUTTON | Antonio
I have done a little research and in GTK+2.0 it sounds like it isn't too difficult, you need something like this:
[code:n43dsnm5] GdkColor color;
gdk_color_parse ("red", &color);
gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &color);
[/code:n43dsnm5]
The code required in earlier versions is greater. Do you use GTK+2.0? |
Changing the background color of a BUTTON | Doug,
Afaik we are using GTK+ 2.0. Please try this code in Class TWindow:
[code:225d38ch]
METHOD SetColor( cColor ) INLINE GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 1 ), &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP
[/code:225d38ch] |
Changing the background color of a BUTTON | Hi Antonio
Thanks. I will try that. I take it that I will have to compile the code in the modified window.prg and what else? Am I producing a new library? or object code to be linked? or what?
Sorry for the (probably) naive questions but I haven't had to do that sort of thing before.
Thanks
Doug |
Changing the background color of a BUTTON | Doug,
You have to modify window.prg and then compile it and link it as another PRG of your application |
Changing the background color of a BUTTON | Hi Antonio
I did that and got the following error in the terminal window from whioch I launched my application:
(<unknown>:30895) Pango-CRITICAL **: pango-color-parse: assertion 'spec != NULL' failed
Seems like a parameter passing problem?
The call in my code was:
[code:35c8n9kd] btnSelect:SetColor("red")[/code:35c8n9kd])
But we must be close since we are getting a message from pango_color_parse.
I just found out more - I changed METHOD SetColor in two ways.
Firstly I hard coded red - which stopped the error message (bur unfortunately didn't give me a red button) and I included a MsgInfo (just to check that the code was being traversed.
[code:35c8n9kd]METHOD SetColor( cColor ) INLINE MsgInfo( "red"), GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( "red", &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP [/code:35c8n9kd]
I just tried setting the color of oWnd to red - again no error but also no red.
I will do some more research, but if you have any ideas please let me know.
Thanks
Doug
(xProgrammer) |
Changing the background color of a BUTTON | Hi Antonio
Progress!
I changed
[code:32febzkz]gtk_widget_modify_fg
[/code:32febzkz]
to
[code:32febzkz]gtk_widget_modify_bg[/code:32febzkz]
And we have a red button (background) in the normal state.
So we are very close. Now we have to work out:
Why hb_parc(1) doesn't seem to be getting the value "red".
List of states to which colors can be applied (That should be easy enough for me to find))
The function that sets a color for the text. (Actually I am happy just controlling the background color, but others may want to change the text color)
Thanks and regards
Doug
(xProgrammer) |
Changing the background color of a BUTTON | States are as follows:
enum GtkStateType
[code:1pldv652]typedef enum
{
GTK_STATE_NORMAL,
GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,
GTK_STATE_SELECTED,
GTK_STATE_INSENSITIVE
} GtkStateType;[/code:1pldv652]
This type indicates the current state of a widget; the state determines how the widget is drawn. The GtkStateType enumeration is also used to identify different colors in a GtkStyle for drawing, so states can be used for subparts of a widget as well as entire widgets.
[color=red:1pldv652]GTK_STATE_NORMAL[/color:1pldv652]
State during normal operation.
[color=red:1pldv652]GTK_STATE_ACTIVE[/color:1pldv652]
State of a currently active widget, such as a depressed button.
[color=red:1pldv652]GTK_STATE_PRELIGHT[/color:1pldv652]
State indicating that the mouse pointer is over the widget and the widget will respond to mouse clicks.
[color=red:1pldv652]GTK_STATE_SELECTED[/color:1pldv652]
State of a selected item, such the selected row in a list.
[color=red:1pldv652]GTK_STATE_INSENSITIVE[/color:1pldv652]
State indicating that the widget is unresponsive to user actions.
And the color changing methods are:
[code:1pldv652]gtk_widget_modify_fg ()
void gtk_widget_modify_fg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);[/code:1pldv652]
Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also gtk_widget_modify_style().
widget :
a GtkWidget
state :
the state for which to set the foreground color
color :
the color to assign (does not need to be allocated), or NULL to undo the effect of previous calls to of gtk_widget_modify_fg().
[code:1pldv652]gtk_widget_modify_bg ()
void gtk_widget_modify_bg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
[/code:1pldv652]
Sets the background color for a widget in a particular state. All other style values are left untouched. See also gtk_widget_modify_style().
Note that "no window" widgets (which have the GTK_NO_WINDOW flag set) draw on their parent container's window and thus may not draw any background themselves. This is the case for e.g. GtkLabel. To modify the background of such widgets, you have to set the background color on their parent; if you want to set the background of a rectangular area around a label, try placing the label in a GtkEventBox widget and setting the background color on that.
widget :
a GtkWidget
state :
the state for which to set the background color
color :
the color to assign (does not need to be allocated), or NULL to undo the effect of previous calls to of gtk_widget_modify_bg().
[code:1pldv652]gtk_widget_modify_text ()
void gtk_widget_modify_text (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);[/code:1pldv652]
Sets the text color for a widget in a particular state. All other style values are left untouched. The text color is the foreground color used along with the base color (see gtk_widget_modify_base()) for widgets such as GtkEntry and GtkTextView. See also gtk_widget_modify_style().
widget :
a GtkWidget
state :
the state for which to set the text color
color :
the color to assign (does not need to be allocated), or NULL to undo the effect of previous calls to of gtk_widget_modify_text().
[code:1pldv652]gtk_widget_modify_base ()
void gtk_widget_modify_base (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
[/code:1pldv652]
Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see gtk_widget_modify_text()) for widgets such as GtkEntry and GtkTextView. See also gtk_widget_modify_style().
Note that "no window" widgets (which have the GTK_NO_WINDOW flag set) draw on their parent container's window and thus may not draw any background themselves. This is the case for e.g. GtkLabel. To modify the background of such widgets, you have to set the base color on their parent; if you want to set the background of a rectangular area around a label, try placing the label in a GtkEventBox widget and setting the base color on that.
widget :
a GtkWidget
state :
the state for which to set the base color
color :
the color to assign (does not need to be allocated), or NULL to undo the effect of previous calls to of gtk_widget_modify_base().
However I tried modify_text for my button and it didn't work. I tried setting background colors for different states and got that working fine with this code:
[code:1pldv652]METHOD SetColor( cColor ) INLINE MsgInfo( "red"), GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
GdkColor acolor;
gdk_color_parse( "red", &color );
gdk_color_parse( "yellow", &acolor );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_PRELIGHT, &acolor );
}
#pragma ENDDUMP [/code:1pldv652]
So a generic SetColor might take color names for the various states.
Could you tell me the best way to debug why I don't seem to be getting the string valuse passed in to the C code.
Thanks
Doug |
Changing the background color of a BUTTON | Hi Antonio
I should have worked it out before - the problem with your original code is that where you have hb_parc( 1 ) it should in fact he hb_parc( 2). Now parameter passing appears fine.
Now the function needs to be made more utilitarian - ie change any of the colors (bg, fg, text, base) for any state. State can be passed as a parameter.
Regards
Doug |
Changing the background color of a BUTTON | Doug,
There was a bug in my code. This is the right one:
[code:3s6zpmnq]
METHOD SetColor( cColor ) INLINE GtkSetColor( ::hWnd, cColor )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 2 ), &color );
gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), GTK_STATE_NORMAL, &color );
}
#pragma ENDDUMP
[/code:3s6zpmnq] |
Changing the background color of a BUTTON | Hi Antonio
This version allows you to pass in the state to apply the color to as a second parameter:
[code:1o5s0962]METHOD SetColor( cColor, iState ) INLINE GtkSetColor( ::hWnd, cColor, iState )
#pragma BEGINDUMP
#include <hbapi.h>
#include <gtk/gtk.h>
HB_FUNC( GTKSETCOLOR )
{
GdkColor color;
gdk_color_parse( hb_parc( 2 ), &color );
gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}[/code:1o5s0962]
The state parameter can then be:
[code:1o5s0962]#define GTK_NORMAL 1
#define GTK_ACTIVE 2
#define GTK_PRELIGHT 3
#define GTK_SELECTED 4
#define GTK_INSENSITIVE 5[/code:1o5s0962]
Next step is to either have multiple methods (SetBGColor, SetFGColor, SetTextColor and SetBaseColor, or pass in an additional parameter (switch).
Regards
Doug |
Changing the background color of a BUTTON | Correction to above - defines should be:
[code:yrpen0z5]#define GTK_NORMAL 0
#define GTK_ACTIVE 1
#define GTK_PRELIGHT 2
#define GTK_SELECTED 3
#define GTK_INSENSITIVE 4[/code:yrpen0z5] |
Changing the background color of a BUTTON | Doug,
I think we should implement it this way:
METHOD SetColor( cForeColor, cBackColor [, nState] ) |
Changing the background color of a BUTTON | Hi Antonio
I certainly want to manipulate text-color as well (So that if a GET is set to WHEN .F. it isn't in that dull gray which some users find hard to read).
That would only leave base-color which means perhaps we should consider doing all four.
Maybe we could have:
[code:pdvyejvk]
METHOD SetColor( cForeColor[, cBackColor[, cTextColor[, cBaseColor [, nState]]]] )[/code:pdvyejvk]
such that passing a NULL for any color just means that the corresponding gtk_widget-modify method is not invoked and the present setting is left unaltered.
Perhaps even better would be the following:
METHOD SetColor( aColors[, nState])
where aColors is an array of the four possible color settings
[code:pdvyejvk]#define GTK_FOREGROUND 1
#define GTK_BACKGROUND 2
#define GTK_TEXT 3
#define GTK_BASE 4[/code:pdvyejvk]
so in usage we would have something like:
[code:pdvyejvk]aGTK_Colors := ARRAY( 4 )
aGTK_Colors[GTK_BACKGROUND] := "red"
aGTK_Colors[GTK_TEXT] := "black"
btnEXAMPLE:SetColors( aGTK_Colors, GTK_PRELIGHT )[/code:pdvyejvk]
The SetColor Method would presumably contain code like:
[code:pdvyejvk]LOCAL iLen
iLen := LEN( aColors )
IF iLen < 0
RETURN
ENDIF
IF !Empty( a Colors[1] )
GtkSetFGColor( ::hWnd, aColors[1], iState )
ENDIF
IF iLen < 2
RETURN
ENDIF
IF !EMPTY( aColors[2] )
GtkSetBGColor( ::hWnd, aColors[2], iState )
ENDIF[/code:pdvyejvk]
etc
Just my suggestion.
Thanks for your help
Regards
Doug
(xProgrammer) |
Changing the background color of a BUTTON | For anyone following this who wants to know what colors can be created this way the list is available in text form at
<!-- m --><a class="postlink" href="http://www-swiss.ai.mit.edu/~jaffer/Color/rgb.txt">http://www-swiss.ai.mit.edu/~jaffer/Color/rgb.txt</a><!-- m -->
or to see the colors go to
<!-- m --><a class="postlink" href="http://sedition.com/perl/rgb.html">http://sedition.com/perl/rgb.html</a><!-- m -->
alternatively search for rgb.txt
Regards
Doug
(xProgrammer) |
Changing the bitmap in the bookmark | Hi,
In the TFolderEx bookmarks, I need, depending on the situation, to change the bitmap (from the resource) . How can this be done ? |
Changing the bitmap in the bookmark | Maybe,
[code=fw:1y4bxsah]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">BITMAPS</span> IIF<span style="color: #000000;">(</span> lCondition, <span style="color: #ff0000;">"Bitmap01"</span>, <span style="color: #ff0000;">"BitMap02"</span> <span style="color: #000000;">)</span><br /> </div>[/code:1y4bxsah]
Regards, saludos. |
Changing the bitmap in the bookmark | Not suitable. I need to interactively change pictures in bookmarks. I tried the methods SetBitmap and SetBrightBMP, but it didn't work out <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> |
Changing the bitmap in the bookmark | [quote="Natter":1x8vxryh]Not suitable. I need to interactively change pictures in bookmarks. I tried the methods SetBitmap and SetBrightBMP, but it didn't work out <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->[/quote:1x8vxryh]
Sorry, this not run ok ?
[code=fw:1x8vxryh]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oFld:<span style="color: #000000;">SetBitMap</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"modif"</span>, oFld:<span style="color: #000000;">nOption</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// "modif" -> resource of bitmap</span><br /> </div>[/code:1x8vxryh] |
Changing the bitmap in the bookmark | If I run the method: SetBitmap ("modif", oFld:nOption), then the bookmark simply becomes empty |
Changing the bitmap in the bookmark | [quote="Natter":3v87mpgk]If I run the method: SetBitmap ("modif", oFld:nOption), then the bookmark simply becomes empty[/quote:3v87mpgk]
Resource "modif" exist in your file .RC or .RES ? |
Changing the bitmap in the bookmark | I didn't understand the question. First, the resources are registered in .RC, after compilation we get .RES
When installing TFolderEx, everything is fine - bookmarks with text and pictures. |
Changing the bitmap in the bookmark | Look at this, see if it helps:
[url:3uxou6ov]https://fivetechsupport.com/forums/viewtopic.php?f=3&t=32718&start=0[/url:3uxou6ov]
[url:3uxou6ov]http://fivewin.com.br/index.php?/topic/27181-gradient-nos-bot%C3%B5es-e-na-buttonbar/[/url:3uxou6ov]
[url:3uxou6ov]https://forums.fivetechsupport.com/viewtopic.php?f=6&t=20005&p=177363&hilit=imagen+en+recurso#p177363[/url:3uxou6ov]
Regards, saludos. |
Changing the domain of images- and download-links | Hello,
I have a special question about my images- and download-links inside the forum.
Everything belongs to my website < PFLEGEPLUS.COM > I created 20 years ago.
Now a company asked me if I would like to sell this name
because < PFLEGE > is a area of business and < PLUS > means < + >
Is it possiblel to make a global change inside the forum with a new name
to keep everything activated.
best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Changing the domain of images- and download-links | Dear Uwe,
Yes, whats the new name that you want to use ? |
Changing the edit picture on the same col (xbrowse) | Hi all,
another xbrowse issue.
I have an array with the second element (aarray[x,2]) numeric editable.
I would like to use the picture "99.9" for the value on the first row and "99.99" for the value on the second row.
Any suggest how can I make this ?
Thanks in adance
This self-contained sample show my problem.
function Main()
local oDlg, oBrw, aArray
set epoch to 1920
aArray:={}
aadd(aArray,{"Marc",10.2}) && I have a one digit value
aadd(aArray,{"Luca",6.55}) && I have a two digit value
DEFINE DIALOG oDlg SIZE 300, 200
@0,0 XBROWSE oBrw OF oDlg ARRAY aArray AUTOCOLS
oBrw:aCols[2]:cEditPicture := "@E 999.99" && <-------- ? ?
oBrw:aCols[2]:nEditType := 1
oBrw:aCols[2]:bOnPostEdit := {|o,x| nLastCell:=oBrw:nArrayAt,aArray[oBrw:nArrayAt,2]:=x}
oBrw:lFastEdit:=.t.
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTER
return nil |
Changing the edit picture on the same col (xbrowse) | Please try this revised sample
[code=fw:1s3fosz9]<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;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">local</span> oDlg, oBrw, aArray<br /><span style="color: #00C800;">local</span> nLastCell<br /><br />* set century off<br />set epoch <span style="color: #0000ff;">to</span> <span style="color: #000000;">1920</span><br /><br />aArray:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Marc"</span>,<span style="color: #000000;">1.2</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Luca"</span>,<span style="color: #000000;">6.5</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"James"</span>,<span style="color: #000000;">11.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Christine"</span>,<span style="color: #000000;">1.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Melanie"</span>,<span style="color: #000000;">15.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Robert"</span>,<span style="color: #000000;">14.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Jimmy"</span>,<span style="color: #000000;">13.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Enrico"</span>,<span style="color: #000000;">10.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Mario"</span>,<span style="color: #000000;">12.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Pinco"</span>,<span style="color: #000000;">13.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br />aadd<span style="color: #000000;">(</span>aArray,<span style="color: #000000;">{</span><span style="color: #ff0000;">"Eric"</span>,<span style="color: #000000;">14.3</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /><br />XbrNumFormat<span style="color: #000000;">(</span> <span style="color: #ff0000;">'E'</span>, .t. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Set numbers to European format</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">200</span><br /><br />@<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY aArray <span style="color: #0000ff;">AUTOCOLS</span> ;<br /><br /><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"999.9"</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := <span style="color: #000000;">1</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>|o,x| nLastCell:=oBrw:<span style="color: #000000;">nArrayAt</span>,aArray<span style="color: #000000;">[</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span>:=x<span style="color: #000000;">}</span><br /><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> || oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bStrData</span> := ;<br /> <span style="color: #000000;">{</span> || cValToStr<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</span> == <span style="color: #000000;">1</span>, ;<br /> <span style="color: #ff0000;">'999.9'</span>, <span style="color: #ff0000;">'999.99'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br />oBrw:<span style="color: #000000;">lFastEdit</span>:=.t.<br />oBrw:<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ATail<span style="color: #000000;">(</span> aArray <span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> != <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span>AAdd<span style="color: #000000;">(</span> aArray, <span style="color: #000000;">{</span> <span style="color: #ff0000;">'New'</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> | oBrw | oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cEditPicture</span> := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</span> == <span style="color: #000000;">1</span>, ;<br /> <span style="color: #ff0000;">'999.9'</span>, <span style="color: #ff0000;">'999.99'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1s3fosz9] |
Changing the edit picture on the same col (xbrowse) | Hi,
the numeric cells are diplayed well
but I need to make the same with the edit picture also.
Something like this:
oBrw:aCols[2]:bEditPicture := ;
{ || cValToStr( oBrw:aRow[2], If( oBrw:nArrayAt == 1, ;
'999.9', '999.99' ) ) }
But the bEditPicture doesn't exist.
Is there a codeblock that can we use to make this ?
Thanks in advance. |
Changing the edit picture on the same col (xbrowse) | I am sorry. I made a mistake in copying the code. I now edited it.
We can change the edit picture through bChange
here is the right code
[code=fw:1f9ulxew]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> | oBrw | oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cEditPicture</span> := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</span> == <span style="color: #000000;">1</span>, ;<br /> <span style="color: #ff0000;">'999.9'</span>, <span style="color: #ff0000;">'999.99'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:1f9ulxew]
Please compile the ( now edited ) source in my previous post and see both display and edit picture are working properly.
At of now XBrowse does not support code block for edit picture, but we can achieve what you want as in the example above. |
Changing the edit picture on the same col (xbrowse) | It runs fine. Thank you very much for your support. |
Changing the place of ""comp.log"" file in scripts. | I am usings execute command to run the scripts as below.
When I run my program a file named comp.log is created in the current directory.
Is it possible to change it. I want it to be created in another directory (for example in my documents folder)
Thanks in advance.
[code=fw:1ojgyvzo]<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;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> cPrg, cError, cResult<br /><br /> cPrg := <span style="color: #ff0000;">'function Test(x,y) '</span> + CHR<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>+CHR<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> cPrg += <span style="color: #ff0000;">'local z '</span> + CHR<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>+CHR<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> cPrg += <span style="color: #ff0000;">' z := x * y - 2 '</span> + CHR<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>+CHR<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> cPrg += <span style="color: #ff0000;">'return z '</span> + CHR<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span>+CHR<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /><br /> cResult := Execute<span style="color: #000000;">(</span>cPrg, <span style="color: #000000;">10</span>, <span style="color: #000000;">5</span><span style="color: #000000;">)</span><br /> cError := MemoRead<span style="color: #000000;">(</span> <span style="color: #ff0000;">"comp.log"</span> <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">If</span> Empty<span style="color: #000000;">(</span>cError<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cResult <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> cError <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1ojgyvzo] |
Changing the place of ""comp.log"" file in scripts. | Birol,
In FWH\source\function\harbour.prg in function Execute() please comment out this line:
// FReOpen_Stderr ( "comp.log", "w" )
and modify this one:
oHrb = HB_CompileFromBuf( cCode, [b:1gojh2gf].T.[/b:1gojh2gf], "-n", "-I" + cFWheaders, "-I" + cHBheaders )
these fixes will be included in the next FWH version |
Changing the place of ""comp.log"" file in scripts. | Thanks master. It has gone. Not created in the current directory.
But where is it now? It will not be created? Or it has gone to somewhere else? |
Changing the place of ""comp.log"" file in scripts. | It will not be created
In case that there is an error, a runtime error will be generated |
Changing the tTitle text at runtime | Any ideas ?
I tried with oTitle:SetText("New text") without success.
Thanks in advance. |
Changing the tTitle text at runtime | Hi Marco,
Can you try it oTitle:aText[3] := "New Text" |
Changing the tTitle text at runtime | Marco,
in File : \samples\testtitl.prg change / add these lines for a Test :
[color=#FF0000:3rnzb241]Local oText1[/color:3rnzb241]
...
...
// Title 1 Horizontal ( top )
@ 015,150 TITLE oTitle1 size 460, 60 of oWnd SHADOW TOPRIGHT
oTitle1:aGrdBack = { { 1, nRGB( 129, 130, 138 ), nRGB( 59, 60, 62 ) } }
oTitle1:nShadowIntensity = 70
@ 10, 10 TITLETEXT [color=#FF0000:3rnzb241]oText1[/color:3rnzb241] OF oTitle1 TEXT [color=#0000FF:3rnzb241]"FIVEWIN 9.07"[/color:3rnzb241] FONT oFont1 BRUSH oBrush1
...
...
//Title 5 Horizontal( Down )
@ 480, 150 TITLE oTitle5 size 460, 60 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 2
@ 5, 10 TITLEIMG OF oTitle5 BITMAP "../bitmaps\32X32\keys.bmp" SIZE 30, 30 REFLEX TRANSPARENT ANIMA
@ 20, 60 TITLETEXT OF oTitle5 TEXT "<== Move over me" COLOR CLR_BLACK
@ 14, 220 TITLETEXT OF oTitle5 TEXT "FIVEWIN 9.07" COLOR CLR_BLACK FONT oFont2 3d
@ 5, 400 TITLEIMG OF oTitle5 BITMAP "../bitmaps\fivetech.bmp" SIZE 30, 30 REFLEX ;
ACTION [color=#FF0000:3rnzb241]oText1:SetText[/color:3rnzb241]( [color=#0000FF:3rnzb241]"New text"[/color:3rnzb241] )
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Changing the tTitle text at runtime | Hi Uwe,
your last sample runs well but is there a solution to change the text directly from oTitle1 ? |
Changing the tTitle text at runtime | Marco,
it works the same, also from inside the same Title
LOCAL oText1, [color=#FF0000:3pnoi593]oText2[/color:3pnoi593]
//Title 5 Horizontal( Down )
@ 480, 150 TITLE oTitle5 size 460, 60 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 2
@ 5, 10 TITLEIMG OF oTitle5 BITMAP "../bitmaps\32X32\keys.bmp" SIZE 30, 30 REFLEX TRANSPARENT ANIMA ;
ACTION [color=#FF0000:3pnoi593]oText2[/color:3pnoi593]:SetText([color=#0000FF:3pnoi593] "<== Text changed"[/color:3pnoi593] )
@ 20, 60 TITLETEXT [color=#FF0000:3pnoi593]oText2[/color:3pnoi593] OF oTitle5 TEXT [color=#0000FF:3pnoi593]"<== Move over me"[/color:3pnoi593] COLOR CLR_BLACK
@ 14, 220 TITLETEXT OF oTitle5 TEXT "FIVEWIN 9.07" COLOR CLR_BLACK FONT oFont2 3d
@ 5, 400 TITLEIMG OF oTitle5 BITMAP "../bitmaps\fivetech.bmp" SIZE 30, 30 REFLEX ;
ACTION oText1:SetText("New text")
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Changing the tTitle text at runtime | I mean something like oTitle1:xcontrol:settext("new text"). |
Changing the tTitle text at runtime | Hello Marco,
You don't need to define the Title, only the Textobject.
This button ( on Mainwindow ) changes the Text defined in Title 1.
// Style 2007
// -------------
@ 580, 300 BTNBMP oBtn1 OF oWnd ;
SIZE 200, 80 ;
PROMPT "&Change Text" 2007 ;
FONT oFont2 CENTER ;
ACTION oText1:SetText("FIVEWIN 9.10")
There could be another Combination :
A window with Titles, a Dialog and from inside the Dialog changing a Title-text of a Window-title.
...
...
ACTIVATE WINDOW OWND MAXIMIZED ;
ON INIT TEST_DLG( oWnd, [color=#FF0000:il99shk4]oText1[/color:il99shk4] )
...
...
FUNCTION TEST_DLG( oWnd, [color=#FF0000:il99shk4]oText1[/color:il99shk4] )
LOCAL oDlg
DEFINE DIALOG oDlg FROM 10, 10 TO 20, 45 OF oWnd ;
TITLE "Change Title-text" STYLE nOr( WS_VISIBLE, WS_OVERLAPPEDWINDOW )
@ 2, 2 BUTTON "&Change Title-text" ACTION [color=#FF0000:il99shk4]oText1[/color:il99shk4]:SetText( [color=#0000FF:il99shk4]"FIVEWIN 9.10"[/color:il99shk4] )
ACTIVATE DIALOG oDlg CENTERED
RETURN( NIL )
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Changing the tTitle text at runtime | I know. The problem is that I manage all my app windows thorough a routine that return me only the object related to the tTitle object, not the tTitleText of tTitle object. It is for this reason that I can't use directly the tTitletext object and I need to find a solution through the tTitle object. |
Changing the textcolor of RADIOS and CHECKB. at runtime ? | Hello,
I wanted to change the textcolor of RADIOS and CHECKBOXES at runtime.
It only works on SAY
[color=#0000FF:lowxjvo8]FUNCTION OBJ_UPDATE( oFld2, nTextColor, nBackColor )
// FOLDER
AEval( oFld2:aDialogs[ 2 ]:aControls, { |o| IF( o:ClassName == "TSAY", o:SetColor( nTextColor, nBackColor ), NIL ), ; // works !!!
IF( o:ClassName == "TRADIO", o:nClrText := nTextColor, NIL ), ;
IF( o:ClassName == "TCHECKBOX", o:SetColor( nTextColor, nBackColor ), NIL ), ;
o:Refresh() } )
// DIALOG
AEval( oDlgMain:aControls, { |o| IF( o:ClassName == "TSAY", o:SetColor( nTextColor, nBackColor ), NIL ), ; // works !!!
IF( o:ClassName == "TRADIO", o:nClrText := nTextColor, NIL ), ;
IF( o:ClassName == "TCHECKBOX", o:SetColor( nTextColor, nBackColor ), NIL ), ;
o:Refresh() } )
RETURN( NIL )[/color:lowxjvo8]
[b:lowxjvo8]Test on DIALOG and FOLDER[/b:lowxjvo8]
[img:lowxjvo8]http://www.pflegeplus.com/IMAGES/Samples20.jpg[/img:lowxjvo8]
[b:lowxjvo8]is it possible ( colorchange on button-action ) ?[/b:lowxjvo8]
[b:lowxjvo8]The complete test[/b:lowxjvo8]
If You want to include it in the sample-collector
please delete this line in < SAMPLES.prg > function
// -------- FOLDER - Backgrounds ---------------
FUNCTION F_BACKGRD( oFld, lTransp )
...
...
// there is a fixed textcolor defined
[b:lowxjvo8]AEval( oDlg:aControls, { |o| IF( o:ClassName == "TSAY", ( o:SetColor( 0, 13885951 ), o:Refresh() ), NIL ) } )[/b:lowxjvo8]
[b:lowxjvo8]add to < CODE_2.prg > function < GRPC2_SEC2( oFld2, nSavePage ) >
delete the < NO SAMPLE > message[/b:lowxjvo8]
[code=fw:lowxjvo8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// ----------------------- GROUP 2 Page 2 -------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GRPC2_SEC2<span style="color: #000000;">(</span> oFld2, nSavePage <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oSay<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, nTextColor := <span style="color: #000000;">255</span>, nBackColor := <span style="color: #000000;">3926784</span>, oBtn1, oBtn2<br /><span style="color: #00C800;">LOCAL</span> oRadio1, oRadio2, nRadio := <span style="color: #000000;">1</span>, oCheck1, oCheck2, lCheck := .F.<br /><br /><span style="color: #B900B9;">//MsgAlert( "Folder-page 2 with GRADIENT", "Attention" )</span><br /><br />@ <span style="color: #000000;">15</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">SAY</span> oSay<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" SAY - colortest "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">240</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">FONT</span> oLarge <span style="color: #0000ff;">OF</span> oFld2:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PIXEL</span> <br />oSay<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text on Green</span><br /><br />@ <span style="color: #000000;">55</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">SAY</span> oSay<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" SAY - transp.test "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">FONT</span> oLarge <span style="color: #0000ff;">OF</span> oFld2:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> ;<br /><span style="color: #0000ff;">PIXEL</span> TRANSPARENT <br />oSay<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text</span><br /><br />@ <span style="color: #000000;">100</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">RADIO</span> oRadio1 <span style="color: #0000ff;">VAR</span> nRadio <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">12</span> ;<br />HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oFld2:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span> <br />AEval<span style="color: #000000;">(</span> oRadio1:<span style="color: #000000;">aItems</span>, <span style="color: #000000;">{</span> | oRad | oRad:<span style="color: #000000;">lTransparent</span> := .T., ;<br /> oRad:<span style="color: #000000;">SetFont</span> <span style="color: #000000;">(</span> oMedium <span style="color: #000000;">)</span>, ;<br /> oRad:<span style="color: #000000;">nClrText</span> := nTextColor <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br />@ <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">CHECKBOX</span> oCheck1 <span style="color: #0000ff;">VAR</span> lCheck <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Checkbox"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">9</span> <span style="color: #0000ff;">OF</span> oFld2:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">FONT</span> oMedium <span style="color: #0000ff;">PIXEL</span> <br />oCheck1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text</span><br />oCheck1:<span style="color: #000000;">lTransparent</span> := .T.<br /><br /><span style="color: #B900B9;">// ------------- The DIALOG-area -------------</span><br /><br />@ <span style="color: #000000;">440</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">SAY</span> oSay<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" SAY - colortest "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">470</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">FONT</span> oLarge <span style="color: #0000ff;">OF</span> oDlgMain <span style="color: #0000ff;">PIXEL</span> <br />oSay<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text on Green</span><br /><br />@ <span style="color: #000000;">520</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">SAY</span> oSay<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" SAY - transp.test "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">480</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">FONT</span> oLarge <span style="color: #0000ff;">OF</span> oDlgMain ;<br /><span style="color: #0000ff;">PIXEL</span> TRANSPARENT <br />oSay<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text</span><br /><br />@ <span style="color: #000000;">590</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">RADIO</span> oRadio2 <span style="color: #0000ff;">VAR</span> nRadio <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">25</span> ;<br />HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlgMain <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span> <br />AEval<span style="color: #000000;">(</span> oRadio2:<span style="color: #000000;">aItems</span>, <span style="color: #000000;">{</span> | oRad | oRad:<span style="color: #000000;">lTransparent</span> := .T., ;<br /> oRad:<span style="color: #000000;">SetFont</span> <span style="color: #000000;">(</span> oMedium <span style="color: #000000;">)</span>, ;<br /> oRad:<span style="color: #000000;">nClrText</span> := nTextColor <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br />@ <span style="color: #000000;">595</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">CHECKBOX</span> oCheck2 <span style="color: #0000ff;">VAR</span> lCheck <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Checkbox"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlgMain <span style="color: #0000ff;">FONT</span> oMedium <span style="color: #0000ff;">PIXEL</span> <br />oCheck2:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Red text</span><br />oCheck2:<span style="color: #000000;">lTransparent</span> := .T.<br /><br /><span style="color: #B900B9;">// -------------</span><br /><br />@ <span style="color: #000000;">450</span>, <span style="color: #000000;">670</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">OF</span> oDlgMain ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #000000;">2007</span> ; <br />NOBORDER ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" &Text "</span> ;<br />FILENAME c_Path1 + <span style="color: #ff0000;">"PAINT.bmp"</span> ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> nTextColor := ChooseColor<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> OBJ_UPDATE<span style="color: #000000;">(</span> oFld2, nTextColor, nBackColor <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">FONT</span> oSFont ;<br /><span style="color: #0000ff;">LEFT</span><br /><br />@ <span style="color: #000000;">520</span>, <span style="color: #000000;">670</span> <span style="color: #0000ff;">BTNBMP</span> oBtn2 <span style="color: #0000ff;">OF</span> oDlgMain ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #000000;">2007</span> ; <br />NOBORDER ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" &Backgrd. "</span> ;<br />FILENAME c_Path1 + <span style="color: #ff0000;">"PAINT.bmp"</span> ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> nBackColor := ChooseColor<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> OBJ_UPDATE<span style="color: #000000;">(</span> oFld2, nTextColor, nBackColor <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">FONT</span> oSFont ;<br /><span style="color: #0000ff;">LEFT</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> OBJ_UPDATE<span style="color: #000000;">(</span> oFld2, nTextColor, nBackColor <span style="color: #000000;">)</span><br /><br />AEval<span style="color: #000000;">(</span> oFld2:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">{</span> |o| <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TSAY"</span>, o:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TRADIO"</span>, o:<span style="color: #000000;">nClrText</span> := nTextColor, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TCHECKBOX"</span>, o:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br />AEval<span style="color: #000000;">(</span> oDlgMain:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">{</span> |o| <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TSAY"</span>, o:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TRADIO"</span>, o:<span style="color: #000000;">nClrText</span> := nTextColor, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">ClassName</span> == <span style="color: #ff0000;">"TCHECKBOX"</span>, o:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nTextColor, nBackColor <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br />SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /> </div>[/code:lowxjvo8]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Changing the textcolor of RADIOS and CHECKB. at runtime ? | Uwe
I use a separate field for check boxes and radio buttons .. just shorten the text to show control and create a text box to go along side .. that way ON CHANGE I can modify the text.
May not be very elegant, but it works.
Rick Lipkin |
Changing the textcolor of RADIOS and CHECKB. at runtime ? | Rick,
I got it working changing the colors of [color=#0000FF:1y84wvgm]RADIOS and CHECKBOXES [/color:1y84wvgm]as well with these changes :
// ---------------
FUNCTION OBJ_UPDATE( oFld2, nTextColor, nBackColor )
// ---FOLDER ---
AEval( oFld2:aDialogs[ 2 ]:aControls, { |o| IF( o:ClassName == "TSAY", ( o:SetColor( nTextColor, nBackColor ), o:Refresh() ), NIL ), ;
IF( o:ClassName == "TRADIO", ( o:nClrText := nTextColor, o:Refresh() ), NIL ), ;
IF( o:ClassName == "TCHECKBOX", ( o:SetColor( nTextColor, nBackColor ), o:Refresh() ), NIL ) } )
// --- DIALOG ---
AEval( oDlgMain:aControls, { |o| IF( o:ClassName == "TSAY", ( o:SetColor( nTextColor, nBackColor ), o:Refresh() ), NIL ), ;
IF( o:ClassName == "TRADIO", ( o:nClrText := nTextColor, o:Refresh() ), NIL ), ;
IF( o:ClassName == "TCHECKBOX", ( o:SetColor( nTextColor, nBackColor ), o:Refresh() ), NIL ) } )
[size=150:1y84wvgm]Why needed ??? there is already a < o:Refresh() > that works with SAY[/size:1y84wvgm]
[color=#0000FF:1y84wvgm][b:1y84wvgm]oDlgMain:Refresh()
oFld2:aDialogs[ 2 ]:Refresh()[/b:1y84wvgm][/color:1y84wvgm]
RETURN( NIL )
// --------------
[img:1y84wvgm]http://www.pflegeplus.com/IMAGES/Samples21.jpg[/img:1y84wvgm]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Changing with and height of a window and a dialog | Hi.
I'm making some tests on the Acer Iconia tablet.
If I display a window and a dialog when the tablet if in landscape mode everything is perfect.
But when I rotate it I want to change the width and height according to the new size of the display area .
Is it possible to make it ? I've tried on the PAINT event but is not working.
Thanks a lot.
Massimo. |
Changing with and height of a window and a dialog | Massimo,
You can do:
oWnd:nWidth = ...
oWnd:nHeight = ...
same for oDlg or any oControl |
Changing with and height of a window and a dialog | Hi Antonio.
My problem is to recognize the rotating of the device. The original window is 1280 X 800 and when you rotate
the Iconia the window will be 800 X 1200. Is it possible to know when the device is changing the orientation ?
Thanks a lot.
Massimo. |
Changing with and height of a window and a dialog | Massimo.
Please run this test in your tablet and review events.log to find what msgs you get when you rotate the screen:
[code=fw:1ei5quu5]<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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd := TMyWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br /> CLASSDATA lRegistered<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br /> LogFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"events.log"</span>, <span style="color: #000000;">{</span> nMsg, nWParam, nLParam <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /> </div>[/code:1ei5quu5] |
Changing with and height of a window and a dialog | Hi Antonio.
This is the events.log
06/05/11 06:23:21: 49 0 0
06/05/11 06:23:21: 24 1 0
06/05/11 06:23:21: 70 0 1244328
06/05/11 06:23:21: 70 0 1244328
06/05/11 06:23:21: 28 1 5300
06/05/11 06:23:21: 134 1 0
06/05/11 06:23:21: 13 520 1240680
06/05/11 06:23:21: 127 2 0
06/05/11 06:23:21: 127 0 0
06/05/11 06:23:21: 127 1 0
06/05/11 06:23:21: 6 1 0
06/05/11 06:23:21: 61 -1 -4
06/05/11 06:23:21: 61 0 -12
06/05/11 06:23:21: 7 0 0
06/05/11 06:23:21: 133 1 0
06/05/11 06:23:21: 13 520 1240684
06/05/11 06:23:21: 20 1778454738 0
06/05/11 06:23:21: 71 0 1244328
06/05/11 06:23:21: 13 520 1241180
06/05/11 06:23:21: 5 0 15598089
06/05/11 06:23:21: 3 0 4653084
06/05/11 06:23:21: 15 0 0
06/05/11 06:23:21: 799 1 0
06/05/11 06:23:21: 132 0 11993576
06/05/11 06:23:21: 32 394516 33554433
06/05/11 06:23:21: 512 0 7340492
06/05/11 06:23:22: 127 1 0
06/05/11 06:23:22: 127 2 0
06/05/11 06:23:22: 127 0 0
06/05/11 06:23:22: 49365 0 0
06/05/11 06:23:22: 132 0 11993576
06/05/11 06:23:22: 32 394516 33554433
06/05/11 06:23:22: 512 0 7340492
06/05/11 06:23:24: 49693 16777216 0
06/05/11 06:23:24: 49467 0 0
06/05/11 06:23:26: 49693 16777216 270
06/05/11 06:23:26: 49467 0 0
06/05/11 06:23:27: 70 0 1244204
06/05/11 06:23:27: 36 0 1243288
06/05/11 06:23:27: 71 0 1244204
06/05/11 06:23:27: 3 0 5898263
06/05/11 06:23:27: 13 520 1241056
06/05/11 06:23:27: 136 32 0
06/05/11 06:23:27: 133 1 0
06/05/11 06:23:27: 13 520 1239680
06/05/11 06:23:27: 20 -2097081783 0
06/05/11 06:23:27: 256 233 1
06/05/11 06:23:28: 15 0 0
06/05/11 06:23:28: 126 32 83886880
06/05/11 06:23:28: 15 0 0
06/05/11 06:23:28: 133 1 0
06/05/11 06:23:28: 13 520 1239268
06/05/11 06:23:28: 20 1778454738 0
06/05/11 06:23:28: 136 4 0
06/05/11 06:23:29: 26 24 1244224
06/05/11 06:23:31: 49693 16777216 0
06/05/11 06:23:31: 134 0 0
06/05/11 06:23:31: 13 520 1240556
06/05/11 06:23:31: 6 0 0
06/05/11 06:23:31: 28 0 3668
06/05/11 06:23:31: 8 0 0
06/05/11 06:23:31: 49467 0 0
06/05/11 06:23:31: 70 0 1244204
06/05/11 06:23:31: 71 0 1244204
06/05/11 06:23:31: 13 520 1241056
06/05/11 06:23:31: 28 1 3668
06/05/11 06:23:33: 134 1 0
06/05/11 06:23:33: 13 520 1240556
06/05/11 06:23:33: 6 1 0
06/05/11 06:23:33: 7 0 0
06/05/11 06:23:33: 70 0 1244204
06/05/11 06:23:33: 36 0 1243288
06/05/11 06:23:33: 133 1 0
06/05/11 06:23:33: 13 520 1240560
06/05/11 06:23:33: 20 -2097081783 0
06/05/11 06:23:33: 71 0 1244204
06/05/11 06:23:33: 3 0 4718622
06/05/11 06:23:33: 13 520 1241056
06/05/11 06:23:33: 136 32 0
06/05/11 06:23:33: 15 0 0
06/05/11 06:23:33: 126 32 52430080
06/05/11 06:23:34: 15 0 0
06/05/11 06:23:34: 133 1 0
06/05/11 06:23:34: 13 520 1239268
06/05/11 06:23:34: 20 1778454738 0
06/05/11 06:23:34: 134 0 0
06/05/11 06:23:34: 13 520 1240556
06/05/11 06:23:34: 6 0 0
06/05/11 06:23:34: 28 0 3668
06/05/11 06:23:34: 8 0 0
06/05/11 06:23:34: 70 0 1244204
06/05/11 06:23:34: 71 0 1244204
06/05/11 06:23:34: 13 520 1241056
06/05/11 06:23:34: 28 1 3668
06/05/11 06:23:34: 134 0 0
06/05/11 06:23:34: 13 520 1240556
06/05/11 06:23:34: 6 1 0
06/05/11 06:23:34: 7 0 0
06/05/11 06:23:34: 134 0 0
06/05/11 06:23:34: 13 520 1240556
06/05/11 06:23:34: 6 0 0
06/05/11 06:23:34: 28 0 3668
06/05/11 06:23:34: 8 0 0
06/05/11 06:23:34: 70 0 1244204
06/05/11 06:23:34: 71 0 1244204
06/05/11 06:23:34: 13 520 1241056
06/05/11 06:23:34: 28 1 3668
06/05/11 06:23:34: 134 1 0
06/05/11 06:23:34: 13 520 1240556
06/05/11 06:23:34: 6 1 0
06/05/11 06:23:34: 7 0 0
06/05/11 06:23:34: 26 24 1244224
06/05/11 06:23:38: 716 0 2359809
06/05/11 06:23:38: 132 0 2359809
06/05/11 06:23:38: 283 3 8389797
06/05/11 06:23:38: 282 0 1243308
06/05/11 06:23:38: 32 394516 33554452
06/05/11 06:23:38: 160 20 2294272
06/05/11 06:23:38: 32 394516 33619988
06/05/11 06:23:38: 161 20 2294272
06/05/11 06:23:38: 533 0 0
06/05/11 06:23:38: 274 61536 2294272
06/05/11 06:23:38: 674 0 0
06/05/11 06:23:38: 16 0 0
06/05/11 06:23:38: 144 0 0
06/05/11 06:23:38: 70 0 1243492
06/05/11 06:23:38: 71 0 1243492
06/05/11 06:23:38: 134 0 0
06/05/11 06:23:38: 13 520 1239844
06/05/11 06:23:38: 6 0 0
06/05/11 06:23:38: 28 0 5300
06/05/11 06:23:38: 8 0 0
06/05/11 06:23:38: 2 0 0 |
Changing with and height of a window and a dialog | Massimo,
Please rotate the tablet 10 times and then copy here the events.log again, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Changing with and height of a window and a dialog | Here it is.
I have another question. When I display a dialog from a resource, is it possible to close this dialog and display another one
when the tablet is rotated ? I want to try to make different dialogs according to the resized display area.
Thanks a lot.
Massimo.
06/05/11 08:21:16: 49 0 0
06/05/11 08:21:16: 24 1 0
06/05/11 08:21:16: 70 0 1244328
06/05/11 08:21:16: 70 0 1244328
06/05/11 08:21:16: 28 1 3488
06/05/11 08:21:16: 134 1 0
06/05/11 08:21:16: 13 520 1240680
06/05/11 08:21:16: 127 2 0
06/05/11 08:21:16: 127 0 0
06/05/11 08:21:16: 127 1 0
06/05/11 08:21:16: 6 1 0
06/05/11 08:21:16: 61 -1 -4
06/05/11 08:21:16: 61 0 -12
06/05/11 08:21:16: 7 0 0
06/05/11 08:21:16: 133 1 0
06/05/11 08:21:16: 13 520 1240684
06/05/11 08:21:16: 20 16846678 0
06/05/11 08:21:16: 71 0 1244328
06/05/11 08:21:16: 13 520 1241180
06/05/11 08:21:16: 5 0 15598089
06/05/11 08:21:16: 3 0 4653084
06/05/11 08:21:16: 15 0 0
06/05/11 08:21:16: 127 1 0
06/05/11 08:21:16: 127 2 0
06/05/11 08:21:16: 127 0 0
06/05/11 08:21:16: 799 1 0
06/05/11 08:21:16: 49365 0 0
06/05/11 08:21:16: 132 0 12190151
06/05/11 08:21:16: 32 263340 33554433
06/05/11 08:21:16: 512 0 7537067
06/05/11 08:21:16: 132 0 12190151
06/05/11 08:21:16: 32 263340 33554433
06/05/11 08:21:16: 512 0 7537067
06/05/11 08:21:16: 132 0 12190151
06/05/11 08:21:16: 32 263340 33554433
06/05/11 08:21:16: 512 0 7537067
06/05/11 08:21:21: 49713 16777216 270
06/05/11 08:21:21: 49510 0 0
06/05/11 08:21:22: 70 0 1244204
06/05/11 08:21:22: 36 0 1243288
06/05/11 08:21:22: 71 0 1244204
06/05/11 08:21:22: 3 0 5898263
06/05/11 08:21:22: 13 520 1241056
06/05/11 08:21:22: 136 32 0
06/05/11 08:21:22: 133 1 0
06/05/11 08:21:22: 13 520 1239680
06/05/11 08:21:22: 20 33623066 0
06/05/11 08:21:22: 15 0 0
06/05/11 08:21:22: 126 32 83886880
06/05/11 08:21:23: 15 0 0
06/05/11 08:21:23: 133 1 0
06/05/11 08:21:23: 13 520 1239268
06/05/11 08:21:23: 20 16846678 0
06/05/11 08:21:23: 26 24 1244224
06/05/11 08:21:25: 49713 16777216 0
06/05/11 08:21:25: 49510 0 0
06/05/11 08:21:25: 134 0 0
06/05/11 08:21:25: 13 520 1240556
06/05/11 08:21:25: 6 0 0
06/05/11 08:21:25: 28 0 3744
06/05/11 08:21:25: 8 0 0
06/05/11 08:21:25: 70 0 1244204
06/05/11 08:21:25: 71 0 1244204
06/05/11 08:21:25: 13 520 1241056
06/05/11 08:21:25: 28 1 3744
06/05/11 08:21:25: 134 1 0
06/05/11 08:21:25: 13 520 1240556
06/05/11 08:21:25: 6 1 0
06/05/11 08:21:25: 7 0 0
06/05/11 08:21:26: 70 0 1244204
06/05/11 08:21:26: 36 0 1243288
06/05/11 08:21:26: 71 0 1244204
06/05/11 08:21:26: 3 0 4718622
06/05/11 08:21:26: 13 520 1241056
06/05/11 08:21:26: 136 32 0
06/05/11 08:21:26: 133 1 0
06/05/11 08:21:26: 13 520 1239680
06/05/11 08:21:26: 20 33623066 0
06/05/11 08:21:26: 15 0 0
06/05/11 08:21:27: 126 32 52430080
06/05/11 08:21:27: 15 0 0
06/05/11 08:21:27: 133 1 0
06/05/11 08:21:27: 13 520 1239268
06/05/11 08:21:27: 20 33623066 0
06/05/11 08:21:27: 134 0 0
06/05/11 08:21:27: 13 520 1240556
06/05/11 08:21:27: 6 0 0
06/05/11 08:21:27: 28 0 3744
06/05/11 08:21:27: 8 0 0
06/05/11 08:21:27: 70 0 1244204
06/05/11 08:21:27: 71 0 1244204
06/05/11 08:21:27: 13 520 1241056
06/05/11 08:21:27: 28 1 3744
06/05/11 08:21:27: 134 1 0
06/05/11 08:21:27: 13 520 1240556
06/05/11 08:21:27: 6 1 0
06/05/11 08:21:27: 7 0 0
06/05/11 08:21:27: 134 0 0
06/05/11 08:21:27: 13 520 1240556
06/05/11 08:21:27: 6 0 0
06/05/11 08:21:27: 28 0 3744
06/05/11 08:21:27: 8 0 0
06/05/11 08:21:28: 26 24 1244224
06/05/11 08:21:28: 70 0 1244204
06/05/11 08:21:28: 71 0 1244204
06/05/11 08:21:28: 13 520 1241056
06/05/11 08:21:28: 28 1 3744
06/05/11 08:21:28: 134 1 0
06/05/11 08:21:28: 13 520 1240556
06/05/11 08:21:28: 6 1 0
06/05/11 08:21:28: 7 0 0
06/05/11 08:21:30: 49713 16777216 270
06/05/11 08:21:30: 49510 0 0
06/05/11 08:21:31: 70 0 1244204
06/05/11 08:21:31: 36 0 1243288
06/05/11 08:21:31: 71 0 1244204
06/05/11 08:21:31: 3 0 6029336
06/05/11 08:21:31: 13 520 1241056
06/05/11 08:21:31: 136 32 0
06/05/11 08:21:31: 133 1 0
06/05/11 08:21:31: 13 520 1239680
06/05/11 08:21:31: 20 33620049 0
06/05/11 08:21:31: 15 0 0
06/05/11 08:21:32: 126 32 83886880
06/05/11 08:21:32: 15 0 0
06/05/11 08:21:32: 133 1 0
06/05/11 08:21:32: 13 520 1239268
06/05/11 08:21:32: 20 33620047 0
06/05/11 08:21:32: 134 0 0
06/05/11 08:21:32: 13 520 1240556
06/05/11 08:21:32: 6 0 0
06/05/11 08:21:32: 28 0 3744
06/05/11 08:21:32: 8 0 0
06/05/11 08:21:32: 70 0 1244204
06/05/11 08:21:32: 71 0 1244204
06/05/11 08:21:32: 13 520 1241056
06/05/11 08:21:32: 28 1 3744
06/05/11 08:21:32: 134 0 0
06/05/11 08:21:32: 13 520 1240556
06/05/11 08:21:32: 6 1 0
06/05/11 08:21:32: 7 0 0
06/05/11 08:21:32: 134 0 0
06/05/11 08:21:32: 13 520 1240556
06/05/11 08:21:32: 6 0 0
06/05/11 08:21:32: 28 0 3744
06/05/11 08:21:32: 8 0 0
06/05/11 08:21:32: 26 24 1244224
06/05/11 08:21:33: 70 0 1244204
06/05/11 08:21:33: 71 0 1244204
06/05/11 08:21:33: 13 520 1241056
06/05/11 08:21:33: 28 1 3744
06/05/11 08:21:33: 134 1 0
06/05/11 08:21:33: 13 520 1240556
06/05/11 08:21:33: 6 1 0
06/05/11 08:21:33: 7 0 0
06/05/11 08:21:34: 49713 16777216 0
06/05/11 08:21:34: 49510 0 0
06/05/11 08:21:36: 70 0 1244204
06/05/11 08:21:36: 36 0 1243288
06/05/11 08:21:36: 71 0 1244204
06/05/11 08:21:36: 3 0 4784159
06/05/11 08:21:36: 13 520 1241056
06/05/11 08:21:36: 136 32 0
06/05/11 08:21:36: 133 1 0
06/05/11 08:21:36: 13 520 1239680
06/05/11 08:21:36: 20 318836835 0
06/05/11 08:21:36: 15 0 0
06/05/11 08:21:36: 126 32 52430080
06/05/11 08:21:36: 15 0 0
06/05/11 08:21:36: 133 1 0
06/05/11 08:21:36: 13 520 1239268
06/05/11 08:21:36: 20 33620047 0
06/05/11 08:21:37: 134 0 0
06/05/11 08:21:37: 13 520 1240556
06/05/11 08:21:37: 6 0 0
06/05/11 08:21:37: 28 0 3744
06/05/11 08:21:37: 8 0 0
06/05/11 08:21:37: 70 0 1244204
06/05/11 08:21:37: 71 0 1244204
06/05/11 08:21:37: 13 520 1241056
06/05/11 08:21:37: 28 1 3744
06/05/11 08:21:37: 134 0 0
06/05/11 08:21:37: 13 520 1240556
06/05/11 08:21:37: 6 1 0
06/05/11 08:21:37: 7 0 0
06/05/11 08:21:37: 134 0 0
06/05/11 08:21:37: 13 520 1240556
06/05/11 08:21:37: 6 0 0
06/05/11 08:21:37: 28 0 3744
06/05/11 08:21:37: 8 0 0
06/05/11 08:21:37: 70 0 1244204
06/05/11 08:21:37: 71 0 1244204
06/05/11 08:21:37: 13 520 1241056
06/05/11 08:21:37: 28 1 3744
06/05/11 08:21:37: 134 1 0
06/05/11 08:21:37: 13 520 1240556
06/05/11 08:21:37: 6 1 0
06/05/11 08:21:37: 7 0 0
06/05/11 08:21:37: 26 24 1244224
06/05/11 08:21:38: 49713 16777216 270
06/05/11 08:21:38: 49510 0 0
06/05/11 08:21:40: 70 0 1244204
06/05/11 08:21:40: 36 0 1243288
06/05/11 08:21:40: 71 0 1244204
06/05/11 08:21:40: 3 0 6094873
06/05/11 08:21:40: 13 520 1241056
06/05/11 08:21:40: 136 32 0
06/05/11 08:21:40: 133 1 0
06/05/11 08:21:40: 13 520 1239680
06/05/11 08:21:40: 20 33620030 0
06/05/11 08:21:40: 15 0 0
06/05/11 08:21:40: 126 32 83886880
06/05/11 08:21:40: 15 0 0
06/05/11 08:21:40: 133 1 0
06/05/11 08:21:40: 13 520 1239268
06/05/11 08:21:40: 20 33623066 0
06/05/11 08:21:41: 134 0 0
06/05/11 08:21:41: 13 520 1240556
06/05/11 08:21:41: 6 0 0
06/05/11 08:21:41: 28 0 3744
06/05/11 08:21:41: 8 0 0
06/05/11 08:21:41: 70 0 1244204
06/05/11 08:21:41: 71 0 1244204
06/05/11 08:21:41: 13 520 1241056
06/05/11 08:21:41: 28 1 3744
06/05/11 08:21:41: 134 0 0
06/05/11 08:21:41: 13 520 1240556
06/05/11 08:21:41: 6 1 0
06/05/11 08:21:41: 7 0 0
06/05/11 08:21:41: 134 0 0
06/05/11 08:21:41: 13 520 1240556
06/05/11 08:21:41: 6 0 0
06/05/11 08:21:41: 28 0 3744
06/05/11 08:21:41: 8 0 0
06/05/11 08:21:41: 70 0 1244204
06/05/11 08:21:41: 71 0 1244204
06/05/11 08:21:41: 13 520 1241056
06/05/11 08:21:41: 28 1 3744
06/05/11 08:21:41: 134 1 0
06/05/11 08:21:41: 13 520 1240556
06/05/11 08:21:41: 6 1 0
06/05/11 08:21:41: 7 0 0
06/05/11 08:21:41: 26 24 1244224
06/05/11 08:21:43: 49713 16777216 0
06/05/11 08:21:43: 49510 0 0
06/05/11 08:21:45: 70 0 1244204
06/05/11 08:21:45: 36 0 1243288
06/05/11 08:21:45: 71 0 1244204
06/05/11 08:21:45: 3 0 4849697
06/05/11 08:21:45: 13 520 1241056
06/05/11 08:21:45: 136 32 0
06/05/11 08:21:45: 133 1 0
06/05/11 08:21:45: 13 520 1239680
06/05/11 08:21:45: 20 33623066 0
06/05/11 08:21:45: 15 0 0
06/05/11 08:21:45: 126 32 52430080
06/05/11 08:21:45: 15 0 0
06/05/11 08:21:45: 133 1 0
06/05/11 08:21:45: 13 520 1239268
06/05/11 08:21:45: 20 33620032 0
06/05/11 08:21:45: 134 0 0
06/05/11 08:21:45: 13 520 1240556
06/05/11 08:21:45: 6 0 0
06/05/11 08:21:45: 28 0 3744
06/05/11 08:21:45: 8 0 0
06/05/11 08:21:46: 70 0 1244204
06/05/11 08:21:46: 71 0 1244204
06/05/11 08:21:46: 13 520 1241056
06/05/11 08:21:46: 28 1 3744
06/05/11 08:21:46: 134 0 0
06/05/11 08:21:46: 13 520 1240556
06/05/11 08:21:46: 6 1 0
06/05/11 08:21:46: 7 0 0
06/05/11 08:21:46: 134 0 0
06/05/11 08:21:46: 13 520 1240556
06/05/11 08:21:46: 6 0 0
06/05/11 08:21:46: 28 0 3744
06/05/11 08:21:46: 8 0 0
06/05/11 08:21:46: 26 24 1244224
06/05/11 08:21:46: 70 0 1244204
06/05/11 08:21:46: 71 0 1244204
06/05/11 08:21:46: 13 520 1241056
06/05/11 08:21:46: 28 1 3744
06/05/11 08:21:46: 134 1 0
06/05/11 08:21:46: 13 520 1240556
06/05/11 08:21:46: 6 1 0
06/05/11 08:21:46: 7 0 0
06/05/11 08:21:48: 49713 16777216 270
06/05/11 08:21:48: 49510 0 0
06/05/11 08:21:49: 70 0 1244204
06/05/11 08:21:49: 36 0 1243288
06/05/11 08:21:49: 71 0 1244204
06/05/11 08:21:49: 3 0 6225946
06/05/11 08:21:49: 13 520 1241056
06/05/11 08:21:49: 136 32 0
06/05/11 08:21:49: 133 1 0
06/05/11 08:21:49: 13 520 1239680
06/05/11 08:21:49: 20 16846678 0
06/05/11 08:21:49: 15 0 0
06/05/11 08:21:50: 126 32 83886880
06/05/11 08:21:50: 134 0 0
06/05/11 08:21:50: 13 520 1240556
06/05/11 08:21:50: 6 0 0
06/05/11 08:21:50: 28 0 3744
06/05/11 08:21:50: 8 0 0
06/05/11 08:21:50: 70 0 1244204
06/05/11 08:21:50: 71 0 1244204
06/05/11 08:21:50: 13 520 1241056
06/05/11 08:21:50: 28 1 3744
06/05/11 08:21:50: 134 0 0
06/05/11 08:21:50: 13 520 1240556
06/05/11 08:21:50: 6 1 0
06/05/11 08:21:50: 7 0 0
06/05/11 08:21:50: 134 0 0
06/05/11 08:21:50: 13 520 1240556
06/05/11 08:21:50: 6 0 0
06/05/11 08:21:50: 28 0 3744
06/05/11 08:21:50: 8 0 0
06/05/11 08:21:50: 15 0 0
06/05/11 08:21:50: 133 1 0
06/05/11 08:21:50: 13 520 1239268
06/05/11 08:21:50: 20 16846678 0
06/05/11 08:21:50: 70 0 1244204
06/05/11 08:21:50: 71 0 1244204
06/05/11 08:21:50: 13 520 1241056
06/05/11 08:21:50: 28 1 3744
06/05/11 08:21:50: 134 1 0
06/05/11 08:21:50: 13 520 1240556
06/05/11 08:21:50: 6 1 0
06/05/11 08:21:50: 7 0 0
06/05/11 08:21:50: 26 24 1244224
06/05/11 08:21:52: 49713 16777216 0
06/05/11 08:21:52: 49510 0 0
06/05/11 08:21:53: 70 0 1244204
06/05/11 08:21:53: 36 0 1243288
06/05/11 08:21:53: 71 0 1244204
06/05/11 08:21:53: 3 0 4915234
06/05/11 08:21:53: 13 520 1241056
06/05/11 08:21:53: 136 32 0
06/05/11 08:21:53: 133 1 0
06/05/11 08:21:53: 13 520 1239680
06/05/11 08:21:53: 20 16846678 0
06/05/11 08:21:53: 15 0 0
06/05/11 08:21:53: 126 32 52430080
06/05/11 08:21:54: 15 0 0
06/05/11 08:21:54: 133 1 0
06/05/11 08:21:54: 13 520 1239268
06/05/11 08:21:54: 20 33620049 0
06/05/11 08:21:54: 134 0 0
06/05/11 08:21:54: 13 520 1240556
06/05/11 08:21:54: 6 0 0
06/05/11 08:21:54: 28 0 3744
06/05/11 08:21:54: 8 0 0
06/05/11 08:21:54: 70 0 1244204
06/05/11 08:21:54: 71 0 1244204
06/05/11 08:21:54: 13 520 1241056
06/05/11 08:21:54: 28 1 3744
06/05/11 08:21:54: 134 0 0
06/05/11 08:21:54: 13 520 1240556
06/05/11 08:21:54: 6 1 0
06/05/11 08:21:54: 7 0 0
06/05/11 08:21:54: 134 0 0
06/05/11 08:21:54: 13 520 1240556
06/05/11 08:21:54: 6 0 0
06/05/11 08:21:54: 28 0 3744
06/05/11 08:21:54: 8 0 0
06/05/11 08:21:54: 70 0 1244204
06/05/11 08:21:54: 71 0 1244204
06/05/11 08:21:54: 13 520 1241056
06/05/11 08:21:54: 28 1 3744
06/05/11 08:21:54: 134 1 0
06/05/11 08:21:54: 13 520 1240556
06/05/11 08:21:54: 6 1 0
06/05/11 08:21:54: 7 0 0
06/05/11 08:21:55: 26 24 1244224
06/05/11 08:21:56: 49713 16777216 270
06/05/11 08:21:56: 49510 0 0
06/05/11 08:21:57: 70 0 1244204
06/05/11 08:21:57: 36 0 1243288
06/05/11 08:21:57: 71 0 1244204
06/05/11 08:21:57: 3 0 6357019
06/05/11 08:21:57: 13 520 1241056
06/05/11 08:21:57: 136 32 0
06/05/11 08:21:57: 133 1 0
06/05/11 08:21:57: 13 520 1239680
06/05/11 08:21:57: 20 67174482 0
06/05/11 08:21:57: 15 0 0
06/05/11 08:21:58: 126 32 83886880
06/05/11 08:21:58: 15 0 0
06/05/11 08:21:58: 133 1 0
06/05/11 08:21:58: 13 520 1239268
06/05/11 08:21:58: 20 33620032 0
06/05/11 08:21:58: 134 0 0
06/05/11 08:21:58: 13 520 1240556
06/05/11 08:21:58: 6 0 0
06/05/11 08:21:58: 28 0 3744
06/05/11 08:21:58: 8 0 0
06/05/11 08:21:58: 70 0 1244204
06/05/11 08:21:58: 71 0 1244204
06/05/11 08:21:58: 13 520 1241056
06/05/11 08:21:58: 28 1 3744
06/05/11 08:21:58: 134 0 0
06/05/11 08:21:58: 13 520 1240556
06/05/11 08:21:58: 6 1 0
06/05/11 08:21:58: 7 0 0
06/05/11 08:21:58: 134 0 0
06/05/11 08:21:58: 13 520 1240556
06/05/11 08:21:58: 6 0 0
06/05/11 08:21:58: 28 0 3744
06/05/11 08:21:58: 8 0 0
06/05/11 08:21:59: 26 24 1244224
06/05/11 08:21:59: 70 0 1244204
06/05/11 08:21:59: 71 0 1244204
06/05/11 08:21:59: 13 520 1241056
06/05/11 08:21:59: 28 1 3744
06/05/11 08:21:59: 134 1 0
06/05/11 08:21:59: 13 520 1240556
06/05/11 08:21:59: 6 1 0
06/05/11 08:21:59: 7 0 0
06/05/11 08:22:01: 49713 16777216 0
06/05/11 08:22:01: 49510 0 0
06/05/11 08:22:02: 70 0 1244204
06/05/11 08:22:02: 36 0 1243288
06/05/11 08:22:02: 71 0 1244204
06/05/11 08:22:02: 3 0 4980772
06/05/11 08:22:02: 13 520 1241056
06/05/11 08:22:02: 136 32 0
06/05/11 08:22:02: 133 1 0
06/05/11 08:22:02: 13 520 1239680
06/05/11 08:22:02: 20 16846678 0
06/05/11 08:22:02: 15 0 0
06/05/11 08:22:02: 126 32 52430080
06/05/11 08:22:02: 15 0 0
06/05/11 08:22:02: 133 1 0
06/05/11 08:22:02: 13 520 1239268
06/05/11 08:22:02: 20 67174482 0
06/05/11 08:22:03: 134 0 0
06/05/11 08:22:03: 13 520 1240556
06/05/11 08:22:03: 6 0 0
06/05/11 08:22:03: 28 0 3744
06/05/11 08:22:03: 8 0 0
06/05/11 08:22:03: 70 0 1244204
06/05/11 08:22:03: 71 0 1244204
06/05/11 08:22:03: 13 520 1241056
06/05/11 08:22:03: 28 1 3744
06/05/11 08:22:03: 134 0 0
06/05/11 08:22:03: 13 520 1240556
06/05/11 08:22:03: 6 1 0
06/05/11 08:22:03: 7 0 0
06/05/11 08:22:03: 134 0 0
06/05/11 08:22:03: 13 520 1240556
06/05/11 08:22:03: 6 0 0
06/05/11 08:22:03: 28 0 3744
06/05/11 08:22:03: 8 0 0
06/05/11 08:22:03: 26 24 1244224
06/05/11 08:22:04: 70 0 1244204
06/05/11 08:22:04: 71 0 1244204
06/05/11 08:22:04: 13 520 1241056
06/05/11 08:22:04: 28 1 3744
06/05/11 08:22:04: 134 1 0
06/05/11 08:22:04: 13 520 1240556
06/05/11 08:22:04: 6 1 0
06/05/11 08:22:04: 7 0 0
06/05/11 08:22:06: 134 0 0
06/05/11 08:22:06: 13 520 1240556
06/05/11 08:22:06: 6 0 0
06/05/11 08:22:06: 28 0 3488
06/05/11 08:22:06: 8 0 0
06/05/11 08:22:10: 49713 16777216 270
06/05/11 08:22:10: 49510 0 0
06/05/11 08:22:11: 70 0 1244204
06/05/11 08:22:11: 36 0 1243288
06/05/11 08:22:11: 71 0 1244204
06/05/11 08:22:11: 3 0 6422556
06/05/11 08:22:11: 13 520 1241056
06/05/11 08:22:11: 136 32 0
06/05/11 08:22:11: 133 1 0
06/05/11 08:22:11: 13 520 1239680
06/05/11 08:22:11: 20 33623066 0
06/05/11 08:22:11: 15 0 0
06/05/11 08:22:11: 126 32 83886880
06/05/11 08:22:11: 15 0 0
06/05/11 08:22:11: 133 1 0
06/05/11 08:22:11: 13 520 1239268
06/05/11 08:22:11: 20 33620030 0
06/05/11 08:22:11: 49713 16777216 0
06/05/11 08:22:12: 49510 0 0
06/05/11 08:22:12: 26 24 1244224
06/05/11 08:22:14: 70 0 1244204
06/05/11 08:22:14: 36 0 1243288
06/05/11 08:22:14: 71 0 1244204
06/05/11 08:22:14: 3 0 5046310
06/05/11 08:22:14: 13 520 1241056
06/05/11 08:22:14: 136 32 0
06/05/11 08:22:14: 133 1 0
06/05/11 08:22:14: 13 520 1239680
06/05/11 08:22:14: 20 67174482 0
06/05/11 08:22:14: 15 0 0
06/05/11 08:22:15: 126 32 52430080
06/05/11 08:22:15: 15 0 0
06/05/11 08:22:15: 133 1 0
06/05/11 08:22:15: 13 520 1239268
06/05/11 08:22:15: 20 33620030 0
06/05/11 08:22:15: 136 4 0
06/05/11 08:22:15: 26 24 1244224
06/05/11 08:22:22: 537 7 0
06/05/11 08:22:23: 537 7 0
06/05/11 08:22:23: 537 7 0
06/05/11 08:22:23: 537 32768 1244220
06/05/11 08:22:24: 537 7 0
06/05/11 08:22:24: 537 7 0
06/05/11 08:22:24: 537 7 0
06/05/11 08:22:24: 537 7 0
06/05/11 08:22:25: 537 7 0
06/05/11 08:22:29: 136 32 0
06/05/11 08:22:29: 133 1 0
06/05/11 08:22:29: 13 520 1239680
06/05/11 08:22:29: 20 33620030 0
06/05/11 08:22:29: 15 0 0
06/05/11 08:22:29: 49743 0 0
06/05/11 08:22:36: 537 7 0
06/05/11 08:22:36: 537 7 0 |
Changing with and height of a window and a dialog | Massimo,
Yes, once we know which one is the rotate event then we can do what we want <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Changing with and height of a window and a dialog | Great.
Is there a reference table about the numbers that the logfile function is creating ?
I saw that there are always 3 numbers after the time but I don't know what they mean. |
Changing with and height of a window and a dialog | Massimo,
The first value is the Windows msg sent to the window, the other two values are the supplied parameters (nWParam, nLParam). The msg value has to be converted into hexadecimal and then you can look for it inside windows.h
I think that 49713 value may be related to the rotate event. Please try this:
[code=fw:444hee2b]<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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd := TMyWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br /> CLASSDATA lRegistered<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br /> LogFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"events.log"</span>, <span style="color: #000000;">{</span> nMsg, nWParam, nLParam <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> nMsg == <span style="color: #000000;">49713</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"rotate"</span>, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /> </div>[/code:444hee2b] |
Changing with and height of a window and a dialog | Yes, it is working.
Now I have to find a way of changing the resolution of the open window and dialog with all the controls inside.
Thanks a lot.
Massimo. |
Changing with and height of a window and a dialog | I found that the Rotate event is 126
I modified dialog.prg so I could do the following in my program.
oDlg:bRotate := { || msginfo( 'Rotate '+alltrim(str(ScreenWidth(),5))+'x'+alltrim(str(ScreenHeight(),5)))}
With windows 7 the width and height vary with rotation and whether the on screen keyboard is displayed and docked. So there could be 4 different width/height values when using Windows 7.
With Windows 10 the width and height vary with screen rotation but does not change when on screen keyboard is displayed so there are only 2 different values.
To test I modified dialog.prg with something like
#define GF_ROTATE 126
....
// Added to Class
DATA bRotate
....
// Added to HandleEvent
case nMsg == GF_ROTATE
if ValType( ::bRotate ) == "B"
eval( ::bRotate )
endif
return ::Super:HandleEvent( nMsg, nWParam, nLParam ) |
Changing with and height of a window and a dialog | Actually there is an event define
WM_DISPLAYCHANGE = 126
I found the information here: [url:2k6n76qz]https://msdn.microsoft.com/en-us/library/ms812142.aspx[/url:2k6n76qz] |
Changing with and height of a window and a dialog | Gale,
Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Changing with and height of a window and a dialog | Antonio,
Does the latest version of FW handle screen rotation? If not do you think something like ::bRotate or ::bOnRotate can be added to native Window class.
I am working more and more with Tablets and Convertibles. |
Changing with and height of a window and a dialog | Gale,
As a first idea I think that we could use FWH functions ScreenWidth() and ScreenHeight() and a timer to control rotation.
I am thinking how to avoid the use of the timer... |
Changing with and height of a window and a dialog | Gale,
Could you try this example and rotate the tablet ?
Please let me know if it beeps when you rotate it, thanks
[code=fw:3nxhtysb]<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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <br /> oWnd:<span style="color: #000000;">bResized</span> = <span style="color: #000000;">{</span> || MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3nxhtysb] |
Changing with and height of a window and a dialog | i will try it later. just thinking about it, if you want to try it without adding to handleevent then it might be better on paint. i am not sure the dialog/window size changes unless keyboard is visible and sometimes not even then. Windows 7 keyboard undocked does not resize dialog or screen. |
Changing with and height of a window and a dialog | Gale,
Then you may change in my example:
oWnd:bPainted = { || MsgBeep() }
thanks |
Changing with and height of a window and a dialog | bPainted does get called when you rotate display. bResized does not get called.
I cannot get accurate screen sizes when I use bPainted. screenwidth() and screenheight() are not always correct. Maybe it has something to do with buffer/dispbegin().
One of the things I need to do when screen is rotated is change the dialog/window position and size. This also affects bPainted.
If i modify tDialog with bOnRotate and I check screenwidth() and screenheight() in bOnRotate it returns correct sizes. |
Changing with and height of a window and a dialog | We know we can easily ascertain Protrait / Landscape mode by comparing ScreenWidth() and ScreenHeight(). If the application window is maximized on Tablet, rotation restults in Resize event and our normal ON RESIZE can react to the change. Whether the window is maximized or not, rotation defintely generates WM_DISPLAYCHANGE message. We can respond to that message.
There is another change we need to know and respond. In Windows 10, whether on Desktop or Tablet, user can toggle between Desktop and Tablet mode. When the user switches from DeskTop to Tablet mode, normal window automatically gets maximized (generates resize event) and we may need to consider switching to Universal App look in this case and vice versa. This toggle generates WM_SETTINGCHANGE message. In response to this message, we need to ascertain whether the pc/tablet is in Desktop mode or Tablet mode. In other words, we can be in Desktop mode on a Tablet and Tablet Mode on Desktop.
We can find this from the registry entry HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell\TabletMode". If the value is 1, then TabletMode is true. But the problem is it takes around one or two seconds for this entry to be updated after we receive the WM_SETTINGCHANGE message. So we need to query this value after a slight delay.
Here is a sample program which responds to rotation and also change in desktop/tablet mode (in case of windows 10 only). Incidentally, this program also detects presence of Touch screen and Mouse.
[code=fw:k1hgvuwc]<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: #00D7D7;">#define</span> SM_TABLETPC <span style="color: #000000;">86</span><br /><span style="color: #00D7D7;">#define</span> WM_DISPLAYCHANGE 0x007E<br /><span style="color: #00D7D7;">#define</span> WM_SETTINGCHANGE WM_WININICHANGE<br />#ifndef SM_DIGITIZER<br /><span style="color: #00D7D7;">#define</span> SM_DIGITIZER <span style="color: #000000;">94</span><br />#endif<br /><span style="color: #00D7D7;">#define</span> SM_CMOUSEBUTTONS <span style="color: #000000;">43</span><br /><br /><span style="color: #00C800;">static</span> cMsg := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">static</span> oTimer<br /><span style="color: #00C800;">static</span> cLog<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <span style="color: #00C800;">local</span> oFont<br /><br /> cLog := cFileSetExt<span style="color: #000000;">(</span> ExeName<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"log"</span> <span style="color: #000000;">)</span><br /> FErase<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-30</span><br /><br /> oWnd := TMyWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> || oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">bOnDisplayChange</span> := <span style="color: #000000;">{</span> || oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">bOnSettingChange</span> := <span style="color: #000000;">{</span> || WaitRefresh<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> oWnd:<span style="color: #000000;">SayText</span><span style="color: #000000;">(</span> cMsg := DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span>, , , oFont <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ON</span> RESIZE <span style="color: #000000;">(</span> oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> <span style="color: #00C800;">if</span> oTimer != <span style="color: #00C800;">nil</span><br /> oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> WinExec<span style="color: #000000;">(</span> <span style="color: #ff0000;">"notepad.exe "</span> + cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitRefresh<span style="color: #000000;">(</span> ownd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n > <span style="color: #000000;">4</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lPortrait := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> < ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTabletMode := IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTouch := <span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_DIGITIZER <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> cMsg := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTabletMode, <span style="color: #ff0000;">"TABLET MODE"</span>, <span style="color: #ff0000;">"DESKTOP MODE"</span> <span style="color: #000000;">)</span> + CRLF, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> cMsg += <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lPortrait, <span style="color: #ff0000;">"POTRAIT"</span>, <span style="color: #ff0000;">"LANDSCAPE"</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsZoomed<span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"MAXIMIZED"</span>, <span style="color: #ff0000;">"NORMAL"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" WINDOW"</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTouch, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"NO "</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"TOUCH INPUT"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"MOUSE"</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_CMOUSEBUTTONS <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">" NOT"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" PRESENT"</span><br /><br /><span style="color: #00C800;">return</span> cMsg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br /> CLASSDATA lRegistered<br /><br /> <span style="color: #00C800;">DATA</span> bOnDisplayChange<br /> <span style="color: #00C800;">DATA</span> bOnSettingChange<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br /> <span style="color: #00C800;">case</span> nMsg == WM_DISPLAYCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">case</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. nMsg == WM_SETTINGCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:k1hgvuwc]
Tested on Windows 10 Desktops (touch and without touch screen) and Windows 10 Tablet.
[url=https://imageshack.com/i/pbymqlMKj:k1hgvuwc][img:k1hgvuwc]http://imagizer.imageshack.us/v2/xq90/911/ymqlMK.jpg[/img:k1hgvuwc][/url:k1hgvuwc] |
Changing with and height of a window and a dialog | Is the function IsTabletMode() in later vesrion of FWH? |
Changing with and height of a window and a dialog | [quote="Gale FORd":21xtto1b]Is the function IsTabletMode() in later vesrion of FWH?[/quote:21xtto1b]
Yes.
This is the source code:
[code=fw:21xtto1b]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">local</span> oReg, lTabletMode := .f.<br /><br /> <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oReg:= TReg32<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> HKEY_CURRENT_USER, <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows<span style="color: #000000;">\C</span>urrentVersion<span style="color: #000000;">\I</span>mmersiveShell"</span> <span style="color: #000000;">)</span><br /> lTabletMode := <span style="color: #000000;">(</span> oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TabletMode"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lTabletMode<br /> </div>[/code:21xtto1b] |
Changing with and height of a window and a dialog | Thank you for your help.
I still have some small issue. One of the reasons I need this is to change the dialog size and re-position some controls. Without a timer in bOnDisplayChange the ScreenWidth() and ScreenHeight() are not always correct if the on-screen keyboard is displayed.
If the on-screen keyboard is not displayed then it seems to work ok.
I modified your code and added lUseWait and some resize code. If you left click mouse or touch with finger it swaps lUseWait.
With lUseWait = .T. the ScreenWidh() and ScreenHeight() works correctly. With lUseWait = .f. it is not always correct with on-screen keyboard visible .
I am using a Panasonic Toughpad FZ-G1 with Windows 7 and a Microsoft Surface Pro 3 with Windows 10.
[code=fw:cvrwr2zl]<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: #00D7D7;">#define</span> SM_TABLETPC <span style="color: #000000;">86</span><br /><span style="color: #00D7D7;">#define</span> WM_DISPLAYCHANGE 0x007E<br /><span style="color: #00D7D7;">#define</span> WM_SETTINGCHANGE WM_WININICHANGE<br />#ifndef SM_DIGITIZER<br /><span style="color: #00D7D7;">#define</span> SM_DIGITIZER <span style="color: #000000;">94</span><br />#endif<br /><span style="color: #00D7D7;">#define</span> SM_CMOUSEBUTTONS <span style="color: #000000;">43</span><br /><br /><span style="color: #00C800;">static</span> cMsg := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">static</span> oTimer<br /><span style="color: #00C800;">static</span> cLog<br /><span style="color: #00C800;">static</span> lUseWait<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <span style="color: #00C800;">local</span> oFont<br /><br /> lUseWait := .t.<br /><br /> cLog := cFileSetExt<span style="color: #000000;">(</span> ExeName<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"log"</span> <span style="color: #000000;">)</span><br /> FErase<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-30</span><br /><br /> oWnd := TMyWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> || oWnd:<span style="color: #0000ff;">Refresh</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">blClicked</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span> lUseWait := !luseWait, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">bOnDisplayChange</span> := <span style="color: #000000;">{</span> || WaitReSize<span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">'DispChange'</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">//oWnd:bOnDisplayChange := { || oWnd:Refresh(), 0 }</span><br /> oWnd:<span style="color: #000000;">bOnSettingChange</span> := <span style="color: #000000;">{</span> || WaitRefresh<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">INIT</span> WaitReSize<span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">'Init'</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> oWnd:<span style="color: #000000;">SayText</span><span style="color: #000000;">(</span> cMsg := DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span>, , , oFont <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ON</span> RESIZE <span style="color: #000000;">(</span> oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> <span style="color: #00C800;">if</span> oTimer != <span style="color: #00C800;">nil</span><br /> oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> WinExec<span style="color: #000000;">(</span> <span style="color: #ff0000;">"notepad.exe "</span> + cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitRefresh<span style="color: #000000;">(</span> ownd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /> TraceSize<span style="color: #000000;">(</span> <span style="color: #ff0000;">'WaitRefresh'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n > <span style="color: #000000;">4</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitResize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> lUseWait<br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer ;<br /> <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> n = <span style="color: #000000;">1</span>, ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oTimer:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nTop, nLeft, nWidth, nHeight<br /> <span style="color: #B900B9;">//sysrefresh()</span><br /> TraceSize<span style="color: #000000;">(</span> cAction <span style="color: #000000;">)</span><br /> nTop := <span style="color: #000000;">40</span><br /> nLeft := <span style="color: #000000;">40</span><br /> nWidth := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nLeft*<span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> nHeight := ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nTop*<span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nTop, nLeft, nWidth, nHeight <span style="color: #000000;">)</span><br /> oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> TraceSize<span style="color: #000000;">(</span> cAction <span style="color: #000000;">)</span><br /> tracelog<span style="color: #000000;">(</span> cAction, lUseWait, ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> < ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lPortrait := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> < ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTabletMode := IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTouch := <span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_DIGITIZER <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> cMsg := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTabletMode, <span style="color: #ff0000;">"TABLET MODE"</span>, <span style="color: #ff0000;">"DESKTOP MODE"</span> <span style="color: #000000;">)</span> + CRLF, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> cMsg += <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lPortrait, <span style="color: #ff0000;">"POTRAIT"</span>, <span style="color: #ff0000;">"LANDSCAPE"</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsZoomed<span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"MAXIMIZED"</span>, <span style="color: #ff0000;">"NORMAL"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" WINDOW"</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTouch, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"NO "</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"TOUCH INPUT"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"MOUSE"</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_CMOUSEBUTTONS <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">" NOT"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" PRESENT"</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUseWait, <span style="color: #ff0000;">"USE WAIT"</span>, <span style="color: #ff0000;">"NO WAIT"</span> <span style="color: #000000;">)</span> + CRLF<br /><br /><span style="color: #00C800;">return</span> cMsg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br /> CLASSDATA lRegistered<br /><br /> <span style="color: #00C800;">DATA</span> bOnDisplayChange<br /> <span style="color: #00C800;">DATA</span> bOnSettingChange<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br /> <span style="color: #00C800;">case</span> nMsg == WM_DISPLAYCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">case</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. nMsg == WM_SETTINGCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00D7D7;">#define</span> HKEY_CURRENT_USER <span style="color: #000000;">2147483649</span><br /><br /><span style="color: #00C800;">function</span> IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oReg, lTabletMode := .f.<br /> <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oReg:= TReg32<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> HKEY_CURRENT_USER, <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows<span style="color: #000000;">\C</span>urrentVersion<span style="color: #000000;">\I</span>mmersiveShell"</span> <span style="color: #000000;">)</span><br /> lTabletMode := <span style="color: #000000;">(</span> oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TabletMode"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> lTabletMode<br /><br /><span style="color: #00D7D7;">#define</span> HKEY_LOCAL_MACHINE <span style="color: #000000;">2147483650</span> <span style="color: #B900B9;">// 0x80000002</span><br /><br /><span style="color: #00C800;">function</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oReg := TReg32<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> HKEY_LOCAL_MACHINE,;<br /> <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows NT<span style="color: #000000;">\C</span>urrentVersion"</span>,;<br /> .f. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cProductName := oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ProductName"</span> <span style="color: #000000;">)</span><br /> oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Windows 10"</span> $ cProductName<br /> </div>[/code:cvrwr2zl] |
Changing with and height of a window and a dialog | Here is another issue. With Windows 10 the On Screen Keyboard does not adjust screenheight(). So it makes no difference if the keyboard is visible or not. You have to know whether the on screen keyboard is visible in order to make a correct window size. The only way I have found to check it is to use IsWindowEnabled(). Any other way does not work with Windows 10 because it is always running and the position is still withing the window.
With Windows 7, screenheight() does get adjusted if keyboard is visable. So I think something like below will work for Windows 10 and Windows 7. I think Windows 8 will work like windows 10 but have not tried it.
[code=fw:38zj1rao]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// To Check if Keyboard on Screen</span><br /> <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .or. IsWin8<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> lReturn := IsWindowEnabled<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> lReturn := IsWindowVisible<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #B900B9;">// To get the correct screen height. IsKeyBoardVisible() is a function that contains code above. See full examples in code at end of this post.</span><br /> <span style="color: #00C800;">if</span> IsKeyboardVisible<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. <span style="color: #000000;">(</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .or. IsWin8<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> hWndInputPanel := FindWindow<span style="color: #000000;">(</span><span style="color: #ff0000;">"IPTip_Main_Window"</span><span style="color: #000000;">)</span><br /> aCoord := GetWndRect<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> nHeight := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">else</span><br /> nHeight := ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:38zj1rao]
So a complete working example that seems to work under Windows 7 and Windows 10 that adjusts window size when tablet is rotated.
You can test the affect the wait has with on screen keyboard by pressing or clicking on the window to toggle wait timer.
[code=fw:38zj1rao]<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: #00D7D7;">#define</span> SM_TABLETPC <span style="color: #000000;">86</span><br /><span style="color: #00D7D7;">#define</span> WM_DISPLAYCHANGE 0x007E<br /><span style="color: #00D7D7;">#define</span> WM_SETTINGCHANGE WM_WININICHANGE<br />#ifndef SM_DIGITIZER<br /><span style="color: #00D7D7;">#define</span> SM_DIGITIZER <span style="color: #000000;">94</span><br />#endif<br /><span style="color: #00D7D7;">#define</span> SM_CMOUSEBUTTONS <span style="color: #000000;">43</span><br /><br /><span style="color: #00C800;">static</span> cMsg := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">static</span> oTimer<br /><span style="color: #00C800;">static</span> cLog<br /><span style="color: #00C800;">static</span> lUseWait<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd<br /> <span style="color: #00C800;">local</span> oFont<br /><br /> lUseWait := .t.<br /><br /> cLog := cFileSetExt<span style="color: #000000;">(</span> ExeName<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">"log"</span> <span style="color: #000000;">)</span><br /> FErase<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-30</span><br /><br /> oWnd := TMyWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> || oWnd:<span style="color: #0000ff;">Refresh</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">blClicked</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span> lUseWait := !luseWait, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oWnd:<span style="color: #000000;">bOnDisplayChange</span> := <span style="color: #000000;">{</span> || WaitReSize<span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">'DispChange'</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">//oWnd:bOnDisplayChange := { || oWnd:Refresh(), 0 }</span><br /> oWnd:<span style="color: #000000;">bOnSettingChange</span> := <span style="color: #000000;">{</span> || WaitRefresh<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">INIT</span> WaitReSize<span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">'Init'</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> oWnd:<span style="color: #000000;">SayText</span><span style="color: #000000;">(</span> cMsg := DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span>, , , oFont <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">ON</span> RESIZE <span style="color: #000000;">(</span> oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> <span style="color: #00C800;">if</span> oTimer != <span style="color: #00C800;">nil</span><br /> oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> WinExec<span style="color: #000000;">(</span> <span style="color: #ff0000;">"notepad.exe "</span> + cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitRefresh<span style="color: #000000;">(</span> ownd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /> TraceSize<span style="color: #000000;">(</span> <span style="color: #ff0000;">'WaitRefresh'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n > <span style="color: #000000;">4</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DisplayMessage<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> lPortrait := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> < ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTabletMode := IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTouch := <span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_DIGITIZER <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lKeyboardVisible := IsKeyboardVisible<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> cMsg := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTabletMode, <span style="color: #ff0000;">"TABLET MODE"</span>, <span style="color: #ff0000;">"DESKTOP MODE"</span> <span style="color: #000000;">)</span> + CRLF, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /><br /> cMsg += <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lPortrait, <span style="color: #ff0000;">"POTRAIT"</span>, <span style="color: #ff0000;">"LANDSCAPE"</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsZoomed<span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"MAXIMIZED"</span>, <span style="color: #ff0000;">"NORMAL"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" WINDOW"</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lTouch, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"NO "</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"TOUCH INPUT"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"MOUSE"</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> SM_CMOUSEBUTTONS <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">" NOT"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" PRESENT"</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lUseWait, <span style="color: #ff0000;">"USE WAIT"</span>, <span style="color: #ff0000;">"NO WAIT"</span> <span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lKeyboardVisible, <span style="color: #ff0000;">"Keyboard Visable"</span>, <span style="color: #ff0000;">"Keyboard Not Visable"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> cMsg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TMyWindow <span style="color: #0000ff;">FROM</span> TWindow<br /><br /> CLASSDATA lRegistered<br /><br /> <span style="color: #00C800;">DATA</span> bOnDisplayChange<br /> <span style="color: #00C800;">DATA</span> bOnSettingChange<br /><br /> <span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> HandleEvent<span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMyWindow<br /><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br /> <span style="color: #00C800;">case</span> nMsg == WM_DISPLAYCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnDisplayChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">case</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. nMsg == WM_SETTINGCHANGE<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> <span style="color: #00C800;">return</span> Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bOnSettingChange</span>, <span style="color: #00C800;">Self</span>, nWParam, nLParam <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">HandleEvent</span><span style="color: #000000;">(</span> nMsg, nWParam, nLParam <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitResize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> lUseWait<br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer ;<br /> <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> n = <span style="color: #000000;">1</span>, ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oTimer:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> ReSize<span style="color: #000000;">(</span> oWnd, cAction <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nTop, nLeft, nWidth, nHeight<br /> <span style="color: #00C800;">local</span> lIsKeyboardVisible := IsKeyboardVisible<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//sysrefresh()</span><br /> TraceSize<span style="color: #000000;">(</span> cAction <span style="color: #000000;">)</span><br /> nTop := <span style="color: #000000;">40</span><br /> nLeft := <span style="color: #000000;">40</span><br /> nWidth := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nLeft*<span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> nHeight := MyScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nTop*<span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//ScreenHeight() - ( nTop*2 )</span><br /> oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nTop, nLeft, nWidth, nHeight <span style="color: #000000;">)</span><br /> oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> TraceSize<span style="color: #000000;">(</span> cAction <span style="color: #000000;">)</span><br /> tracelog<span style="color: #000000;">(</span> cAction, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lUseWait, <span style="color: #ff0000;">'UseWait'</span>, <span style="color: #ff0000;">'NotUseWait'</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> gIsLandscape<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'LandScape'</span>,<span style="color: #ff0000;">'Portrait'</span> <span style="color: #000000;">)</span>, ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, MyScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> HKEY_CURRENT_USER <span style="color: #000000;">2147483649</span><br /><br /><span style="color: #00C800;">function</span> IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oReg, lTabletMode := .f.<br /> <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oReg:= TReg32<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> HKEY_CURRENT_USER, <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows<span style="color: #000000;">\C</span>urrentVersion<span style="color: #000000;">\I</span>mmersiveShell"</span> <span style="color: #000000;">)</span><br /> lTabletMode := <span style="color: #000000;">(</span> oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"TabletMode"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> lTabletMode<br /><br /><span style="color: #00D7D7;">#define</span> HKEY_LOCAL_MACHINE <span style="color: #000000;">2147483650</span> <span style="color: #B900B9;">// 0x80000002</span><br /><br /><span style="color: #00C800;">function</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oReg := TReg32<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> HKEY_LOCAL_MACHINE,;<br /> <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows NT<span style="color: #000000;">\C</span>urrentVersion"</span>,;<br /> .f. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cProductName := oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ProductName"</span> <span style="color: #000000;">)</span><br /> oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Windows 10"</span> $ cProductName<br /><br /><span style="color: #00C800;">function</span> IsKeyboardVisible<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> hWndInputPanel<br /> <span style="color: #00C800;">Local</span> aCoord<br /> <span style="color: #00C800;">Local</span> lReturn := .f.<br /> hWndInputPanel := FindWindow<span style="color: #000000;">(</span><span style="color: #ff0000;">"IPTip_Main_Window"</span><span style="color: #000000;">)</span><br /> aCoord := GetWndRect<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> hWndInputPanel != <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .or. IsWin8<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> lReturn := IsWindowEnabled<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> lReturn := IsWindowVisible<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> tracelog<span style="color: #000000;">(</span> <span style="color: #ff0000;">'Check Keyboard'</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lUseWait, <span style="color: #ff0000;">'UseWait'</span>, <span style="color: #ff0000;">'NotUseWait'</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> gIsLandscape<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'LandScape'</span>,<span style="color: #ff0000;">'Portrait'</span> <span style="color: #000000;">)</span>, ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, aCoord<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, aCoord<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, aCoord<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>, aCoord<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lReturn, <span style="color: #ff0000;">'Keyboard Visible'</span>, <span style="color: #ff0000;">'Keyboard Not Visible'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> lReturn<br /><br /><span style="color: #00C800;">function</span> MyScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> hWndInputPanel<br /> <span style="color: #00C800;">Local</span> aCoord<br /> <span style="color: #00C800;">Local</span> nHeight<br /> <span style="color: #00C800;">Local</span> lReturn := .f.<br /> <span style="color: #00C800;">if</span> IsKeyboardVisible<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. <span style="color: #000000;">(</span> IsWindows10<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .or. IsWin8<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> hWndInputPanel := FindWindow<span style="color: #000000;">(</span><span style="color: #ff0000;">"IPTip_Main_Window"</span><span style="color: #000000;">)</span><br /> aCoord := GetWndRect<span style="color: #000000;">(</span> hWndInputPanel <span style="color: #000000;">)</span><br /> nHeight := aCoord<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">else</span><br /> nHeight := ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> nHeight<br /><br /><span style="color: #00C800;">function</span> gIsLandscape<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span><span style="color: #000000;">(</span> screenwidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> > screenheight<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:38zj1rao]
[code=fw:38zj1rao]<div class="fw" id="{CB}" style="font-family: monospace;"> </div>[/code:38zj1rao] |
Changing with and height of a window and a dialog | The previous post works correctly if the on screen keyboard is docked. Some adjustments may need to be made if keyboard is not docked. Windows 7 looks like it works ok as is.
We would need to find out if keyboard docked on Windows 10 and 8. |
Changing with and height of a window and a dialog | Gale
If it's any help
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25706&p=176030&hilit=keyboard#p175935">viewtopic.php?f=3&t=25706&p=176030&hilit=keyboard#p175935</a><!-- l --> |
Changing with and height of a window and a dialog | Thanks for your input but we are way past that. We are talking about tablets when they rotate, not just starting the keyboard. |
Changing with and height of a window and a dialog | If our window/dialog is is in maximized mode, when the tablet is rotated, the window is automatically resized to fit the new orientation. We do not need to recalculate the dimensions of the window. I personally prefer to keep our program code to the minimum and depend more on the system.
Should we resize our window when the OSK popsup?
The normal practice on tablets is to have all windows/dialogs maximized and to keep input controls on the top half of the Window so that OSK, when pops up, does not cover the input controls. It is a good idea to keep input controls on the top and pure display controls on the bottom of the window. Please note that even on desktops, when the user switches from desktop mode to tablet mode, the window gets automatically maximized.
On rotation, we may still need to reposition some controls. For this purpose, we do not depend on ScreenHeight(), ScreenWidth() but on ClientRect of the window. That is accurate. This adjustment can be done in normal On Resize clause.
Note: We are also considering relative coordinate system for controls in future versions. Example:
@ 40, 0.25 GET ....... SIZE 0.50,20 PIXEL OF oWnd. (The meaning should be obvious)
With this change, we need not write specific code in our program in response to changes in modes / rotations. |
Changing with and height of a window and a dialog | even if the dialog is maximized screenheight() still has to be calculated to find the control positions so they are visible with on screen keyboard. Then you have popup dialog boxes that are not maximized. The problem of on screen keyboard and screen size will always be important. |
Changing with and height of a window and a dialog | [quote:1w56ut4m]screenheight() still has to be calculated to find the control positions so they are visible with on screen keyboard.[/quote:1w56ut4m]
I suggest using ClientRect of the window instead of screenheight() |
Changing with and height of a window and a dialog | with windows 10 the screenheight does not account for keyboard. so the window does not resize automatically. That has been one of the reasons for this whole exercise.Some of my controls will be hidden behind keyboard when screen is rotated. I have to figure out what the visible screen dimensions are!! |
Changing with and height of a window and a dialog | I might have misunderstood your comment. Once the dialog size and position has been determined then we can use coordinates of window.
I also have to rethink using any of the msg*() functions or any dialog that is centered. Without modification they will not always work right on Windows 10 when on screen keyboard visible. |
Changing with and height of a window and a dialog | Gale,
My core strategy in tablet programming with fwh:
- To use dialog controls on ScrollPanel class.
- When control get obtain focus, automatically open osk. Close osk on lost focus.
- When open osk then scrolling Panel until osk top- 1
Regards. |
Changing with and height of a window and a dialog | That sounds good and I am glad you have it working for you.
Scrolling dialog is good and I had tried to implement that. There were several issues using that alone. #1 was the placement of navigation buttons like next, previous, print, cancel, etc. With Windows 8 and 10 if you put them on the bottom of the dialog then they could get covered up with on screen keyboard. It is inconvenient to always scroll to find important buttons or controls. Also the manipulation of the on screen keyboard is different from Windows 7 and Windows 8 or 10. I could not get on screen keyboard to start and stop correctly with focus placed back on original control. After working on screen rotation problems I have learned a lot more about on screen keyboards. |
Changing with and height of a window and a dialog | Gale,
[quote:vig2sxvd] #1 was the placement of navigation buttons like next, previous, print, cancel, etc. With Windows 8 and 10 if you put them on the bottom of the dialog then they could get covered up with on screen keyboard.[/quote:vig2sxvd]
1st. buttons on top screen.
2nd. only running on windows 8 (tabtip osk)
Dialog scrolling in action, first stage: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25706&hilit=tablet&start=30#p143679">viewtopic.php?f=3&t=25706&hilit=tablet&start=30#p143679</a><!-- l -->
Regards |
Changing xBrowse data source and fields at runtime | To All
I am attempting to re-use an xBrowse already defined with an Ado data source and fields assigned to resource ID and browser object. I want to be able to re-use the same xBrowse and assign it a new data source and fields re-using the same resource id and xBrowse object at run-time.
To further clarify .. I want to be able to click on a radio button and show an xBrowse with its data source, fields and resource ID then be able to click on another radio button and re-use the same xBrowse with a new data source and fields utilizing the same resource ID and xBrowse object.
I have not attempted to do this before and have stayed awake most of the night thinking about how I would attempt this Logic.
1) Is there such a method as oLbx:CLose()
2) How would I reconfigure xBrowse at runtime to accept a new data source and fields at run-time using the same resource ID and browser object ?
I would greatly appreciate anyone's thoughts!
Rick Lipkin |
Changing xBrowse data source and fields at runtime | Rick:
Maybe this sample code will be of some help. Here, I used ComboBox instead of Radio-buttons.
[code=fw:3iqndgxi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//---------------------------------// </span><br /><span style="color: #00C800;">Function</span> FapSoftScan<span style="color: #000000;">(</span>oVent<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlg, oBrw, oCbx, oBt2<br /><span style="color: #00C800;">local</span> aInfo:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aTitCols:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aWMIscan, bMonitoring<br /><span style="color: #00C800;">local</span> cVar, nPos:=<span style="color: #000000;">1</span>, n<br /><span style="color: #00C800;">local</span> aOptions := <span style="color: #000000;">{</span><span style="color: #ff0000;">"01 Grupo de Programas (Win32 Logical Program Group) "</span>,;<br /> <span style="color: #ff0000;">"02 Sistema del Ordenador (Win32 Computer Systen) "</span> <span style="color: #000000;">}</span><br /><br /><br />bMonitoring := <span style="color: #000000;">{</span>|| aWMIscan:=FapMonitoring<span style="color: #000000;">(</span>nPos,oWMI,<span style="color: #000000;">18</span><span style="color: #000000;">)</span> ,;<br /> aInfo:=aWMIscan<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, aTitCols:=aWMIscan<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,;<br /> oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">(</span>aInfo,.t.,<span style="color: #000000;">1</span>,.t.<span style="color: #000000;">)</span>,;<br /> oBrw:<span style="color: #000000;">cHeaders</span> := aTitCols, ;<br /> oBrw:<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER, ; <span style="color: #B900B9;">// oBrw:nWidths := 160 ,;</span><br /> AEval<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">{</span>|o,n,oCol| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>ValType<span style="color: #000000;">(</span>o:<span style="color: #000000;">Value</span><span style="color: #000000;">)</span> ==<span style="color: #ff0000;">"N"</span>, o:<span style="color: #000000;">nWidth</span> := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> <span style="color: #000000;">40</span>, oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>n<span style="color: #000000;">]</span>:<span style="color: #000000;">HeaderWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, o:<span style="color: #000000;">nWidth</span>:=<span style="color: #000000;">160</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><span style="color: #000000;">)</span>,;<br /> oBrw:<span style="color: #000000;">nColSel</span> := <span style="color: #000000;">1</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span>,;<br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> oVent:<span style="color: #000000;">nWidth</span>, oVent:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"FapSoftScan"</span> TRANSPARENT<br /><br />cVar := aOptions<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br />@ oDlg:<span style="color: #000000;">nTop</span><span style="color: #000000;">+10</span>,<span style="color: #000000;">8</span> <span style="color: #0000ff;">COMBOBOX</span> oCBx <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span>;<br /> <span style="color: #0000ff;">ITEMS</span> aOptions ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">140</span>,<span style="color: #000000;">16</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> nPos := oCbx:<span style="color: #000000;">nAt</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Eval<span style="color: #000000;">(</span>bMonitoring<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ; <br /> ARRAY <span style="color: #000000;">{</span><span style="color: #000000;">}</span> CELL LINES FOOTERS AUTOSORT<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> Eval<span style="color: #000000;">(</span>bMonitoring<span style="color: #000000;">)</span><br /><br /><br /> @ oDlg:<span style="color: #000000;">nTop</span><span style="color: #000000;">+245</span>,<span style="color: #000000;">380</span> BUTTONBMP oBt2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Salir/Cancelar"</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> BITMAP <span style="color: #ff0000;">"SALIR16x16"</span> TEXTRIGHT ;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span> oBrw:<span style="color: #000000;">nHeight</span>:=oDlg:<span style="color: #000000;">nHeight</span><span style="color: #000000;">-118</span>, oBrw:<span style="color: #000000;">nWidth</span>:=oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-34</span>, oBrw:<span style="color: #000000;">nTop</span>:=oDlg:<span style="color: #000000;">nTop</span><span style="color: #000000;">+50</span> ,;<br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------</span><br /><span style="color: #00C800;">Function</span> FapMonitoring<span style="color: #000000;">(</span>nOption,oWMI<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oPC, oQry<br /><span style="color: #00C800;">local</span> aInfo:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aTitCols, n, nLen<br /><br /><span style="color: #00C800;">if</span> nOption == <span style="color: #000000;">1</span><br /> oQry := oWMI:<span style="color: #000000;">ExecQuery</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Select * FROM Win32_LogicalProgramGroup"</span> <span style="color: #000000;">)</span><br /> aTitCols:= <span style="color: #000000;">{</span><span style="color: #ff0000;">"Caption"</span>,<span style="color: #ff0000;">"Description"</span>,<span style="color: #ff0000;">"GroupName"</span>,<span style="color: #ff0000;">"Name"</span>,<span style="color: #ff0000;">"UserName"</span>,<span style="color: #ff0000;">"InstallDate"</span>,<span style="color: #ff0000;">"Status"</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">for</span> each oPC in oQry<br /> aadd<span style="color: #000000;">(</span>aInfo, <span style="color: #000000;">{</span>oPC:<span style="color: #000000;">Caption</span>, oPC:<span style="color: #000000;">Description</span>, oPC:<span style="color: #000000;">GroupName</span>, oPC:<span style="color: #0000ff;">Name</span>, oPc:<span style="color: #000000;">UserName</span>, oPc:<span style="color: #000000;">InstallDate</span>, oPc:<span style="color: #000000;">Status</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /><br />elseif nOption == <span style="color: #000000;">2</span><br /> oQry := oWMI:<span style="color: #000000;">ExecQuery</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Select * FROM Win32_ComputerSystem"</span> <span style="color: #000000;">)</span><br /> aTitCols:= <span style="color: #000000;">{</span><span style="color: #ff0000;">"Caption"</span>,<span style="color: #ff0000;">"Description"</span>,<span style="color: #ff0000;">"Domain"</span>,<span style="color: #ff0000;">"Model"</span>,<span style="color: #ff0000;">"Name"</span>,<span style="color: #ff0000;">"Processors"</span>,<span style="color: #ff0000;">"Status"</span>,<span style="color: #ff0000;">"System Type"</span>,<span style="color: #ff0000;">"User Name"</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">for</span> each oPC in oQry<br /> aadd<span style="color: #000000;">(</span>aInfo, <span style="color: #000000;">{</span>oPC:<span style="color: #000000;">Caption</span>, oPC:<span style="color: #000000;">Description</span>, oPC:<span style="color: #000000;">Domain</span>, oPC:<span style="color: #000000;">Model</span>, oPC:<span style="color: #0000ff;">Name</span>, oPc:<span style="color: #000000;">NumberOfProcessors</span>, oPc:<span style="color: #000000;">Status</span>, oPC:<span style="color: #000000;">SystemType</span>, oPC:<span style="color: #000000;">UserName</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">{</span>aInfo,aTitCols<span style="color: #000000;">}</span><br /> </div>[/code:3iqndgxi]
Best regards |
Changing xBrowse data source and fields at runtime | Francisco
Great LDAP query !! I understand what you are doing logically .. I don't know if I am going to run into any problems since my xBrowse is tied to a resource ID .. I am thinking I may have difficulty re-initializing the browse since I am using a recordset vs an array <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
I am thinking I am going to create the oRs object and create a recordset, then oRs:Close() and then re-use oRs as my new recordset re-using the same recordset object ?
I am working on the logic now ... Thank you for your suggestion!
Rick |
Chapecoense Campeón/Campeão | [img:26ttypjf]http://i.imgur.com/LEZQsWK.jpg[/img:26ttypjf]
<!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Saludos |
Chapecoense Campeón/Campeão | Força CHAPECOENSE !
Goian bego !
Para nosotros "Carpe diem" ...
[url:1jh0dvvq]https://www.youtube.com/watch?v=70ehPdHkEiQ[/url:1jh0dvvq] |
Char string size limit still 64k? | I had previously understood that in 32 bits we don't have the 64k size limit for a char string that we had in 16 bits. However, I saw in the xHarbour documentation for Memoread() that there still is a 64k size limit for a char string in xHarbour.How about FWH - do we still have a 64k limit for a char string?- Roger |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.