topic
stringlengths
1
63
text
stringlengths
1
577k
oMenu acts differently in February build
This still is not a fix but seems to solve the problem: [code:1sj4ynfy]METHOD Add( oMenuItem, lRoot ) CLASS TMenu DEFAULT lRoot := .f. AAdd( ::aItems, oMenuItem ) oMenuItem:oMenu = Self if ValType( oMenuItem:bAction ) == "O" .and. ; Upper( oMenuItem:bAction:ClassName() ) == "TMENU" if oMenuItem:cPrompt != nil AppendMenu( ::hMenu, nOr( MF_POPUP, MF_ENABLED,; If( oMenuItem:hBitmap != 0 .or. ( .f. .and. IsWinNT() .and. ! lRoot .and. !::lSysmenu), MF_OWNERDRAW, 0 ),; //EMG If( oMenuItem:lHelp, MF_HELP, 0 ),; If( oMenuItem:lChecked, MF_CHECKED, 0 ),; If( ! oMenuItem:lActive, MF_GRAYED, 0 ),; If( oMenuItem:lBreak, MF_BREAK, 0 ) ),; oMenuItem:bAction:hMenu,; oMenuItem:cPrompt ) else AppendMenu( ::hMenu, nOR( MF_POPUP, MF_BITMAP,; If( oMenuItem:lChecked, MF_CHECKED, 0 ),; If( ! oMenuItem:lActive, MF_GRAYED, 0 ),; If( oMenuItem:lHelp, MF_HELP, 0 ),; If( oMenuItem:lBreak, MF_BREAK, 0 ) ),; oMenuItem:bAction:hMenu, oMenuItem:hBitmap ) endif AAdd( aPopups, oMenuItem:bAction ) else if oMenuItem:cPrompt != nil AppendMenu( ::hMenu,; nOR( If( oMenuItem:lActive,; nOr( MF_ENABLED, If( oMenuItem:hBitmap != 0 .or. ; ( .f. .and. IsWinNT() .and. ! lRoot .and. ! ::lSysMenu ),; //EMG MF_OWNERDRAW, 0 ) ),; nOR( MF_DISABLED, MF_GRAYED ) ),; If( oMenuItem:lChecked, MF_CHECKED, 0 ),; If( oMenuItem:lHelp, MF_HELP, 0 ),; If( oMenuItem:lBreak, MF_BREAK, 0 ) ),; oMenuItem:nId, oMenuItem:cPrompt ) else if oMenuItem:hBitmap != 0 #ifdef __XPP__ if oMenuItem:lBreak == nil oMenuItem:lBreak = .f. endif #endif AppendMenu( ::hMenu, nOr( MF_BITMAP,; If( oMenuItem:lBreak, MF_BREAK, 0 ) ),; oMenuItem:nId, oMenuItem:hBitmap ) else AppendMenu( ::hMenu, MF_SEPARATOR, oMenuItem:nId, "" ) endif endif endif return nil[/code:1sj4ynfy] EMG
oMenu acts differently in February build
Ok, thanks! That solves the problem for now! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oMenu:Disable()
Hi Everybody, Here is a strange one for you.... I my app, I create a menu ... In the example below, I use a logical value to hide a menu choice if I don't want the user to have access to it ... so far so good. [code:14pk0li8] function BuildMenu&#40;&#41; MENU oMenu MENUITEM "Exit" MENU MENUITEM "Exit Program" Action QuitApp&#40;&#41; ENDMENU MENUITEM "Help" WHEN lHelp //This is where the issue is MENU MENUITEM "View Help File" ACTION ViewHelp&#40;&#41; ENDMENU ENDMENU return oMenu [/code:14pk0li8] Now here is the strange part..... Lets say lHelp := .t. If I do a oMenu:Disable() only the menu items that do NOT have the WHEN clause will be disabled. Why does this happen? Thanks, Jeff
oMenu:Disable()
It seems that WHEN clause has greater priority than Disable() method. EMG
oMenu:Disable()
Jeff, >In the example below, I use a logical value to hide a menu choice if I don't want the user to have access to it ... so far so good. I think it is better to just not to add those items to the menu. I just check user rights when building the menu and leave out those items. If the items are visible and disabled, the user is left to figure out why they are disabled. They wonder if they will become enabled after some user action, or if they need to configure something. Or, if they do know why the items are disabled, it is like an in-your-face statement that they are not good enough to have access. If the items aren't on the menu, then both of these issues are solved. This might also solve your other problem. James
oMenu:Disable()
Hi James, I can see what you are saying and it makes perfect sense, but in this case, having the user "see" what they are missing is a good thing ... additional options that are available to purchase <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Jeff
oMenu:Disable()
Jeff, >I can see what you are saying and it makes perfect sense, but in this case, having the user "see" what they are missing is a good thing ... additional options that are available to purchase. Ah, a very good point indeed! James
oMenuItem:SetCheck(.T.)
Tengo el siguiente problema, ya sea con Estilo 2007 o 2010, el setcheck del menuitem no me funciona, lo marque o desmarque, aún cuando cambio el estado del item, este continua checkeado... Alguien sabe por qué?
oMenuItem:SetCheck(.T.)
Hola, asi funciona bien... [code=fw:1uz6xws4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Mensagens da Barra, Relogio, fecha, Status, Etc.</span><br /><span style="color: #00D7D7;">#Define</span> CLOCK_ON &nbsp; &nbsp; &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar o Rel¢gio da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> CLOCK_OFF &nbsp; &nbsp; &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar o Rel¢gio da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> DATE_ON &nbsp; &nbsp; &nbsp; &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar a Data da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> DATE_OFF &nbsp; &nbsp; &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar a Data da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> KEYB_ON &nbsp; &nbsp; &nbsp; &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar o Status do Teclado "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> KEYB_OFF &nbsp; &nbsp; &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar o Status do Teclado "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"da Barra de Mensagens."</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Mensagens da Barra, Botao do Mouse Para Destros e Canhotos.</span><br /><span style="color: #00D7D7;">#Define</span> MOUSE_ON &nbsp; &nbsp; &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar o Mouse Para Destros(BotÆo "</span> &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Esquerdo do Mouse)-Default ‚ o "</span> &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"BotÆo Esquerdo."</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MOUSE_OFF &nbsp; &nbsp; &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar o Mouse Para Canhotos(BotÆo "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Direito do Mouse)-Inverter o "</span> &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"<Click> do Mouse."</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Menu Para Ligar/Desligar a Barra de Mensagens do Menu Principal</span><br /><span style="color: #00D7D7;">#Define</span> MENU_CLOCK_ON &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar o Rel¢gio"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU_CLOCK_OFF OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar o Rel¢gio"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU_DATE_ON &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar a Data"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU_DATE_OFF &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar a Data"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU_KEYB_ON &nbsp; OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar/Desligar Teclado"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU_KEYB_OFF &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Desligar/Ligar Teclado"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Menu Para Ligar/Desligar o Mouse BotÆo Para Destros ou Canhotos</span><br /><span style="color: #00D7D7;">#Define</span> MENU1_MOUSE_ON &nbsp;OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar o Mouse(Destros) "</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#Define</span> MENU2_MOUSE_OFF OemToAnsi<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Ligar o Mouse(Canhotos)"</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> oWndMain, oReloj, oDate, oKeyb, oMouseOn, oMouseOff, oBmpFundo<br /><br /><span style="color: #00C800;">FUNCTION</span>...<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oReloj <span style="color: #0000ff;">PROMPT</span> MENU_CLOCK_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHECKED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> CLOCK_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Troca_Controle<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oDate <span style="color: #0000ff;">PROMPT</span> MENU_DATE_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHECKED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> DATE_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Troca_Controle<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oKeyb <span style="color: #0000ff;">PROMPT</span> MENU_KEYB_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHECKED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> KEYB_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Troca_Controle<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMouseOn <span style="color: #0000ff;">PROMPT</span> MENU1_MOUSE_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHECKED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> MOUSE_ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Troca_Controle<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMouseOff <span style="color: #0000ff;">PROMPT</span> MENU2_MOUSE_OFF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> MOUSE_OFF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Click</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Troca_Controle<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">//-------------------Controle do Painel do Windows----------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> Troca_Controle<span style="color: #000000;">&#40;</span> nOpcao_Controle <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Case</span> nOpcao_Controle == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">oClock</span> # <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">ClockOff</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReloj:<span style="color: #000000;">cMsg</span> := CLOCK_ON<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReloj:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">ClockOn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReloj:<span style="color: #000000;">cMsg</span> := CLOCK_OFF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReloj:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Case</span> nOpcao_Controle == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">oDate</span> # <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">DateOff</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDate:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">DateOn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDate:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Case</span> nOpcao_Controle == <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">oKeyNum</span> # <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">KeybOff</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oKeyb:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">KeybOn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oKeyb:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Case</span> nOpcao_Controle == <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">oKeyNum</span> # <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Destros<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oMouseOn:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oMouseOff:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Case</span> nOpcao_Controle == <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span> oWndMain:<span style="color: #000000;">oMsgBar</span>:<span style="color: #000000;">oKeyNum</span> # <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Canhotos<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oMouseOn:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oMouseOff:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp;</div>[/code:1uz6xws4] 
oMeta difference FW & FWH?
Hi, I'am moving a appliation from FW to FWH and have a problem with showing meta-files. I have created a little sample that works in FW and not in FWH [code:swij82c9]#INCLUDE "fivewin&#46;CH" static sWnd static sscaling &#58;= 3 func test&#40;&#41; local oS&#58; =5200 local sx_offset &#58;= 0 local sy_offset &#58;= 0 local sregio &#58;= 3000 DEFINE WINDOW sWnd TITLE 'Test' VSCROLL HSCROLL oMeta &#58;= TMetaFile&#40;&#41;&#58;New&#40; 38, 0, sregio+38, sregio,'tmp&#46;dt',sWnd,CLR_BLACK,CLR_WHITE,sscaling,sscaling &#41; ACTIVATE WINDOW sWnd MAXIMIZED ; VALID &#40; sWndOpen &#58;= &#46;f&#46; , &#46;t&#46;&#41; on init sscale&#40;&#41; RETURN nil FUNCTION sscale&#40;&#41; local vverhouding&#58;=1 IF &#40;sWnd&#58;nright&#41;-&#40;sWnd&#58;nleft&#41; / &#40;sWnd&#58;nbottom - sWnd&#58;ntop &#41; > 1&#46;34 vverhouding =&#40;1024/768&#41;/ &#40;&#40;sWnd&#58;nright-sWnd&#58;nleft&#41; / &#40;sWnd&#58;nbottom - sWnd&#58;ntop &#41;&#41; *1&#46;15 ENDIF sscaling &#58;= 5200 / &#40;&#40;sWnd&#58;nright-sWnd&#58;nleft&#41; / 1032* vverhouding&#41; oMeta&#58;nWidth &#58;= sscaling oMeta&#58;nHeight &#58;= sscaling oMeta&#58;Refresh&#40;&#41; RETURN nil [/code:swij82c9] The meta file is located [url:swij82c9]http&#58;//www&#46;vms&#46;be/FWTest/tmp&#46;dt[/url:swij82c9] Can anyone tell me why this is not working in FWH? Thanks, Marc
oMeta difference FW & FWH?
Marc, Keep in mind that FWH uses 32 bits enhanced metafiles (EMF) instead of 16 bits Windows metafiles (WMF). Anyhow, if you rename it with .WMF extension, FWH will manage it too. What file type is inside your DT file ?
oMeta difference FW & FWH?
Antonio, The tmp.dt file is a WMF-file create with the CreateMetaFile() function. If I rename it to tmp.wmf , it still is't working. Should I use CreateEnhMetaFile() function? I have tried it but did't succeed to get it to work. Now I use something like: [code:112cio7d]hDCOut &#58;= CreateMetaFile&#40;'tmp&#46;dt'&#41; &#46;&#46;&#46; LineTo&#40; hDCOut , y_cor&#40;inLeft + sx_offset &#41; , x_cor&#40;430 - &#40;inTop + sy_offset &#41;&#41; , hPen&#41; &#46;&#46;&#46; TextOut&#40; hDCOut, y_cor&#40;y+3&#41;, x_cor&#40;x&#41;, substr&#40;text,1,at&#40;'&#46;',text&#41;-1&#41; &#46;&#46;&#46; CloseMetaFile&#40; hDCOut &#41; [/code:112cio7d] How do I use CreateEnhMetaFile()? I see that I have to give 3 parameters instead of 1. Thanks, Marc[/code]
oMeta difference FW & FWH?
Marc, You have an example of its use at source\classes\printer.prg: AAdd( ::aMeta, ::cDir + cTempFile( "\", "emf" ) ) ::hDCOut := CreateEnhMetaFile( ::hDC, ATail( ::aMeta ), ::cDocument )
oMeta difference FW & FWH?
Antonio, That's where I found the example, but wat should I use for ' ::hDC'? I see in the printer.prg that it is ' GetPrintDC()', but I don't want to print it. I only want to show it on screen. I suppose that '::cDocument ' is a desciption of the file. Is that correct? Regards, Marc
oMeta difference FW & FWH?
Marc, You can do hdc = GetDC( 0 ) use it and finally do ReleaseDC( 0, hdc ). Yes, cDocument is the name of the document.
oMeta difference FW & FWH?
Antonio, I have succeed to create te EMF-file, but if I want to display it I get the following error when I want to display it. [code:2aheiyna]Application =========== Path and name&#58; C&#58;\FWH\Projects\oMeta\METATEST&#46;exe &#40;32 bits&#41; Size&#58; 1,272,832 bytes Time from start&#58; 0 hours 0 mins 0 secs Error occurred at&#58; 08/11/07, 13&#58;24&#58;55 Error description&#58; Error BASE/1083 Argument error&#58; * Args&#58; &#91; 1&#93; = N 100&#46;00 &#91; 2&#93; = U Stack Calls =========== Called from&#58; TMETAFIL&#46;PRG => TMETAFILE&#58;PAINT&#40;0&#41; Called from&#58; TMETAFIL&#46;PRG => &#40;b&#41;TMETAFILE&#58;TMETAFILE&#40;0&#41; Called from&#58; => TMETAFILE&#58;DISPLAY&#40;0&#41; Called from&#58; CONTROL&#46;PRG => TMETAFILE&#58;HANDLEEVENT&#40;0&#41; Called from&#58; WINDOW&#46;PRG => _FWH&#40;0&#41; Called from&#58; => UPDATEWINDOW&#40;0&#41; Called from&#58; WINDOW&#46;PRG => TWINDOW&#58;ACTIVATE&#40;0&#41; Called from&#58; METATEST&#46;PRG => TEST&#40;18&#41;[/code:2aheiyna] The code to read is is the same as in previous message, only 'tmp.dt' is changed in 'tmp.emf' The emf file is [url:2aheiyna]http&#58;//www&#46;vms&#46;be/FWTest/tmp&#46;emf[/url:2aheiyna] Thanks, Marc[/code]
oMeta difference FW & FWH?
Marc, Fixed. Are you using Harbour or xHarbour ? to email you a new lib.
oMeta difference FW & FWH?
Antonio, I'am using xHarbour. Marc
oMeta difference FW & FWH?
We already emailed you a modified LIB for xHarbour. Please try your code again, thanks
oMeta difference FW & FWH?
Thanks Antonio for the quick support. It' working!!! Best regards, Marc
oMeta difference FW & FWH?
good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oMeta difference FW & FWH?
Antonio, There is only one problem if I want to create a second EMF-file. Then I get 'Error (32) creating Enhanced metafile' Here is an example [code:1mz35ri5]#INCLUDE "fivewin&#46;CH" static sWnd static nZFactor FUNCTION test&#40;&#41; local hPEN &#58;= CreatePen&#40; 0 , 1, 0 &#41; local w &#58;= getsysmetrics&#40;0&#41; - 10 local h &#58;= getsysmetrics&#40;1&#41; - 68 nZFactor = 1 hdc = GetDC&#40; 0 &#41; hDCOut &#58;= CreateEnhMetaFile&#40;hdc,'tmp&#46;emf','testje'&#41; MoveTo&#40; hDCOut, 0 , 0 &#41; LineTo&#40; hDCOut, 0 ,h , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , 0 , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , h , hPen&#41; CloseEnhMetaFile&#40; hDCOut &#41; ReleaseDC&#40; 0, hdc &#41; DEFINE WINDOW sWnd TITLE 'Test' VSCROLL HSCROLL oMeta &#58;= TMetaFile&#40;&#41;&#58;New&#40; 38, 0, w, h,'tmp&#46;emf',sWnd,CLR_BLACK,CLR_WHITE,h,w &#41; ACTIVATE WINDOW sWnd MAXIMIZED ; VALID &#40; sWndOpen &#58;= &#46;f&#46; , &#46;t&#46;&#41; hdc = GetDC&#40; 0 &#41; hDCOut &#58;= CreateEnhMetaFile&#40;hdc,'tmp&#46;emf','testje'&#41; MoveTo&#40; hDCOut, 0 , 0 &#41; LineTo&#40; hDCOut, 0 ,h , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , 0 , hPen&#41; CloseEnhMetaFile&#40; hDCOut &#41; ReleaseDC&#40; 0, hdc &#41; DEFINE WINDOW sWnd TITLE 'Test' VSCROLL HSCROLL oMeta &#58;= TMetaFile&#40;&#41;&#58;New&#40; 38, 0, w, h,'tmp&#46;emf',sWnd,CLR_BLACK,CLR_WHITE,h,w &#41; ACTIVATE WINDOW sWnd MAXIMIZED ; VALID &#40; sWndOpen &#58;= &#46;f&#46; , &#46;t&#46;&#41; RETURN nil [/code:1mz35ri5] Can you tell me what I'm doing wrong? Thanks, Marc
oMeta difference FW & FWH?
Marc, The error 32 means that the EMF file is still open ( "sharing violation" ) so you can not create it again. You may use a different EMF filename as it seems that Windows takes some time to close it, even if we force it to do so: ACTIVATE WINDOW sWnd MAXIMIZED ; VALID ( sWndOpen := .f., DeleteEnhMetaFile( oMeta:hMeta ), .t.)
oMeta difference FW & FWH?
Antonio Everything is working fine but I have a question using 'hdc = GetDC( 0 )' with CreateEnhMetaFile(hdc,'tmp.emf','testje'). Using this, the dimentions of the meta-file is the same as the screen resolution. Is it possible to have a bigger meta-file. My program is creating drawings, and somethimes they are bigger than the screen resolution, and with the 16bit version, the meta file was bigger then the screen. I used the scroll-bars to show the rest. Thanks, Marc
oMeta difference FW & FWH?
Marc, You need to provide a bigger hDC. You could create a "bigger" window and get its hDC: DEFINE WINDOW oWnd SIZE 4000, 2000 hDC = GetDC( oWnd:hWnd ) ... your code ReleaseDC( oWnd:hWnd, hDC ) oWnd:End()
oMeta difference FW & FWH?
Thanks, I will try it. Regards, Marc
oMeta difference FW & FWH?
Antonio, I doesn't work. The size of the emf-file is still the same... Here is my testcode [code:oopwxahp]FUNCTION test&#40;&#41; local hPEN &#58;= CreatePen&#40; 0 , 1, 0 &#41; local w &#58;= getsysmetrics&#40;0&#41; - 10 local h &#58;= getsysmetrics&#40;1&#41; - 68 nZFactor = 1 DEFINE WINDOW sWnd FROM 0,0 TO 4000,4000 TITLE 'Test' VSCROLL HSCROLL hdc = GetDC&#40; 0 &#41; hDCOut &#58;= CreateEnhMetaFile&#40;hdc,'tmp&#46;emf','testje'&#41; MoveTo&#40; hDCOut, 0 , 0 &#41; LineTo&#40; hDCOut, 0 ,h , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , 0 , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , h , hPen&#41; CloseEnhMetaFile&#40; hDCOut &#41; ReleaseDC&#40; 0, hdc &#41; oMeta &#58;= TMetaFile&#40;&#41;&#58;New&#40; 38, 0, w, h,'tmp&#46;emf',sWnd,CLR_BLACK,CLR_WHITE,h,w &#41; ACTIVATE WINDOW sWnd MAXIMIZED ; VALID &#40; sWndOpen &#58;= &#46;f&#46; , &#46;t&#46;&#41; RETURN nil [/code:oopwxahp] Regards, Marc
oMeta difference FW & FWH?
Marc, There are some errors in your code. Please try this: [code:1n9me4sh] FUNCTION test&#40;&#41; local hPEN &#58;= CreatePen&#40; 0 , 1, 0 &#41; local w &#58;= getsysmetrics&#40;0&#41; - 10 local h &#58;= getsysmetrics&#40;1&#41; - 68 nZFactor = 1 DEFINE WINDOW sWnd FROM 0,0 TO 4000,4000 TITLE 'Test' VSCROLL HSCROLL hdc = GetDC&#40; sWnd&#58;hWnd &#41; hDCOut &#58;= CreateEnhMetaFile&#40;hdc,'tmp&#46;emf','testje'&#41; MoveTo&#40; hDCOut, 0 , 0 &#41; LineTo&#40; hDCOut, 0 ,h , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , 0 , hPen&#41; LineTo&#40; hDCOut, w , h , hPen&#41; LineTo&#40; hDCOut, w , 0 , hPen&#41; LineTo&#40; hDCOut, 0 , h , hPen&#41; CloseEnhMetaFile&#40; hDCOut &#41; ReleaseDC&#40; sWnd&#58;hWnd, hdc &#41; oMeta &#58;= TMetaFile&#40;&#41;&#58;New&#40; 38, 0, w, h,'tmp&#46;emf',sWnd,CLR_BLACK,CLR_WHITE,h,w &#41; ACTIVATE WINDOW sWnd MAXIMIZED ; VALID &#40; sWndOpen &#58;= &#46;f&#46; , &#46;t&#46;&#41; RETURN nil [/code:1n9me4sh]
oMeta difference FW & FWH?
Antonio, It's the same result... The size is the same as the screen. Regards, Marc
oMeta difference FW & FWH?
Antonio, Do you have a solution for creating 'bigger' meta-files. I allway's get the same size as the screen <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Marc
oMeta difference FW & FWH?
Hello, See this sample: [code:1ndu8jar] // Testing how to scroll a window with its contents #include "FiveWin&#46;ch" #define D_WIDTH 4 #define D_HEIGHT 13 FUNCTION Main&#40;&#41; LOCAL oWnd,oScrWnd LOCAL cGet0101 &#58;= space&#40;10&#41;, ; //Row 1 cGet0102 &#58;= space&#40;10&#41;, ; cGet0103 &#58;= space&#40;10&#41;, ; cGet0104 &#58;= space&#40;10&#41;, ; cGet0105 &#58;= space&#40;10&#41;, ; cGet0201 &#58;= space&#40;10&#41;, ; //Row 2 cGet0202 &#58;= space&#40;10&#41;, ; cGet0203 &#58;= space&#40;10&#41;, ; cGet0204 &#58;= space&#40;10&#41;, ; cGet0205 &#58;= space&#40;10&#41;, ; cGet0301 &#58;= space&#40;10&#41;, ; //Row 3 cGet0302 &#58;= space&#40;10&#41;, ; cGet0303 &#58;= space&#40;10&#41;, ; cGet0304 &#58;= space&#40;10&#41;, ; cGet0305 &#58;= space&#40;10&#41;, ; cGet0401 &#58;= space&#40;10&#41;, ; //Row 4 cGet0402 &#58;= space&#40;10&#41;, ; cGet0403 &#58;= space&#40;10&#41;, ; cGet0404 &#58;= space&#40;10&#41;, ; cGet0405 &#58;= space&#40;10&#41;, ; cGet0501 &#58;= space&#40;10&#41;, ; //Row 5 cGet0502 &#58;= space&#40;10&#41;, ; cGet0503 &#58;= space&#40;10&#41;, ; cGet0504 &#58;= space&#40;10&#41;, ; cGet0505 &#58;= space&#40;10&#41;, ; cGet0601 &#58;= space&#40;10&#41;, ; //Row 6 cGet0602 &#58;= space&#40;10&#41;, ; cGet0603 &#58;= space&#40;10&#41;, ; cGet0604 &#58;= space&#40;10&#41;, ; cGet0605 &#58;= space&#40;10&#41;, ; cGet0701 &#58;= space&#40;10&#41;, ; //Row 7 cGet0702 &#58;= space&#40;10&#41;, ; cGet0703 &#58;= space&#40;10&#41;, ; cGet0704 &#58;= space&#40;10&#41;, ; cGet0705 &#58;= space&#40;10&#41;, ; cGet0801 &#58;= space&#40;10&#41;, ; //Row 8 cGet0802 &#58;= space&#40;10&#41;, ; cGet0803 &#58;= space&#40;10&#41;, ; cGet0804 &#58;= space&#40;10&#41;, ; cGet0805 &#58;= space&#40;10&#41;, ; cGet0901 &#58;= space&#40;10&#41;, ; //Row 9 cGet0902 &#58;= space&#40;10&#41;, ; cGet0903 &#58;= space&#40;10&#41;, ; cGet0904 &#58;= space&#40;10&#41;, ; cGet0905 &#58;= space&#40;10&#41;, ; cGet1001 &#58;= space&#40;10&#41;, ; //Row 10 cGet1002 &#58;= space&#40;10&#41;, ; cGet1003 &#58;= space&#40;10&#41;, ; cGet1004 &#58;= space&#40;10&#41;, ; cGet1005 &#58;= space&#40;10&#41;, ; cGet1101 &#58;= space&#40;10&#41;, ; //Row 11 cGet1102 &#58;= space&#40;10&#41;, ; cGet1103 &#58;= space&#40;10&#41;, ; cGet1104 &#58;= space&#40;10&#41;, ; cGet1105 &#58;= space&#40;10&#41; define window oWnd from 0, 0 TO 25, 70 ; title "Scroll Window" ; vscroll hscroll && mdi @ 9,17 bitmap file "\fwh\bitmaps\pic1&#46;bmp" of oWnd size 120,148 adjust @ 9,32 bitmap file "\fwh\bitmaps\pic2&#46;bmp" of oWnd size 120,148 adjust @ 9,47 bitmap file "\fwh\bitmaps\pic3&#46;bmp" of oWnd size 120,148 adjust @ 9,62 bitmap file "\fwh\bitmaps\pic4&#46;bmp" of oWnd size 120,148 adjust @ 9,77 bitmap file "\fwh\bitmaps\pic5&#46;bmp" of oWnd size 120,148 adjust @ 21*13,02*8 say "Customer " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 23*13,02*8 say "P&#46;O&#46; # " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 25*13,02*8 say "Style No&#46;" of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 27*13,02*8 say "Fabrics " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 29*13,02*8 say "Fob " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 31*13,02*8 say "Q'TY " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 33*13,02*8 say "DEL&#46; " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 35*13,02*8 say "MAKER " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 37*13,02*8 say "QTA " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 39*13,02*8 say "SIZE " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 41*13,02*8 say "Size B/D " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 43*13,02*8 say "REMARKS " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,17*8 say "Venture " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,32*8 say "Sears " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,47*8 say "Kohl's " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,62*8 say "Kiss " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,77*8 say "K-MART " of oWnd update color CLR_BLACK,CLR_WHITE size 120,26 border pixel //-* Row 1 @ 23*13,17*8 get cGet0101 size 120,26 of oWnd update pixel @ 23*13,32*8 get cGet0102 size 120,26 of oWnd update pixel @ 23*13,47*8 get cGet0103 size 120,26 of oWnd update pixel @ 23*13,62*8 get cGet0104 size 120,26 of oWnd update pixel @ 23*13,77*8 get cGet0105 size 120,26 of oWnd update pixel //-* Row 2 @ 25*13,17*8 get cGet0201 size 120,26 of oWnd update pixel @ 25*13,32*8 get cGet0202 size 120,26 of oWnd update pixel @ 25*13,47*8 get cGet0203 size 120,26 of oWnd update pixel @ 25*13,62*8 get cGet0204 size 120,26 of oWnd update pixel @ 25*13,77*8 get cGet0205 size 120,26 of oWnd update pixel //-* Row 3 @ 27*13,17*8 get cGet0301 size 120,26 of oWnd update pixel @ 27*13,32*8 get cGet0302 size 120,26 of oWnd update pixel @ 27*13,47*8 get cGet0303 size 120,26 of oWnd update pixel @ 27*13,62*8 get cGet0304 size 120,26 of oWnd update pixel @ 27*13,77*8 get cGet0305 size 120,26 of oWnd update pixel //-* Row 4 @ 29*13,17*8 get cGet0401 size 120,26 of oWnd update pixel @ 29*13,32*8 get cGet0402 size 120,26 of oWnd update pixel @ 29*13,47*8 get cGet0403 size 120,26 of oWnd update pixel @ 29*13,62*8 get cGet0404 size 120,26 of oWnd update pixel @ 29*13,77*8 get cGet0405 size 120,26 of oWnd update pixel //-* Row 5 @ 31*13,17*8 get cGet0501 size 120,26 of oWnd update pixel @ 31*13,32*8 get cGet0502 size 120,26 of oWnd update pixel @ 31*13,47*8 get cGet0503 size 120,26 of oWnd update pixel @ 31*13,62*8 get cGet0504 size 120,26 of oWnd update pixel @ 31*13,77*8 get cGet0505 size 120,26 of oWnd update pixel //-* Row 6 @ 33*13,17*8 get cGet0601 size 120,26 of oWnd update pixel @ 33*13,32*8 get cGet0602 size 120,26 of oWnd update pixel @ 33*13,47*8 get cGet0603 size 120,26 of oWnd update pixel @ 33*13,62*8 get cGet0604 size 120,26 of oWnd update pixel @ 33*13,77*8 get cGet0605 size 120,26 of oWnd update pixel //-* Row 7 @ 35*13,17*8 get cGet0701 size 120,26 of oWnd update pixel @ 35*13,32*8 get cGet0702 size 120,26 of oWnd update pixel @ 35*13,47*8 get cGet0703 size 120,26 of oWnd update pixel @ 35*13,62*8 get cGet0704 size 120,26 of oWnd update pixel @ 35*13,77*8 get cGet0705 size 120,26 of oWnd update pixel //-* Row 8 @ 37*13,17*8 get cGet0801 size 120,26 of oWnd update pixel @ 37*13,32*8 get cGet0802 size 120,26 of oWnd update pixel @ 37*13,47*8 get cGet0803 size 120,26 of oWnd update pixel @ 37*13,62*8 get cGet0804 size 120,26 of oWnd update pixel @ 37*13,77*8 get cGet0805 size 120,26 of oWnd update pixel //-* Row 9 @ 39*13,17*8 get cGet0901 size 120,26 of oWnd update pixel @ 39*13,32*8 get cGet0902 size 120,26 of oWnd update pixel @ 39*13,47*8 get cGet0903 size 120,26 of oWnd update pixel @ 39*13,62*8 get cGet0904 size 120,26 of oWnd update pixel @ 39*13,77*8 get cGet0905 size 120,26 of oWnd update pixel //-* Row 10 @ 41*13,17*8 get cGet1001 size 120,26 of oWnd update pixel @ 41*13,32*8 get cGet1002 size 120,26 of oWnd update pixel @ 41*13,47*8 get cGet1003 size 120,26 of oWnd update pixel @ 41*13,62*8 get cGet1004 size 120,26 of oWnd update pixel @ 41*13,77*8 get cGet1005 size 120,26 of oWnd update pixel //-* Row 11 @ 43*13,17*8 get cGet1101 size 120,26 of oWnd update pixel @ 43*13,32*8 get cGet1102 size 120,26 of oWnd update pixel @ 43*13,47*8 get cGet1103 size 120,26 of oWnd update pixel @ 43*13,62*8 get cGet1104 size 120,26 of oWnd update pixel @ 43*13,77*8 get cGet1105 size 120,26 of oWnd update pixel @ 50,20 button "&Ok" size 80,20 of oWnd ; action &#40;MsgInfo&#40;"You click OK button!"&#41;,oWnd&#58;End&#40;&#41;&#41; @ 50,40 button "&Cancel" size 80,20 of oWnd ; action &#40;MsgInfo&#40;"You click Cancel button!"&#41;,oWnd&#58;End&#40;&#41;&#41; ACTIVATE WINDOW oWnd ; ON INIT &#40; TScrWnd&#40;&#41;&#58;New&#40;oWnd,1,40,1,70&#41; &#41; RETURN&#40; NIL &#41; //============================================================================ // FileName &#58; SCROLL&#46;PRG // Purpose &#58; Windows Scroll Class // Author &#58; Eric Yang // Update History &#58; // Date Contents // ---------- --------------------------------------------------------------- // 1997&#46;02&#46;01 // //============================================================================ #include "FiveWin&#46;ch" #ifndef TRUE #define TRUE &#46;T&#46; #define FALSE &#46;F&#46; #endif CLASS TScrWnd DATA oWnd DATA nVPos,nHPos METHOD New&#40; oWnd,nV1,nV2,nH1,nH2 &#41; CONSTRUCTOR METHOD SetScroll&#40; nV1,nV2,nH1,nH2 &#41; //-*------------------------------------------------------------ METHOD VScroll&#40;&#41; METHOD VScrollThumb&#40;&#41; METHOD VScrollTrack&#40;&#41; METHOD VScrollPgDown&#40;&#41; METHOD VScrollPgUp&#40;&#41; //-*----------------------------- METHOD HScroll&#40;&#41; METHOD HScrollThumb&#40;&#41; METHOD HScrollTrack&#40;&#41; METHOD HScrollPgDown&#40;&#41; METHOD HScrollPgUp&#40;&#41; ENDCLASS METHOD New&#40; oWnd,nV1,nV2,nH1,nH2 &#41; CLASS TScrWnd &#58;&#58;nVPos &#58;= 0 &#58;&#58;nHPos &#58;= 0 &#58;&#58;oWnd &#58;= oWnd &#58;&#58;SetScroll&#40; nV1,nV2,nH1,nH2 &#41; RETURN Self METHOD SetScroll&#40; nV1,nV2,nH1,nH2 &#41; CLASS TScrWnd LOCAL aCoors1&#58;=&#123;&#125;,aCoors2&#58;=&#123;&#125; //-------------------------------------------------- //-* Vertical Scroll Bar // ? &#58;&#58;oWnd&#58;oVSCroll=NIL if &#58;&#58;oWnd&#58;oVScroll != NIL // ? nV1,nV2 &#58;&#58;oWnd&#58;oVScroll&#58;SetRange&#40; nV1,nV2 &#41; &#58;&#58;nVPos &#58;= &#58;&#58;oWnd&#58;oVScroll&#58;GetPos&#40;&#41; &#58;&#58;oWnd&#58;oVScroll&#58;bGoDown &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bGoUp &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bPageUp &#58;= &#123;|| &#58;&#58;VScrollPgUp&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bPageDown &#58;= &#123;|| &#58;&#58;VScrollPgDown&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bGoTop &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bGoBottom &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;nPgStep &#58;= 10 //&#58;&#58;oWnd&#58;oVScroll&#58;lReDraw &#58;= TRUE &#58;&#58;oWnd&#58;oVScroll&#58;bPos &#58;= &#123;|nPos| &#58;&#58;VScrollThumb&#40;nPos&#41; &#125; &#58;&#58;oWnd&#58;oVScroll&#58;bTrack &#58;= &#123;|nPos| &#58;&#58;VScrollTrack&#40;nPos&#41; &#125; endif //-------------------------------------------------- //-* Horizontal Scroll Bar if &#58;&#58;oWnd&#58;oHScroll != NIL &#58;&#58;oWnd&#58;oHScroll&#58;SetRange&#40; nH1,nH2 &#41; &#58;&#58;nHPos &#58;= &#58;&#58;oWnd&#58;oHScroll&#58;GetPos&#40;&#41; &#58;&#58;oWnd&#58;oHScroll&#58;bGoDown &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bGoUp &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bPageUp &#58;= &#123;|| &#58;&#58;HScrollPgUp&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bPageDown &#58;= &#123;|| &#58;&#58;HScrollPgDown&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bGoTop &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bGoBottom &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;nPgStep &#58;= 10 //&#58;&#58;oWnd&#58;oHScroll&#58;lReDraw &#58;= TRUE &#58;&#58;oWnd&#58;oHScroll&#58;bPos &#58;= &#123;|nPos| &#58;&#58;HScrollThumb&#40;nPos&#41; &#125; &#58;&#58;oWnd&#58;oHScroll&#58;bTrack &#58;= &#123;|nPos| &#58;&#58;HScrollTrack&#40;nPos&#41; &#125; endif //&#58;&#58;oWnd&#58;bKeyChar &#58;= &#123;|nKey,nFlags| ScrollKey&#40;nKey&#41; &#125; //-------------------------------------------------- RETURN&#40; NIL &#41; //STATIC FUNCTION ScrollKey&#40;nKey&#41; //MsgInfo&#40; "Key &#58; "+str&#40;nKey,10&#41; &#41; //if nKey == K_ENTER // goMainDlg&#58;End&#40;&#41; // lRetVal &#58;= TRUE //endif //RETURN&#40; NIL &#41; //================================================================= //-* Vertical Scroll Bar METHOD VScroll&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nVPos >= &#58;&#58;oWnd&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oWnd&#58;oVScroll&#58;nMax nNewPos &#58;= &#58;&#58;oWnd&#58;oVScroll&#58;GetPos&#40;&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos-nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollThumb&#40;nNewPos&#41; CLASS TScrWnd if &#58;&#58;nVPos >= &#58;&#58;oWnd&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oWnd&#58;oVScroll&#58;nMax &#58;&#58;oWnd&#58;oVScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, 0, ; &#40;&#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollTrack&#40;nNewPos&#41; CLASS TScrWnd if &#58;&#58;nVPos >= &#58;&#58;oWnd&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oWnd&#58;oVScroll&#58;nMax &#58;&#58;oWnd&#58;oVScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, 0, ; &#40;&#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollPgDown&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nVPos < &#58;&#58;oWnd&#58;oVScroll&#58;nMax nNewPos &#58;= &#58;&#58;nVPos + &#58;&#58;oWnd&#58;oVScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos > &#58;&#58;oWnd&#58;oVScroll&#58;nMax, &#58;&#58;oWnd&#58;oVScroll&#58;nMax, nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollPgUp&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nVPos > &#58;&#58;oWnd&#58;oVScroll&#58;nMin nNewPos &#58;= &#58;&#58;nVPos - &#58;&#58;oWnd&#58;oVScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos < &#58;&#58;oWnd&#58;oVScroll&#58;nMin,&#58;&#58;oWnd&#58;oVScroll&#58;nMin,nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; //================================================================= //-* Horizontal Scroll Bar METHOD HScroll&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nHPos >= &#58;&#58;oWnd&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oWnd&#58;oHScroll&#58;nMax nNewPos &#58;= &#58;&#58;oWnd&#58;oHScroll&#58;GetPos&#40;&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollThumb&#40;nNewPos&#41; CLASS TScrWnd if &#58;&#58;nHPos >= &#58;&#58;oWnd&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oWnd&#58;oHScroll&#58;nMax &#58;&#58;oWnd&#58;oHScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollTrack&#40;nNewPos&#41; CLASS TScrWnd if &#58;&#58;nHPos >= &#58;&#58;oWnd&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oWnd&#58;oHScroll&#58;nMax &#58;&#58;oWnd&#58;oHScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollPgDown&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nHPos < &#58;&#58;oWnd&#58;oHScroll&#58;nMax nNewPos &#58;= &#58;&#58;nHPos + &#58;&#58;oWnd&#58;oHScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos > &#58;&#58;oWnd&#58;oHScroll&#58;nMax, &#58;&#58;oWnd&#58;oHScroll&#58;nMax, nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, ; &#40; &#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollPgUp&#40;&#41; CLASS TScrWnd LOCAL nNewPos if &#58;&#58;nHPos > &#58;&#58;oWnd&#58;oHScroll&#58;nMin nNewPos &#58;= &#58;&#58;nHPos - &#58;&#58;oWnd&#58;oHScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos < &#58;&#58;oWnd&#58;oHScroll&#58;nMin,&#58;&#58;oWnd&#58;oHScroll&#58;nMin,nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oWnd&#58;hWnd, ; &#40; &#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oWnd&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; //=* End of File ================================================= procedure AppSys // Xbase++ requirement return [/code:1ndu8jar] ...and scroll dialog [code:1ndu8jar] // Testing how to scroll a dialog with its contents #include "FiveWin&#46;ch" #define D_WIDTH 4 #define D_HEIGHT 13 FUNCTION Main&#40;&#41; LOCAL oDlg LOCAL cGet0101 &#58;= space&#40;10&#41;, ; //Row 1 cGet0102 &#58;= space&#40;10&#41;, ; cGet0103 &#58;= space&#40;10&#41;, ; cGet0104 &#58;= space&#40;10&#41;, ; cGet0105 &#58;= space&#40;10&#41;, ; cGet0201 &#58;= space&#40;10&#41;, ; //Row 2 cGet0202 &#58;= space&#40;10&#41;, ; cGet0203 &#58;= space&#40;10&#41;, ; cGet0204 &#58;= space&#40;10&#41;, ; cGet0205 &#58;= space&#40;10&#41;, ; cGet0301 &#58;= space&#40;10&#41;, ; //Row 3 cGet0302 &#58;= space&#40;10&#41;, ; cGet0303 &#58;= space&#40;10&#41;, ; cGet0304 &#58;= space&#40;10&#41;, ; cGet0305 &#58;= space&#40;10&#41;, ; cGet0401 &#58;= space&#40;10&#41;, ; //Row 4 cGet0402 &#58;= space&#40;10&#41;, ; cGet0403 &#58;= space&#40;10&#41;, ; cGet0404 &#58;= space&#40;10&#41;, ; cGet0405 &#58;= space&#40;10&#41;, ; cGet0501 &#58;= space&#40;10&#41;, ; //Row 5 cGet0502 &#58;= space&#40;10&#41;, ; cGet0503 &#58;= space&#40;10&#41;, ; cGet0504 &#58;= space&#40;10&#41;, ; cGet0505 &#58;= space&#40;10&#41;, ; cGet0601 &#58;= space&#40;10&#41;, ; //Row 6 cGet0602 &#58;= space&#40;10&#41;, ; cGet0603 &#58;= space&#40;10&#41;, ; cGet0604 &#58;= space&#40;10&#41;, ; cGet0605 &#58;= space&#40;10&#41;, ; cGet0701 &#58;= space&#40;10&#41;, ; //Row 7 cGet0702 &#58;= space&#40;10&#41;, ; cGet0703 &#58;= space&#40;10&#41;, ; cGet0704 &#58;= space&#40;10&#41;, ; cGet0705 &#58;= space&#40;10&#41;, ; cGet0801 &#58;= space&#40;10&#41;, ; //Row 8 cGet0802 &#58;= space&#40;10&#41;, ; cGet0803 &#58;= space&#40;10&#41;, ; cGet0804 &#58;= space&#40;10&#41;, ; cGet0805 &#58;= space&#40;10&#41;, ; cGet0901 &#58;= space&#40;10&#41;, ; //Row 9 cGet0902 &#58;= space&#40;10&#41;, ; cGet0903 &#58;= space&#40;10&#41;, ; cGet0904 &#58;= space&#40;10&#41;, ; cGet0905 &#58;= space&#40;10&#41;, ; cGet1001 &#58;= space&#40;10&#41;, ; //Row 10 cGet1002 &#58;= space&#40;10&#41;, ; cGet1003 &#58;= space&#40;10&#41;, ; cGet1004 &#58;= space&#40;10&#41;, ; cGet1005 &#58;= space&#40;10&#41;, ; cGet1101 &#58;= space&#40;10&#41;, ; //Row 11 cGet1102 &#58;= space&#40;10&#41;, ; cGet1103 &#58;= space&#40;10&#41;, ; cGet1104 &#58;= space&#40;10&#41;, ; cGet1105 &#58;= space&#40;10&#41; define dialog oDlg from 0, 0 TO 25, 70 ; title "Scroll dialog" ; Style nor&#40; WS_VSCROLL, WS_HSCROLL &#41; @ 9,17 bitmap file "\fwh\bitmaps\pic1&#46;bmp" of oDlg size 120,148 adjust @ 9,32 bitmap file "\fwh\bitmaps\pic2&#46;bmp" of oDlg size 120,148 adjust @ 9,47 bitmap file "\fwh\bitmaps\pic3&#46;bmp" of oDlg size 120,148 adjust @ 9,62 bitmap file "\fwh\bitmaps\pic4&#46;bmp" of oDlg size 120,148 adjust @ 9,77 bitmap file "\fwh\bitmaps\pic5&#46;bmp" of oDlg size 120,148 adjust @ 21*13,02*8 say "Customer " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 23*13,02*8 say "P&#46;O&#46; # " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 25*13,02*8 say "Style No&#46;" of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 27*13,02*8 say "Fabrics " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 29*13,02*8 say "Fob " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 31*13,02*8 say "Q'TY " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 33*13,02*8 say "DEL&#46; " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 35*13,02*8 say "MAKER " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 37*13,02*8 say "QTA " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 39*13,02*8 say "SIZE " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 41*13,02*8 say "Size B/D " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 43*13,02*8 say "REMARKS " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,17*8 say "Venture " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,32*8 say "Sears " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,47*8 say "Kohl's " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,62*8 say "Kiss " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel @ 21*13,77*8 say "K-MART " of oDlg update color CLR_BLACK,CLR_WHITE size 120,26 border pixel //-* Row 1 @ 23*13,17*8 get cGet0101 size 120,26 of oDlg update pixel @ 23*13,32*8 get cGet0102 size 120,26 of oDlg update pixel @ 23*13,47*8 get cGet0103 size 120,26 of oDlg update pixel @ 23*13,62*8 get cGet0104 size 120,26 of oDlg update pixel @ 23*13,77*8 get cGet0105 size 120,26 of oDlg update pixel //-* Row 2 @ 25*13,17*8 get cGet0201 size 120,26 of oDlg update pixel @ 25*13,32*8 get cGet0202 size 120,26 of oDlg update pixel @ 25*13,47*8 get cGet0203 size 120,26 of oDlg update pixel @ 25*13,62*8 get cGet0204 size 120,26 of oDlg update pixel @ 25*13,77*8 get cGet0205 size 120,26 of oDlg update pixel //-* Row 3 @ 27*13,17*8 get cGet0301 size 120,26 of oDlg update pixel @ 27*13,32*8 get cGet0302 size 120,26 of oDlg update pixel @ 27*13,47*8 get cGet0303 size 120,26 of oDlg update pixel @ 27*13,62*8 get cGet0304 size 120,26 of oDlg update pixel @ 27*13,77*8 get cGet0305 size 120,26 of oDlg update pixel //-* Row 4 @ 29*13,17*8 get cGet0401 size 120,26 of oDlg update pixel @ 29*13,32*8 get cGet0402 size 120,26 of oDlg update pixel @ 29*13,47*8 get cGet0403 size 120,26 of oDlg update pixel @ 29*13,62*8 get cGet0404 size 120,26 of oDlg update pixel @ 29*13,77*8 get cGet0405 size 120,26 of oDlg update pixel //-* Row 5 @ 31*13,17*8 get cGet0501 size 120,26 of oDlg update pixel @ 31*13,32*8 get cGet0502 size 120,26 of oDlg update pixel @ 31*13,47*8 get cGet0503 size 120,26 of oDlg update pixel @ 31*13,62*8 get cGet0504 size 120,26 of oDlg update pixel @ 31*13,77*8 get cGet0505 size 120,26 of oDlg update pixel //-* Row 6 @ 33*13,17*8 get cGet0601 size 120,26 of oDlg update pixel @ 33*13,32*8 get cGet0602 size 120,26 of oDlg update pixel @ 33*13,47*8 get cGet0603 size 120,26 of oDlg update pixel @ 33*13,62*8 get cGet0604 size 120,26 of oDlg update pixel @ 33*13,77*8 get cGet0605 size 120,26 of oDlg update pixel //-* Row 7 @ 35*13,17*8 get cGet0701 size 120,26 of oDlg update pixel @ 35*13,32*8 get cGet0702 size 120,26 of oDlg update pixel @ 35*13,47*8 get cGet0703 size 120,26 of oDlg update pixel @ 35*13,62*8 get cGet0704 size 120,26 of oDlg update pixel @ 35*13,77*8 get cGet0705 size 120,26 of oDlg update pixel //-* Row 8 @ 37*13,17*8 get cGet0801 size 120,26 of oDlg update pixel @ 37*13,32*8 get cGet0802 size 120,26 of oDlg update pixel @ 37*13,47*8 get cGet0803 size 120,26 of oDlg update pixel @ 37*13,62*8 get cGet0804 size 120,26 of oDlg update pixel @ 37*13,77*8 get cGet0805 size 120,26 of oDlg update pixel //-* Row 9 @ 39*13,17*8 get cGet0901 size 120,26 of oDlg update pixel @ 39*13,32*8 get cGet0902 size 120,26 of oDlg update pixel @ 39*13,47*8 get cGet0903 size 120,26 of oDlg update pixel @ 39*13,62*8 get cGet0904 size 120,26 of oDlg update pixel @ 39*13,77*8 get cGet0905 size 120,26 of oDlg update pixel //-* Row 10 @ 41*13,17*8 get cGet1001 size 120,26 of oDlg update pixel @ 41*13,32*8 get cGet1002 size 120,26 of oDlg update pixel @ 41*13,47*8 get cGet1003 size 120,26 of oDlg update pixel @ 41*13,62*8 get cGet1004 size 120,26 of oDlg update pixel @ 41*13,77*8 get cGet1005 size 120,26 of oDlg update pixel //-* Row 11 @ 43*13,17*8 get cGet1101 size 120,26 of oDlg update pixel @ 43*13,32*8 get cGet1102 size 120,26 of oDlg update pixel @ 43*13,47*8 get cGet1103 size 120,26 of oDlg update pixel @ 43*13,62*8 get cGet1104 size 120,26 of oDlg update pixel @ 43*13,77*8 get cGet1105 size 120,26 of oDlg update pixel @ 50,20 button "&Ok" size 80,20 of oDlg ; action &#40;MsgInfo&#40;"You click OK button!"&#41;,oDlg&#58;End&#40;&#41;&#41; @ 50,40 button "&Cancel" size 80,20 of oDlg ; action &#40;MsgInfo&#40;"You click Cancel button!"&#41;,oDlg&#58;End&#40;&#41;&#41; ACTIVATE dialog oDlg ; ON INIT &#40; TScrDlg&#40;&#41;&#58;New&#40;oDlg,1,100,1,400&#41; &#41; RETURN&#40; NIL &#41; //============================================================================ // FileName &#58; SCROLL&#46;PRG // Purpose &#58; dialog Scroll Class // Author &#58; Eric Yang // Update History &#58; // Date Contents // ---------- --------------------------------------------------------------- // 1997&#46;02&#46;01 // //============================================================================ #include "FiveWin&#46;ch" #ifndef TRUE #define TRUE &#46;T&#46; #define FALSE &#46;F&#46; #endif CLASS TScrDlg DATA oDlg DATA nVPos,nHPos METHOD New&#40; oDlg,nV1,nV2,nH1,nH2 &#41; CONSTRUCTOR METHOD SetScroll&#40; nV1,nV2,nH1,nH2 &#41; //-*------------------------------------------------------------ METHOD VScroll&#40;&#41; METHOD VScrollThumb&#40;&#41; METHOD VScrollTrack&#40;&#41; METHOD VScrollPgDown&#40;&#41; METHOD VScrollPgUp&#40;&#41; //-*----------------------------- METHOD HScroll&#40;&#41; METHOD HScrollThumb&#40;&#41; METHOD HScrollTrack&#40;&#41; METHOD HScrollPgDown&#40;&#41; METHOD HScrollPgUp&#40;&#41; ENDCLASS METHOD New&#40; oDlg,nV1,nV2,nH1,nH2 &#41; CLASS TScrDlg &#58;&#58;nVPos &#58;= 0 &#58;&#58;nHPos &#58;= 0 &#58;&#58;oDlg &#58;= oDlg &#58;&#58;SetScroll&#40; nV1,nV2,nH1,nH2 &#41; RETURN Self METHOD SetScroll&#40; nV1,nV2,nH1,nH2 &#41; CLASS TScrDlg LOCAL aCoors1&#58;=&#123;&#125;,aCoors2&#58;=&#123;&#125; //-------------------------------------------------- //-* Vertical Scroll Bar // ? &#58;&#58;oDlg&#58;oVSCroll=NIL if &#58;&#58;oDlg&#58;oVScroll != NIL // ? nV1,nV2 &#58;&#58;oDlg&#58;oVScroll&#58;SetRange&#40; nV1,nV2 &#41; &#58;&#58;nVPos &#58;= &#58;&#58;oDlg&#58;oVScroll&#58;GetPos&#40;&#41; &#58;&#58;oDlg&#58;oVScroll&#58;bGoDown &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bGoUp &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bPageUp &#58;= &#123;|| &#58;&#58;VScrollPgUp&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bPageDown &#58;= &#123;|| &#58;&#58;VScrollPgDown&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bGoTop &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bGoBottom &#58;= &#123;|| &#58;&#58;VScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;nPgStep &#58;= 10 //&#58;&#58;oDlg&#58;oVScroll&#58;lReDraw &#58;= TRUE &#58;&#58;oDlg&#58;oVScroll&#58;bPos &#58;= &#123;|nPos| &#58;&#58;VScrollThumb&#40;nPos&#41; &#125; &#58;&#58;oDlg&#58;oVScroll&#58;bTrack &#58;= &#123;|nPos| &#58;&#58;VScrollTrack&#40;nPos&#41; &#125; endif //-------------------------------------------------- //-* Horizontal Scroll Bar if &#58;&#58;oDlg&#58;oHScroll != NIL &#58;&#58;oDlg&#58;oHScroll&#58;SetRange&#40; nH1,nH2 &#41; &#58;&#58;nHPos &#58;= &#58;&#58;oDlg&#58;oHScroll&#58;GetPos&#40;&#41; &#58;&#58;oDlg&#58;oHScroll&#58;bGoDown &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bGoUp &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bPageUp &#58;= &#123;|| &#58;&#58;HScrollPgUp&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bPageDown &#58;= &#123;|| &#58;&#58;HScrollPgDown&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bGoTop &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bGoBottom &#58;= &#123;|| &#58;&#58;HScroll&#40;&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;nPgStep &#58;= 10 //&#58;&#58;oDlg&#58;oHScroll&#58;lReDraw &#58;= TRUE &#58;&#58;oDlg&#58;oHScroll&#58;bPos &#58;= &#123;|nPos| &#58;&#58;HScrollThumb&#40;nPos&#41; &#125; &#58;&#58;oDlg&#58;oHScroll&#58;bTrack &#58;= &#123;|nPos| &#58;&#58;HScrollTrack&#40;nPos&#41; &#125; endif //&#58;&#58;oDlg&#58;bKeyChar &#58;= &#123;|nKey,nFlags| ScrollKey&#40;nKey&#41; &#125; //-------------------------------------------------- RETURN&#40; NIL &#41; //STATIC FUNCTION ScrollKey&#40;nKey&#41; //MsgInfo&#40; "Key &#58; "+str&#40;nKey,10&#41; &#41; //if nKey == K_ENTER // goMainDlg&#58;End&#40;&#41; // lRetVal &#58;= TRUE //endif //RETURN&#40; NIL &#41; //================================================================= //-* Vertical Scroll Bar METHOD VScroll&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nVPos >= &#58;&#58;oDlg&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oDlg&#58;oVScroll&#58;nMax nNewPos &#58;= &#58;&#58;oDlg&#58;oVScroll&#58;GetPos&#40;&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos-nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollThumb&#40;nNewPos&#41; CLASS TScrDlg if &#58;&#58;nVPos >= &#58;&#58;oDlg&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oDlg&#58;oVScroll&#58;nMax &#58;&#58;oDlg&#58;oVScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, 0, ; &#40;&#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollTrack&#40;nNewPos&#41; CLASS TScrDlg if &#58;&#58;nVPos >= &#58;&#58;oDlg&#58;oVScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nVPos <= &#58;&#58;oDlg&#58;oVScroll&#58;nMax &#58;&#58;oDlg&#58;oVScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, 0, ; &#40;&#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollPgDown&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nVPos < &#58;&#58;oDlg&#58;oVScroll&#58;nMax nNewPos &#58;= &#58;&#58;nVPos + &#58;&#58;oDlg&#58;oVScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos > &#58;&#58;oDlg&#58;oVScroll&#58;nMax, &#58;&#58;oDlg&#58;oVScroll&#58;nMax, nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD VScrollPgUp&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nVPos > &#58;&#58;oDlg&#58;oVScroll&#58;nMin nNewPos &#58;= &#58;&#58;nVPos - &#58;&#58;oDlg&#58;oVScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos < &#58;&#58;oDlg&#58;oVScroll&#58;nMin,&#58;&#58;oDlg&#58;oVScroll&#58;nMin,nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, 0, ; &#40; &#58;&#58;nVPos - nNewPos &#41;*D_HEIGHT, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nVPos &#58;= nNewPos endif RETURN&#40; NIL &#41; //================================================================= //-* Horizontal Scroll Bar METHOD HScroll&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nHPos >= &#58;&#58;oDlg&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oDlg&#58;oHScroll&#58;nMax nNewPos &#58;= &#58;&#58;oDlg&#58;oHScroll&#58;GetPos&#40;&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollThumb&#40;nNewPos&#41; CLASS TScrDlg if &#58;&#58;nHPos >= &#58;&#58;oDlg&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oDlg&#58;oHScroll&#58;nMax &#58;&#58;oDlg&#58;oHScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollTrack&#40;nNewPos&#41; CLASS TScrDlg if &#58;&#58;nHPos >= &#58;&#58;oDlg&#58;oHScroll&#58;nMin ; &#46;and&#46; &#58;&#58;nHPos <= &#58;&#58;oDlg&#58;oHScroll&#58;nMax &#58;&#58;oDlg&#58;oHScroll&#58;SetPos&#40;nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, ; &#40;&#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollPgDown&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nHPos < &#58;&#58;oDlg&#58;oHScroll&#58;nMax nNewPos &#58;= &#58;&#58;nHPos + &#58;&#58;oDlg&#58;oHScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos > &#58;&#58;oDlg&#58;oHScroll&#58;nMax, &#58;&#58;oDlg&#58;oHScroll&#58;nMax, nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, ; &#40; &#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; METHOD HScrollPgUp&#40;&#41; CLASS TScrDlg LOCAL nNewPos if &#58;&#58;nHPos > &#58;&#58;oDlg&#58;oHScroll&#58;nMin nNewPos &#58;= &#58;&#58;nHPos - &#58;&#58;oDlg&#58;oHScroll&#58;nPgStep nNewPos &#58;= iif&#40;nNewPos < &#58;&#58;oDlg&#58;oHScroll&#58;nMin,&#58;&#58;oDlg&#58;oHScroll&#58;nMin,nNewPos&#41; SysRefresh&#40;&#41; ScrollWindow&#40; &#58;&#58;oDlg&#58;hWnd, ; &#40; &#58;&#58;nHPos - nNewPos &#41;*D_WIDTH,0, ; 0 , GetClientRect&#40;&#58;&#58;oDlg&#58;hWnd&#41; &#41; &#58;&#58;nHPos &#58;= nNewPos endif RETURN&#40; NIL &#41; //=* End of File ================================================= procedure AppSys // Xbase++ requirement return [/code:1ndu8jar] Regards, Rossine.
oMeta difference FW & FWH?
Marc, > Do you have a solution for creating 'bigger' meta-files. We may need to create a larger hDC in memory. Several functions should be used. We are going to review it
oMeta difference FW & FWH?
Thanks Rossine, I'ts working very nice. I will try to 'translate' my program to draw directly to the window and display the drawing instead of painting first to a meta-file and than displaying it. Regards, Marc
oMeta difference FW & FWH?
Very good! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oMiBase:zap() me da error SOLUCIONADO
Hola a todos: Amigos uso en estas lineas oMiBase:zap(), pero me genera error. Alguna sugerencia? Codigo: oMibase:Tmov():New(, liquida,,.f.) //exclusiva If oMiBase:Use() If oMiBase:lock() oMiBase:zap() Else MsgInfo("no exclu") Endif Else MsgInfo("No use") Endif Saludos y gracias. Ruben D. Fernandez
oMiBase:zap() me da error SOLUCIONADO
Ruben, Que error te genera ?
oMiBase:zap() me da error SOLUCIONADO
Antonio el error que tengo es DBF/CDX, dice que no tengo la base abierta exclusiva y yo creo que si. Gracias Saludos
oMiBase:zap() me da error SOLUCIONADO
[code=fw:3lhh8de5]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE MIBASE EXCLUSIVE <span style="color: #00C800;">NEW</span><br /><br />__ZAP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:3lhh8de5]
oMiBase:zap() me da error SOLUCIONADO
Si, gracias, pero con Tdatabase me genera error en la linea 177 de Database.prg Saludos y gracias.
oMiBase:zap() me da error SOLUCIONADO
Ruben, Quita el If oMiBase:lock() Y intenta nuevamente.
oMiBase:zap() me da error SOLUCIONADO
Kleyber, EXCELENTE. Funcionó, muc has gracias. Saludos Ruben Fernandez
oPanel with Vscroll and Hscroll RESOLVED!!
I need to insert on a dialog a Panel with Vscroll and Hscroll to insert some bitmpas into I wish have on orizontal and vertical scroll only for the tpanel When I create the panel the scrollbar are not created I use the class TScrWnd() to create vscroll and hscroll this the small test I made [code=fw:1onotm9i]<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: #00D7D7;">#define</span> COLORE_SABBIA    nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">187</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">static</span> TOTY , TOTX, oScrWnd,cDbfPath,cIniFile<br /><br /><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Local</span> oDlg,oPanel<br /><br />  cDbfPath    := cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  + <span style="color: #ff0000;">"Data<span style="color: #000000;">\"</span><br />   cIniFile    := cFilePath( GetModuleFileName( GetInstance() ) ) + "</span>Beach.ini<span style="color: #ff0000;">"<br />   cBackBrush  := GetIni( cInifile, "</span>Beach<span style="color: #ff0000;">", "</span>BackBmp<span style="color: #ff0000;">", "</span>.\<span style="color: #0000ff;">bitmaps</span>\spiaggia.bmp<span style="color: #ff0000;">" )<br />   TOTX        :=  40<br />   TOTY        :=  20<br /><br /><br /><br /><br />DEFINE DIALOG oDlg  SIZE 1100,700  TRANSPARENT;<br />    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;<br />              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )<br /><br />ACTIVATE DIALOG oDlg CENTERED ;<br />   ON INIT  (oPanel:=CreatePanel( oDlg),;<br />   oScrWnd:=TScrWnd():New( oPanel,1,TOTY,1,TOTX))<br />RETURN NIL<br />///-------------------------------------------------------------------/<br />Function CreatePanel( oDlg)<br /> local oPanel,oBrushSabbia,oBtn<br /> local nSplit:=175<br /> DEFINE BRUSH oBrush1 COLOR COLORE_SABBIA<br /><br />oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570<br />oPanel:= TPanel():New(40,nSplit+5,oDlg:nbottom-50,oDlg:nWidth-50,oDlg)<br />oPanel:SetBrush(oBrush1)<br />oPanel:WinStyle(WS_BORDER, .t.)<br />oPanel:WinStyle(WS_VSCROLL, .t.)<br />oPanel:WinStyle(WS_HSCROLL, .t.)<br /><br />@ 10,10 BTNBMP oBtn;<br /> SIZE oPanel:nWidth, 50 PIXEL;<br />         FLAT ;<br />        PROMPT "</span>e<span style="color: #ff0000;">" RIGHT;<br />        OF oPanel <br /><br />return oPanel<br /><br /><br /><br />FUNCTION GetIni( cIni, cSection, cEntry, xDefault )<br /><br />   LOCAL oIni<br />   LOCAL xVar := xDefault<br /><br />  // DEFAULT cIni := oApp:cIniFile<br /><br />   INI oIni FILE cIni<br />      GET xVar            ;<br />         SECTION cSection ;<br />         ENTRY cEntry     ;<br />         DEFAULT xDefault ;<br />         OF oIni<br />   ENDINI<br /><br />   RETURN xVar</span></div>[/code:1onotm9i] the scrollPanel class create only with Vertical scroll ?
oPanel with Vscroll and Hscroll RESOLVED!!
resolved ! I used tscrollpanel and tscrdlg together
oPen with printer
If i define a pen with DEFINE PEN.... then the width of pen are different in methods fron tPrinter()! oPrn:Box( nZeile+nPenw/2,nPenw/2,nNextzeile,oPrn:nHorzRes()-nPenw/2, oPen) oPrn:line(nZeile,linksrand,nZeile,rechtsrand,oPen)
oPen with printer
[code=fw:y68nv8q8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Relatório do Certificado do Aluno"</span> PREVIEW <span style="color: #0000ff;">MODAL</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontDisc <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-10</span> BOLD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont &nbsp; &nbsp; <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-10</span> BOLD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontSubl <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-10</span> BOLD UnderLine <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontList <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-22</span> BOLD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> PEN oPen1 WIDTH <span style="color: #000000;">12</span> <span style="color: #0000ff;">COLOR</span> CLR_HBLUE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">12</span> <span style="color: #0000ff;">COLOR</span> CLR_AMARELO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> PEN oPen3 WIDTH &nbsp;<span style="color: #000000;">4</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oPrn<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <span style="color: #B900B9;">//->Folha A4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">SetPortrait</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//->Vertical</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; ResLinha &nbsp;:= oPrn:<span style="color: #000000;">nLogPixely</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>/<span style="color: #000000;">2.54</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ResColuna := oPrn:<span style="color: #000000;">nLogPixelx</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>/<span style="color: #000000;">2.54</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PAGE</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLinTopLog1 := &nbsp;<span style="color: #000000;">0.90</span> <span style="color: #B900B9;">//->Lado de Cima &nbsp; - Topo - Inicio</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nColTopLog1 := &nbsp;<span style="color: #000000;">0.50</span> <span style="color: #B900B9;">//->Lado Esquerdo &nbsp;- Inicio</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLinBotLog1 := <span style="color: #000000;">14.60</span> <span style="color: #B900B9;">//->Final da Linha - Lado de Baixo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nColBotLog1 := <span style="color: #000000;">20.50</span> <span style="color: #B900B9;">//->Final do Logo &nbsp;- Lado Direito</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLinTopLog2 := &nbsp;<span style="color: #000000;">1.20</span> <span style="color: #B900B9;">//->Lado de Cima &nbsp; - Topo - Inicio</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nColTopLog2 := &nbsp;<span style="color: #000000;">0.70</span> <span style="color: #B900B9;">//->Lado Esquerdo &nbsp;- Inicio</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLinBotLog2 := <span style="color: #000000;">14.40</span> <span style="color: #B900B9;">//->Final da Linha - Lado de Baixo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nColBotLog2 := <span style="color: #000000;">20.30</span> <span style="color: #B900B9;">//->Final do Logo &nbsp;- Lado Direito</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">&#40;</span> @nLinTopLog1, @nColTopLog1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">cmtr2Pix</span><span style="color: #000000;">&#40;</span> @nLinBotLog1, @nColBotLog1 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span> nLinTopLog1, nColTopLog1, nLinBotLog1, nColBotLog1, oPen1 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">&#40;</span> @nLinTopLog2, @nColTopLog2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">cmtr2Pix</span><span style="color: #000000;">&#40;</span> @nLinBotLog2, @nColBotLog2 <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span> nLinTopLog2, nColTopLog2, nLinBotLog2, nColBotLog2, oPen2 <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:y68nv8q8] Regards. 
oPen with printer
How the pen is created in the source code ?
oPen with printer
DEFINE PEN oPen1 WIDTH nPixel COLOR CLR_HBLUE
oPen with printer
Try DEFINE PEN oPen1 WIDTH nPixel COLOR CLR_HBLUE OF oPrn
oPen with printer
Also with the clausula "OF oPrn" the oPrn:line and oPrn:box are different!
oPicture:SaveImage does not work
Here is a sample of the code I used. It generated only an empty file of 0 bytes. Someone an idea of what I am doing wrong.[code:3cxx66ut]Static Function LoadJpg&#40;oPicture,cId&#41; cId &#58;= Trim&#40;cId&#41; + "&#46;JPG" oPicture&#58;LoadFromClipboard&#40;&#41; oPicture&#58;Refresh&#40;&#41; Return Nil Static Function SaveJpg&#40;oPicture,cId&#41; cId &#58;= Trim&#40;cId&#41; oPicture&#58;SaveImage&#40;cId,2,25&#41; Return Nil[/code:3cxx66ut] Thanks Willy
oPicture:SaveImage does not work
Use this modified SaveImage() method: [code:21c7elx7]METHOD SaveImage&#40; cFile, nFormat, nQuality &#41; CLASS TImage // 0 -> Bmp // 2 -> Jpg // 13 -> Png local hDib &#58;= DibFromBitmap&#40; &#58;&#58;hBitmap &#41; local cTempFile &#58;= cTempFile&#40;&#41; local lSaved DibWrite&#40; cTempFile, hDib &#41; GloBalFree&#40; hDib &#41; lSaved = FISaveImg&#40; cTempFile, cFile, nFormat, nQuality &#41; FErase&#40; cTempFile &#41; return lSaved[/code:21c7elx7] EMG
oPicture:SaveImage does not work
Hello, I was aleady using this version of this method. However I have copied it. The result is the same. There is a JPG file created from 0 bytes. I use the freeimage.dll from 4SEP2005 19h01 from 1032 Kb. This is the one that is delivered with the latest FWH Thanks, Willy
oPicture:SaveImage does not work
I think I found an error in the tImage class. In the header the method SaveImage does not mention the nQuality parameter. The method however has the third parameter. However this does not change the result. I've tried the program also on a Vista PC. There is a difference. On that pc there is no file added. On a Xp PC there is a file created with 0 bytes Bey Willy
oPicture:SaveImage does not work
Sorry, it is working fine here. I don't know why it does't work for you. EMG
oPicture:SaveImage does not work
Thanks for trying. Antonio, do you have any idea. Willy
oPopUp in class btnbmp
[quote="karinha":6sdm17s9]Dear Silvio, here you made it PUBLIC as well. The moment you post a source code on FORUM, the source code belongs to all FIVEWIN users. It's the rules, if you understand that you won't be able to fit the forum rules, feel free to stay or leave honorably. Estimado Silvio, aquí lo hiciste PÚBLICO también. En el momento en que publica un código fuente en FORUM, el código fuente pertenece a todos los usuarios de FIVEWIN. Son las reglas, si entiendes que no podrás ajustarte a las reglas del foro, siéntete libre de quedarte o irte honorablemente. [url:6sdm17s9]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=42263&sid=c80da79f41eccdffd408d2a6abdc50d2[/url:6sdm17s9] Gracias, thanks. Regards, saludos.[/quote:6sdm17s9] [b:6sdm17s9]I Know well the forum rules[/b:6sdm17s9] every now and then in this forum some characters come out who believe themselves masters on earth and on the world and also professors who are experts in the rules of the fivetech software forum and we seniors have to succumb on that topic I not see that function in my message but only on your message , you published a not mine function [b:6sdm17s9]I sent you via private mai[/b:6sdm17s9]l!!! the function is of [b:6sdm17s9]José Luis Sánchez of Alanit Software[/b:6sdm17s9] and integrated on Tinforme class
oPopUp in class btnbmp
I often use btnBmp: oPopUp, but in the button the horizontal space reserved for the PopUp is tight. It is possible in future versions to have a variable to fix the width directly in the btnbmp class. prg? (Now I modified the btnbmp.prg class to enlarge it) Maurizio
oPopUp in class btnbmp
Dear Maurizio, Would you mind to post here your modifications ? many thanks
oPopUp in class btnbmp
As you did? Show us, using this template, please. ¿Como tú hiciste? Muéstranos, usando esta plantilla, por favor. [code=fw:14eoe3ct]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\PICTCOLO.PRG</span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlg , oMenuPop, oBtnX, oBtnX2, <span style="color: #0000ff;">MENU</span>, oFont, aGrad<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nColor1 := CLR_BLACK<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nColor2 := CLR_WHITE<br /><br />&nbsp; &nbsp;SET _3DLOOK <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;SetBalloon<span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;SkinButtons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenuPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"First "</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"first"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Second "</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"second"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Colores "</span> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> PicKColors<span style="color: #000000;">&#40;</span> oBtnx, oDlg,, <span style="color: #ff0000;">"gray"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp;aGrad := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.30</span>, CLR_WHITE, CLR_HCYAN <span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.50</span>, CLR_WHITE, CLR_HCYAN <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont &nbsp;<span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Ms Sans Serif"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">00</span>, <span style="color: #000000;">-16</span> BOLD<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">400</span> &nbsp;<span style="color: #0000ff;">PIXEL</span> TRUEPIXEL RESIZABLE &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Tavolozza colori numeri"</span> GRADIENT aGrad <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">lhelpIcon</span> := .F.<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">BTNBMP</span> oBtnx <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT NOBORDER &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Color"</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\f</span>loppy.bmp"</span> BOTTOM &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> nColor1, nColor2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> PicKColors<span style="color: #000000;">&#40;</span> oBtnx, oDlg,, <span style="color: #ff0000;">"gray"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oPopup</span> := oMenuPop<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">50</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">BTNBMP</span> oBtnx2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT NOBORDER &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\E</span>xit.bmp"</span> BOTTOM &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> CLR_BLACK, nRgb<span style="color: #000000;">&#40;</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">219</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBtnX2:<span style="color: #000000;">lCancel</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />&nbsp; &nbsp;oFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> PicKColors<span style="color: #000000;">&#40;</span> ocontrol, oParent, lHex, cColore <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlgSel, oPanel<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aColors := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aReturnvalue := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nSelection := <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> &nbsp;lHex := .F.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgSel <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp;oDlgSel:<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;= nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_BORDER, WS_VISIBLE, WS_POPUP <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgSel <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: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:14eoe3ct] Gracias, thanks. Regards, saludos.
oPopUp in class btnbmp
Karinha Please erase the [b:1bqkoai9]FUNCTION AdjustWnd( oBtn, nWidth, nHeight )[/b:1bqkoai9] we havent the autorization to publish it !!!
oPopUp in class btnbmp
[quote="Silvio.Falconi":36b2uqr2]Karinha Please erase the [b:36b2uqr2]FUNCTION AdjustWnd( oBtn, nWidth, nHeight )[/b:36b2uqr2] we havent the autorization to publish it !!![/quote:36b2uqr2] Dear Silvio, I didn't know that you were the owner of this function, since he is PUBLIC. But it's ok, I removed it. I don't agree with your position, but it's done. Estimado Silvio, no sabía que eras el dueño de esta función, ya que es PÚBLICO. Pero está bien, lo eliminé. No estoy de acuerdo con tu posición, pero ya está hecho. Look at the function here: Mira la función aquí: [url:36b2uqr2]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=2&t=1170&p=3643&hilit=+dificil+aprendizado+[/url:36b2uqr2] Is it good for you like this? ¿Te hace bien así? Regards, saludos.
oPopUp in class btnbmp
Dear Silvio, here you made it PUBLIC as well. The moment you post a source code on FORUM, the source code belongs to all FIVEWIN users. It's the rules, if you understand that you won't be able to fit the forum rules, feel free to stay or leave honorably. Estimado Silvio, aquí lo hiciste PÚBLICO también. En el momento en que publica un código fuente en FORUM, el código fuente pertenece a todos los usuarios de FIVEWIN. Son las reglas, si entiendes que no podrás ajustarte a las reglas del foro, siéntete libre de quedarte o irte honorablemente. [url:qk55gcb2]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=42263&sid=4be501ba081a38054668e56d743cf050[/url:qk55gcb2] Gracias, thanks. Regards, saludos.
oPopUp in class btnbmp
Dear Silvio, function AdjustWnd() is public on github posted by Jose Luis: [url:knxdk4td]https&#58;//github&#46;com/JoseluisSanchez/colossus/blob/0dcf9170fb24c33dd973520097f39a5e3d1d4780/prg/ut_common&#46;prg[/url:knxdk4td] Lets try to help Maurizio here, thanks
oPopUp in class btnbmp
[quote="Antonio Linares":2rt50ijv]Dear Silvio, function AdjustWnd() is public on github posted by Jose Luis: [url:2rt50ijv]https&#58;//github&#46;com/JoseluisSanchez/colossus/blob/0dcf9170fb24c33dd973520097f39a5e3d1d4780/prg/ut_common&#46;prg[/url:2rt50ijv] Lets try to help Maurizio here, thanks[/quote:2rt50ijv] Antonio, Te expliqué en privado. josè de alanit si bien ha publicado sus fuentes de github no ha liberado ningún tipo de licencia y eso quiere decir que en realidad no tenemos el permiso para publicarlas en un foro público [img:2rt50ijv]https&#58;//i&#46;postimg&#46;cc/90dRtxdv/hhhhh&#46;png[/img:2rt50ijv] Tuve un pseudo problema con btnbmp unos días (ver atrás [url:2rt50ijv]https&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=42263&sid=a4880c7facc5b2f5f8af8d234ff88a47[/url:2rt50ijv]), luego me di por vencido y ahora uso un control tget
oPopUp in class btnbmp
[quote="Maurizio":3sy2n0zr]I often use btnBmp: oPopUp, but in the button the horizontal space reserved for the PopUp is tight. It is possible in future versions to have a variable to fix the width directly in the btnbmp class. prg? (Now I modified the btnbmp.prg class to enlarge it) Maurizio[/quote:3sy2n0zr] Sorry Mauri, I not understood, are you talking about space see orange arrow? [img:3sy2n0zr]https&#58;//i&#46;postimg&#46;cc/4xw02BLR/JJ&#46;png[/img:3sy2n0zr] I think you must modify PaintPopupSection() method
oPopUp in class btnbmp
I use April 2022 to June 2022 the changes I made are : line 18 [b:3ot26frw]#define POPWIDTH 30 //12[/b:3ot26frw] new variable in line 129 [b:3ot26frw]DATA nWide_P [/b:3ot26frw] set variable line 325 [b:3ot26frw] ::nWide_P := 22[/b:3ot26frw] and line 503 [b:3ot26frw] ::nWide_P := 22[/b:3ot26frw] Line 525 [b:3ot26frw] If( oPopup != nil, ::nWide_P, 0 ) [/b:3ot26frw]//// My_modi If( oPopup != nil, 13, 0 ) Line 578 //::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + 13 + 1 [b:3ot26frw] ::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + ::nWide_P + 1[/b:3ot26frw] Line 1062 //if nCol >= ::nWidth() - 13 [b:3ot26frw] if nCol >= ::nWidth() - ::nWide_P[/b:3ot26frw] Line 2079 //MoveTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), 1 ) //LineTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), nHeight - 1 ) [b:3ot26frw] MoveTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), 1 ) LineTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), nHeight - 1 )[/b:3ot26frw] SelectObject( hDC, hDarkPen ) //MoveTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), 1 ) //LineTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), nHeight - 1 ) [b:3ot26frw] MoveTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), 1 ) LineTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), nHeight - 1 )[/b:3ot26frw] Maurizio
oPopUp in class btnbmp
Dear Maurizio, good morning would you mind to post the complete PRG here ? many thanks
oPopUp in class btnbmp
[quote="Maurizio":v0wjv1rp]I use April 2022 to June 2022 the changes I made are : line 18 [b:v0wjv1rp]#define POPWIDTH 30 //12[/b:v0wjv1rp] new variable in line 129 [b:v0wjv1rp]DATA nWide_P [/b:v0wjv1rp] set variable line 325 [b:v0wjv1rp] ::nWide_P := 22[/b:v0wjv1rp] and line 503 [b:v0wjv1rp] ::nWide_P := 22[/b:v0wjv1rp] Line 525 [b:v0wjv1rp] If( oPopup != nil, ::nWide_P, 0 ) [/b:v0wjv1rp]//// My_modi If( oPopup != nil, 13, 0 ) Line 578 //::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + 13 + 1 [b:v0wjv1rp] ::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + ::nWide_P + 1[/b:v0wjv1rp] Line 1062 //if nCol >= ::nWidth() - 13 [b:v0wjv1rp] if nCol >= ::nWidth() - ::nWide_P[/b:v0wjv1rp] Line 2079 //MoveTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), 1 ) //LineTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), nHeight - 1 ) [b:v0wjv1rp] MoveTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), 1 ) LineTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), nHeight - 1 )[/b:v0wjv1rp] SelectObject( hDC, hDarkPen ) //MoveTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), 1 ) //LineTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), nHeight - 1 ) [b:v0wjv1rp] MoveTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), 1 ) LineTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), nHeight - 1 )[/b:v0wjv1rp] Maurizio[/quote:v0wjv1rp] I hae another release and not found th eline number you wrote
oPopUp in class btnbmp
Dear Silvio, Thats why I asked Maurizio to post the complete PRG <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oPopUp in class btnbmp
[quote="Antonio Linares":1l86xllc]Dear Silvio, Thats why I asked Maurizio to post the complete PRG <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:1l86xllc] I asked now via private mail ...same question
oPopUp in class btnbmp
Antonio btnbmp.prg the files is too big the forum will not accept it, I'll send it to your mail Maurizio
oPrinter:SayBitmap() print-quality
Hi, I'm using oPrinter:SayBitmap() for printing bitmaps. What is the best resolution to make nice printouts. If the print-layout should be ex. 10cm x 5cm, what is the best size for the BMP-file? 1000px x 500px the have a nice printout without deformation like my example? Now I have the original file like this [img:1ckj44qt]http&#58;//www&#46;vms&#46;be/FW/Origineel&#46;bmp[/img:1ckj44qt] But, If I print it to a PDF-prrinter (or normal printer) , the result is like this (it's zoomed to let you see better the problem) [img:1ckj44qt]http&#58;//www&#46;vms&#46;be/FW/Geprint&#46;GIF[/img:1ckj44qt] Thanks,
oPrinter:SayBitmap() print-quality
Try oPrinter:SayImage(...) for better quality
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Hola a todos, He observado que cuando pinto un bitmap (se observa mejor en los bitmaps grandes) con oPrinter:SayBitMap() de la clase TPrinter se me produce una fuga de memoria. Lo observo con un una utilidad de sistema que me va diciendo la memoria usada en %. Cuando el .bmp es pequeño, al ser un % pequeño no se observa, pero cuando se hace la operacion varias veces o el bitmap es grande entonces se ve que la memoria no es released hasta que se sale del programa. Entiendo que este no debe ser el comportamiento de GlobalAlloc()/ GlobalFree() La verdad es que me corre prisa solucionarlo. Agradecido de antemano siquiera por alguna pista. Anexo metodo (original) TPrinter():SayBitMap (Fwh 7.12/ xHarbour 1.0). [code=fw:22ccl15g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SayBitmap<span style="color: #000000;">&#40;</span> nRow, nCol, xBitmap, nWidth, nHeight, nRaster <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TPrinter<br /><br />   <span style="color: #00C800;">local</span> hDib, aBmpPal, hBitmap, hPalette<br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">hDC</span> = <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"N"</span> <span style="color: #000000;">&#41;</span> .or. ! File<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />      aBmpPal  = PalBmpLoad<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />      hBitmap  = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />      hPalette = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />      hDib   = DibFromBitmap<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />      PalBmpFree<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      hDib = DibRead<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> hDib == <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMeta</span><br />      hPalette = DibPalette<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   DibDraw<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDCOut</span>, hDib, hPalette, nRow, nCol,;<br />            nWidth, nHeight, nRaster <span style="color: #000000;">&#41;</span><br /><br />   GlobalFree<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMeta</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> hPalette <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:22ccl15g] Saludos
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Hola, Dejo como test del problema el TestPrn2.Prg que demuestra lo que digo: la pérdida/ fuga de memoria. La memoria se recupera solo al salir del programa. El problema se puede comprobar más facilmente imprimiendo pocos bitmaps, cuando el bitmap es grande, o bien, si es pequeño, imprimiendo muchas veces el bitmap. [code=fw:146xbc3c]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// Samples\TestPrn2.Prg</span><br /> <span style="color: #00C800;">function</span> TestPerdidaDeMemoria<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oPrn, oFont<br />   <span style="color: #00C800;">local</span> nRowStep, nColStep<br />   <span style="color: #00C800;">local</span> nRow := <span style="color: #000000;">0</span>, nCol := <span style="color: #000000;">0</span>, n, m<br />   <span style="color: #00C800;">Local</span> nMio<br />   <br />   <span style="color: #00C800;">IF</span> !File<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>ivewin.bmp"</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Se necesita ..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>ivewin.bmp para hacer el test !!"</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">ENDIF</span><br />   <br />   <span style="color: #B900B9;">// PrnSetSize( 2100, 1200 )     To adjust a different printer paper size!</span><br /><br />   <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Testing the printer object from FiveWin"</span> PREVIEW<br /><br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> oPrn:<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>          <span style="color: #B900B9;">// Printer was not installed or ready</span><br />      <span style="color: #00C800;">endif</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;">"Ms Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-12</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br />      nRowStep = oPrn:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">20</span>   <span style="color: #B900B9;">// We want 20 rows</span><br />      nColStep = oPrn:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">15</span>   <span style="color: #B900B9;">// We want 15 cols</span><br />      <span style="color: #00C800;">for</span> nMio:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">400</span><br />      <span style="color: #0000ff;">PAGE</span><br />         oPrn:<span style="color: #000000;">SayBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>ivewin.bmp"</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span>  <span style="color: #B900B9;">// rows</span><br />             nCol = <span style="color: #000000;">0</span><br />             oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> nRow, nCol, Str<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oFont <span style="color: #000000;">&#41;</span><br />             nCol += nColStep<br />             <span style="color: #00C800;">for</span> m = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">15</span><br />                oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> nRow, nCol, <span style="color: #ff0000;">"+"</span>, oFont <span style="color: #000000;">&#41;</span><br />                nCol += nColStep<br />             <span style="color: #00C800;">next</span><br />             nRow += nRowStep<br />         <span style="color: #00C800;">next</span><br />         oPrn:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nRow, nCol <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDPAGE</span><br />      <span style="color: #00C800;">next</span><br />      <span style="color: #00C800;">for</span> nMio:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">400</span><br />      <span style="color: #0000ff;">PAGE</span><br />         nRow = <span style="color: #000000;">0</span><br />         oPrn:<span style="color: #000000;">SayBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\f</span>ivewin.bmp"</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span>  <span style="color: #B900B9;">// rows</span><br />             nCol = <span style="color: #000000;">0</span><br />             oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> nRow, nCol, Str<span style="color: #000000;">&#40;</span> n + <span style="color: #000000;">20</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, oFont <span style="color: #000000;">&#41;</span><br />             nCol += nColStep<br />             <span style="color: #00C800;">for</span> m = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">15</span><br />                oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> nRow, nCol, <span style="color: #ff0000;">"+"</span>, oFont <span style="color: #000000;">&#41;</span><br />                nCol += nColStep<br />             <span style="color: #00C800;">next</span><br />             nRow += nRowStep<br />         <span style="color: #00C800;">next</span><br />         oPrn:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nRow, nCol <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">ENDPAGE</span><br />      <span style="color: #00C800;">next</span><br /><br />   <span style="color: #0000ff;">ENDPRINT</span><br /><br />   oFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>      <span style="color: #B900B9;">// Destroy the font object</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:146xbc3c] Saludos
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
A. Prueba asi: [code=fw:3s0gf32e]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ...     <br />&nbsp; &nbsp; &nbsp; aBmpPal  = PalBmpLoad<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />      hBitmap  = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />      hPalette = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />      hDib   = DibFromBitmap<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />      <span style="color: #B900B9;">// PalBmpFree( hBitmap, hPalette )</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> hBitmap <span style="color: #000000;">&#41;</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> hPalette <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ...<br /> </div>[/code:3s0gf32e]
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, Muchas gracias por responder. Lamentablemente [b:1dgxfv0z]no[/b:1dgxfv0z] ha funcionado. Lo he probado con PalBmpRead() puesto que tengo el bitmap en disco. Aquí te dejo como ha quedado el metodo despues de las modificaciones: [code=fw:1dgxfv0z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> SayBitmap<span style="color: #000000;">&#40;</span> nRow, nCol, xBitmap, nWidth, nHeight, nRaster <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TPrinter<br /><br />   <span style="color: #00C800;">local</span> hDib, aBmpPal, hBitmap, hPalette<br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">hDC</span> = <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"N"</span> <span style="color: #000000;">&#41;</span> .or. ! File<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />      aBmpPal  = PalBmpLoad<span style="color: #000000;">&#40;</span> xBitmap <span style="color: #000000;">&#41;</span><br />      hBitmap  = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />      hPalette = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />      hDib     = DibFromBitmap<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />      PalBmpFree<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      ******** Yo uso <span style="color: #0000ff;">bitmaps</span> desde fichero .bmp **********<br /><span style="color: #B900B9;">//      hDib = DibRead( xBitmap )</span><br />      aBmpPal  = PalBmpRead<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">hdc</span>,  xBitmap <span style="color: #000000;">&#41;</span><br />      hBitmap  = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />      hPalette = aBmpPal<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />      hDib     = DibFromBitmap<span style="color: #000000;">&#40;</span> hBitmap, hPalette <span style="color: #000000;">&#41;</span><br />      DeleteObject<span style="color: #000000;">&#40;</span>hBitMap<span style="color: #000000;">&#41;</span><br />      DeleteObject<span style="color: #000000;">&#40;</span>hPalette<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> hDib == <span style="color: #000000;">0</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMeta</span><br />      hPalette = DibPalette<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   DibDraw<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDCOut</span>, hDib, hPalette, nRow, nCol,;<br />             nWidth, nHeight, nRaster <span style="color: #000000;">&#41;</span><br /><br />   GlobalFree<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMeta</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> hPalette <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1dgxfv0z] Yo no se manejar el API Win32, y por eso quiza diga una tonteria: ¿ puede ser que la memoria no se libere hasta que el dispositivo ::hdcout sea released y si el dispositivo no es released entonces por eso queda la memoria pillada ? A este tema le he dado mil vueltas, dentro de mis limitaciones, y no he conseguido hasta ahora sacarle punta. Saludos
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
A. Podemos seguir haciendo otras pruebas. Comenta esta línea y prueba a ver si hay algún cambio: // DibDraw( ::hDCOut, hDib, hPalette, nRow, nCol,; // nWidth, nHeight, nRaster ) gracias
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, [quote="Antonio Linares":28cztjpu]A. Podemos seguir haciendo otras pruebas. Comenta esta línea y prueba a ver si hay algún cambio: // DibDraw( ::hDCOut, hDib, hPalette, nRow, nCol,; // nWidth, nHeight, nRaster ) gracias[/quote:28cztjpu] Comentando la funcion DibDraw(): [b:28cztjpu]NO[/b:28cztjpu] dibuja nada y [b:28cztjpu]NO[/b:28cztjpu] hay escape de memoria Me encantaria seguir haciendo otras pruebas hasta dar con la tecla. Gracias
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Como compruebas la pérdida de memoria ? El código fuente de DibDraw() está en FWH\source\winapi\dib.c pero no reserva/libera memoria.
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, La memoria, además de con GlobalMemoryStatusEx(), lo compruebo con una utilidad externa. Ambos devuelven siempre el mismo %, con lo que imagino que esta bien. En todo caso, cuando la carga de memoria es muy alta..., no se el %, entonces empieza a no pintar los bitmaps, como si no tuviese memoria... con lo que me lleva a pensar que ese % de memoria da un dato "bueno". [code=fw:3bceoysk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcomp.h"</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">&#40;</span> GLOBALMEMORYSTATUSEX  <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   MEMORYSTATUSEX mst;<br />   long nMem = hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>;<br /><br />   mst.dwLength = sizeof<span style="color: #000000;">&#40;</span> MEMORYSTATUSEX <span style="color: #000000;">&#41;</span>;<br />   GlobalMemoryStatusEx<span style="color: #000000;">&#40;</span> &mst <span style="color: #000000;">&#41;</span>;<br /><br />   <span style="color: #00C800;">switch</span><span style="color: #000000;">&#40;</span> nMem <span style="color: #000000;">&#41;</span><br />   <span style="color: #000000;">&#123;</span><br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">0</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.dwMemoryLoad            <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>; <span style="color: #B900B9;">// <- Con este compruebo la memoria usada (en %)</span><br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">1</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullTotalPhys            <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">2</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullAvailPhys            <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">3</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullTotalPageFile        <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">4</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullAvailPageFile        <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">5</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullTotalVirtual         <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">6</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullAvailVirtual         <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">case</span> <span style="color: #000000;">7</span>:  hb_retnd<span style="color: #000000;">&#40;</span> mst.ullAvailExtendedVirtual <span style="color: #000000;">&#41;</span> ; <span style="color: #00C800;">break</span>;<br />      <span style="color: #00C800;">default</span>: <span style="color: #000000;">hb_retnd</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /> </div>[/code:3bceoysk] Por decir algo: ¿ no sera que en DibDraw() algo se bloquea o queda sin release y eso impida a GlobalFree() hacer su trabajo ?
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
A. (Antonio, Adolfo, Alfonso... ?) <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Prueba a implementar la función DibDraw() en tu aplicación y asi puedes hacerle modificaciones. Añade este código al final de tu PRG principal: [code=fw:1tf82npf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">static</span> LPSTR DibBits<span style="color: #000000;">&#40;</span> LPBITMAPINFOHEADER lpBmp <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; LPSTR lpBits;<br />&nbsp; &nbsp; WORD &nbsp;wColors = DibNumColors<span style="color: #000000;">&#40;</span> lpBmp <span style="color: #000000;">&#41;</span>; <span style="color: #B900B9;">// wDIBColors( lpBmp );</span><br /><br />&nbsp; &nbsp; lpBits &nbsp;= <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>LPSTR<span style="color: #000000;">&#41;</span> lpBmp <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> DWORD <span style="color: #000000;">&#41;</span> lpBmp->biSize;<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> lpBmp->biSize == sizeof<span style="color: #000000;">&#40;</span> BITMAPCOREHEADER <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;lpBits += wColors * sizeof<span style="color: #000000;">&#40;</span> RGBTRIPLE <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp;lpBits += wColors * sizeof<span style="color: #000000;">&#40;</span> RGBQUAD <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> lpBits;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">static</span> BOOL DibDraw<span style="color: #000000;">&#40;</span> HDC hDC, HGLOBAL hDib, WORD wCol, WORD wRow,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HPALETTE hPalette, WORD wWidth, WORD wHeight, DWORD dwRop <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; LPBITMAPINFOHEADER lpBmp;<br />&nbsp; &nbsp; LPSTR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lpBits;<br />&nbsp; &nbsp; HPALETTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oldPal = <span style="color: #000000;">&#40;</span>HPALETTE<span style="color: #000000;">&#41;</span> <span style="color: #000000;">0</span>;<br />&nbsp; &nbsp; HBITMAP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmpOld;<br /><br />&nbsp; &nbsp; lpBmp = <span style="color: #000000;">&#40;</span> LPBITMAPINFOHEADER <span style="color: #000000;">&#41;</span> GlobalLock<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; dwRop = <span style="color: #000000;">&#40;</span> dwRop == <span style="color: #000000;">&#40;</span> DWORD <span style="color: #000000;">&#41;</span> <span style="color: #000000;">-1</span> ? SRCCOPY: <span style="color: #000000;">dwRop</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> lpBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;lpBits = DibBits<span style="color: #000000;">&#40;</span>lpBmp<span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> hPalette <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oldPal = SelectPalette<span style="color: #000000;">&#40;</span> hDC, hPalette, <span style="color: #00C800;">FALSE</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RealizePalette<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> wWidth == <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> || <span style="color: #000000;">&#40;</span> wHeight == <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SetDIBitsToDevice<span style="color: #000000;">&#40;</span> hDC, wCol, wRow, lpBmp->biWidth,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpBmp->biHeight, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpBmp->biHeight, lpBits, <span style="color: #000000;">&#40;</span> BITMAPINFO * <span style="color: #000000;">&#41;</span> lpBmp, DIB_RGB_COLORS <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;StretchDIBits<span style="color: #000000;">&#40;</span> hDC, wCol, wRow, wWidth, wHeight,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, lpBmp->biWidth, lpBmp->biHeight,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpBits, <span style="color: #000000;">&#40;</span> BITMAPINFO * <span style="color: #000000;">&#41;</span> lpBmp, DIB_RGB_COLORS, dwRop <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> oldPal <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectPalette<span style="color: #000000;">&#40;</span> hDC, oldPal, <span style="color: #00C800;">TRUE</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RealizePalette<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; GlobalUnlock<span style="color: #000000;">&#40;</span> hDib <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">TRUE</span>;<br />&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">FALSE</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> DIBDRAW <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ( hDC, hMemBitmap, hPalette, nRow, nCol, nWidth, nHeight, nRop )</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; HDC &nbsp; &nbsp; &nbsp; hDC &nbsp;= <span style="color: #000000;">&#40;</span> HDC <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; HGLOBAL &nbsp; hDib = <span style="color: #000000;">&#40;</span> HGLOBAL <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; HPALETTE &nbsp;hPal = <span style="color: #000000;">&#40;</span> HPALETTE <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> hDC && hDib <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;hb_retl<span style="color: #000000;">&#40;</span> DibDraw<span style="color: #000000;">&#40;</span> hDC, hDib, <span style="color: #000000;">&#40;</span> WORD <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> WORD <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>, hPal,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> WORD <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span> WORD <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> DWORD <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> void * <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> != <span style="color: #00C800;">NULL</span> ? <span style="color: #000000;">&#40;</span> DWORD <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span>: <span style="color: #000000;"><span style="color: #000000;">&#40;</span></span> DWORD <span style="color: #000000;">&#41;</span> <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br />&nbsp;</div>[/code:1tf82npf] Prueba a añadirlo a tu PRG y compueba si se compila bien y si funciona, gracias
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
A. de Antonio <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> He puesto el codigo que me has enviado y he probado y todo sigue igual (sigue consumiendo memoria). Luego he probado a comentar la StretchDIBits( ) y entonces he observado que [b:1dmips6q]NO[/b:1dmips6q] pinta nada pero [b:1dmips6q]NO[/b:1dmips6q] consume memoria. [code=fw:1dmips6q]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; StretchDIBits( hDC, wCol, wRow, wWidth, wHeight, 0, 0, lpBmp->biWidth, lpBmp->biHeight,</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lpBits, ( BITMAPINFO * ) lpBmp, DIB_RGB_COLORS, dwRop );</span><br />&nbsp;</div>[/code:1dmips6q]
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, Bueno, lo importante es que ya sabemos de donde viene el problema: función StretchDIBits(). Ahora pensemos una estrategia... Miremos por ejemplo el código que use Wine para la función StretchDIBits(): [url:3kas59ld]http&#58;//cvs&#46;winehq&#46;org/cvsweb/wine/dlls/gdi/Attic/dib&#46;c?rev=1&#46;22&content-type=text/x-cvsweb-markup[/url:3kas59ld]
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Buscando en google veo que otros programadores (en otros lenguajes) han tenido problemas tambien con esta función: [url:o0tr6mqn]http&#58;//stackoverflow&#46;com/questions/8036855/how-to-handle-gdi-resource-leak[/url:o0tr6mqn] Quizá eso nos de una pista de por donde buscar...
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, Si no haces el PREVIEW (quitando esa clausula), se produce la misma pérdida ? gracias por tus pruebas,
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, RESPUESTA 1: Pues siento decirte que creo que [b:1zhqf62c]NO[/b:1zhqf62c] es la StretchDIBits() porque si modifico lo que me has mandado y pongo: [code=fw:1zhqf62c]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br /><span style="color: #B900B9;">//        if( ( wWidth == 0 ) || ( wHeight == 0 ) )</span><br />        <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />           SetDIBitsToDevice<span style="color: #000000;">&#40;</span> hDC, wCol, wRow, lpBmp->biWidth,<br />                              lpBmp->biHeight, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<br />                              lpBmp->biHeight, lpBits, <span style="color: #000000;">&#40;</span> BITMAPINFO * <span style="color: #000000;">&#41;</span> lpBmp, DIB_RGB_COLORS <span style="color: #000000;">&#41;</span>;<br />        <span style="color: #00C800;">else</span><br /><span style="color: #B900B9;">//           StretchDIBits( hDC, wCol, wRow, wWidth, wHeight,</span><br /><span style="color: #B900B9;">//                          0, 0, lpBmp->biWidth, lpBmp->biHeight,</span><br /><span style="color: #B900B9;">//                          lpBits, ( BITMAPINFO * ) lpBmp, DIB_RGB_COLORS, dwRop );</span><br />...<br /> </div>[/code:1zhqf62c] Entonces la imagen [b:1zhqf62c]SI[/b:1zhqf62c] se pinta, sin redimensionar (utilizando SetDIBitsToDevice()), pero [b:1zhqf62c]SI[/b:1zhqf62c] hay fuga de memoria. ¿ Sera por alguna funcion comun para SetDIBitsToDevice() y StretchDIBits() ? RESPUESTA 2: Linea ! digo bingo ! Sin preview [b:1zhqf62c]NO[/b:1zhqf62c] hay fuga.
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, Encontrado el problema; resulta que yo utilizo una [u:4mnut7fq]RPreview[/u:4mnut7fq] modificada por algun compañero del foro, siento no recordar el nombre; es una [u:4mnut7fq]RPreview[/u:4mnut7fq] que lleva una [u:4mnut7fq]TListView[/u:4mnut7fq] con las miniaturas de las paginas. Pues bien, he puesto la preview original de fwh y YA [b:4mnut7fq]NO[/b:4mnut7fq] HAY CONSUMO DE MEMORIA !! Muchisimas gracias Antonio por tu ayuda, ha sido de gran valor. Feliz Navidad ! Saludos
oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Antonio, Me alegro de que el asunto quede resuelto <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
oPrinter:SetCopies(n)
Hola, Que estoy haciendo mal en este codigo para que no me funcione SetCopies() // ========= codigo ======== [code=fw:1u1vce3d]<div class="fw" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1">&nbsp;</li><li style="" class="li2">&nbsp; &nbsp; <span style="color: #008000;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Impresión de Recibo de Ventas"</span></li><li style="" class="li1">&nbsp; &nbsp; oPrn:<span style="">setcopies</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span></li><li style="" class="li2">&nbsp;</li><li style="" class="li1">&nbsp;</li><li style="" class="li2">&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PAGE</span></li><li style="" class="li1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPrn:<span style="">cmSay</span><span style="color: #000000;">&#40;</span>nRenglon, <span style="color: #000000;">000.000</span>, <span style="color: #000000;">&#40;</span>cClientes<span style="color: #000000;">&#41;</span>->Codigo, oFont9<span style="color: #000000;">&#41;</span></li><li style="" class="li2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRenglon += .<span style="color: #000000;">35</span></li><li style="" class="li1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPrn:<span style="">cmSay</span><span style="color: #000000;">&#40;</span>nRenglon, <span style="color: #000000;">000.000</span>, <span style="color: #000000;">&#40;</span>cClientes<span style="color: #000000;">&#41;</span>->Nombre, oFont9<span style="color: #000000;">&#41;</span></li><li style="" class="li2">&nbsp;</li><li style="" class="li1">&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDPAGE</span></li><li style="" class="li2">&nbsp; &nbsp;ENDPRINT</li><li style="" class="li1">&nbsp;</li></ol></div>[/code:1u1vce3d] Saludos, Mauricio
oPrinter:SetCopies(n)
Hello, somebody is using oPrn:SetCopies(2), it does not work to me in documents of a single page, Regards, Mauricio
oPrinter:SetCopies(n)
Mauricio, [quote="Mauricio":2yj1lmpj]somebody is using oPrn:SetCopies(2), it does not work to me[/quote:2yj1lmpj] I tried it long ago but found it doesn't work will ALL the printer drivers. In my tests I noticed that some other programs (Thunderbird for example) couldn't print multiple copies of the same document too (on those printers), so I gave up and choose to print the same job twice (in a loop). Hi, Davide
oPrn BOX ERROR
[img:1tge2hhs]https&#58;//i&#46;postimg&#46;cc/4d3VDDjc/jj&#46;jpg[/img:1tge2hhs] I need to make this box and put the text on one of 9 position Top left Top Right Top Center Bottom Left Bottom Right Bottom Center Left Right Center I tried the test of Nages but there is something not run ok I tried with BOx and Roundbox( with brush) ERROR : the text is never printed on the position I selected as you can see here [img:1tge2hhs]https&#58;//i&#46;postimg&#46;cc/P50k12yR/ggg&#46;png[/img:1tge2hhs] [b:1tge2hhs]this is the test[/b:1tge2hhs] [code=fw:1tge2hhs]<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 /><br /><br /><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> lPrv:=.t.<br /><span style="color: #00C800;">local</span> oBrush<br /><br /> <span style="color: #00C800;">local</span> nRow:= <span style="color: #000000;">5.5</span>                  ,;<br />            nCol:= <span style="color: #000000;">1</span>                ,;<br />            nHei:= nRow<span style="color: #000000;">+0.8</span>         ,;<br />            nWid:= <span style="color: #000000;">5.5</span>              ,;<br />            cFnt         := <span style="color: #ff0000;">"Arial"</span> ,;<br />            nSiz         := <span style="color: #000000;">6</span>       ,;<br />            lBold        := .T.     ,;<br />            lItalic      := .F.     ,;<br />            nColorFont   := CLR_WHITE ,;<br />            cAlign       := <span style="color: #ff0000;">"TL"</span>    ,;<br />            cTxt:=<span style="color: #ff0000;">"ABCDEFGH"</span><br /><br /><span style="color: #00C800;">local</span> oFnt<br /><span style="color: #00C800;">local</span> oPrn<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>ackgrnd<span style="color: #000000;">\p</span>ebbles.bmp"</span><br /><br />       oPrn:=PrintBegin<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Test Box and RoundBox"</span>,.F.,lPrv,,.T.<span style="color: #000000;">&#41;</span><br />       oPrn:<span style="color: #000000;">SetPortrait</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       PageBegin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />         CursorWait<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />         oFnt:=TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>cFnt,<span style="color: #000000;">0</span>,-nSiz,.F.,lBold,,,,lItalic,,,,,,,oPrn<span style="color: #000000;">&#41;</span><br /><br /><br />    <span style="color: #B900B9;">// first test</span><br /><br />         oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">&#40;</span>nRow,nCol,nHei,nWid,  <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #000000;">0.01</span> <span style="color: #000000;">&#125;</span>, CLR_HGRAY, ;<br />                   <span style="color: #000000;">&#123;</span> cTxt, oFnt, nColorFont, cAlign <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><br /><span style="color: #B900B9;">//Second Test</span><br />            nRow:= <span style="color: #000000;">9.5</span><br />            nCol:= <span style="color: #000000;">1</span><br />            nHei:= nRow<span style="color: #000000;">+0.8</span><br />            nWid:= <span style="color: #000000;">5.5</span><br /><br />  oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">&#40;</span>nRow,nCol,nHei,nWid,.<span style="color: #000000;">5</span>, .<span style="color: #000000;">5</span>, <span style="color: #000000;">&#123;</span> CLR_HRED, <span style="color: #000000;">0.01</span> <span style="color: #000000;">&#125;</span>, oBrush, ;<br />                  <span style="color: #000000;">&#123;</span> cTxt, oFnt, nColorFont, cAlign<span style="color: #000000;">&#125;</span>, ;<br />                  <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">&#41;</span><br /><br /><br />  oFnt:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br />       PageEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      PrintEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CursorArrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:1tge2hhs]
oPrn BOX ERROR
This works from FWH2007 onwards.
oPrn BOX ERROR
[quote="nageswaragunupudi":30qxsjd2]This works from FWH2007 onwards.[/quote:30qxsjd2] Now I don't remember what version I probably have here in the office I haven't updated the system
oPrn BOX ERROR
[quote="Silvio.Falconi":3t2g6j3x][quote="nageswaragunupudi":3t2g6j3x]This works from FWH2007 onwards.[/quote:3t2g6j3x] Now I don't remember what version I probably have here in the office I haven't updated the system[/quote:3t2g6j3x] however it is even stranger because I took a test and it worked, at least at home Buit I resolved see the email pls
oPrn BOX ERROR
[quote="nageswaragunupudi":2tju76gd]This works from FWH2007 onwards.[/quote:2tju76gd] Nages, I make a check on fwh April on function TxtInRct( hDC, aRect, aText ) there is a[b:2tju76gd] ""[/b:2tju76gd] ( school office version) on fwh May and June 2020 on function TxtInRct( hDC, aRect, aText ) there is a[b:2tju76gd] aRect[4] [/b:2tju76gd] ( home version) how do you tell me that this change[b:2tju76gd] is from the july (20.07) version?[/b:2tju76gd] now I wish the applause of linossi ...
oPrn PREVIEW en Apaisado pero imprime en Vertical
Buenas. Tengo un Informe en apaisado que lo visualiza perfectamente , pero al imprimir desde el propio preview, opción file-> print que permite seleccionar el rango de paginas a imprimir, lo hace en vertical aunque este activado, vertical/horizontal automatico en la propiedades de la impresora. Tengo que "obligarla" en las propiedades a Horizontal para que lo haga. Hay algún truco para que respete esta instrucción oPrn:SetLandScape() e imprima EN PAPEL como se ve en el modo PREVIEW ¿? [code=fw:1b4f0bn5]<div class="fw" id="{CB}" style="font-family: monospace;">  <br /> <span style="color: #00C800;">If</span> upper<span style="color: #000000;">&#40;</span>cPreview<span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"SI"</span><br />      <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Listado Capitulos por OBRA "</span> PREVIEW <br />   <span style="color: #00C800;">else</span><br />      <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Listado Capitulos por OBRA"</span> <br />   End <span style="color: #00C800;">If</span><br /><br />   oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Papel A4==>9</span><br />   oPrn:<span style="color: #000000;">SetLandScape</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Orientacion Apaisada</span><br /> </div>[/code:1b4f0bn5]
oPrn PREVIEW en Apaisado pero imprime en Vertical
Buenos días. He probado fwh/samples/tesrprn3.prg, y veo que en este ejemplo pasa lo mismo, por mucho que vea en pantalla en horizontal, imprime en vertical, (lo que tenga en las propiedades la impresora). por no perder mas tiempo, con la clase tReport pasa lo mismo ¿?. Muchas gracias por adelantado
oPrn PREVIEW en Apaisado pero imprime en Vertical
Si no te funciona, intenta poniéndolo dentro de la clausula PAGE [code=fw:tgosd2vv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PAGE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .../...<br />&nbsp;</div>[/code:tgosd2vv]