topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Bitmap-Format of Record-selector in xBrowse ?
|
Uwe,This is the code for the arrow:[code:2thd7xxj]
static far BYTE rarrow[] = {
0x42, 0x4D, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80,
0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00 };
CLIPPER FWRARROW( PARAMS ) // --> hBitmap
{
_retnl( ( LONG ) CreateMemBitmap( ( HDC ) 0, rarrow ) );
}
[/code:2thd7xxj]We get that array of bytes using Borland Resources Workshop (reviewing a bitmap as an array of bytes)
|
Bitmap-Format of Record-selector in xBrowse ?
|
You can create your own FWRARROW() that just loads a bitmap from your resources or from a bitmap file.
|
Bitmap/Icon associated with certain file
|
Dear all,
How to get the bitmap/icon for certain file?
say I want to get the bitmap/icon for file .doc or .xls.. or .pdf?
[img:13tw2u3e]http://i208.photobucket.com/albums/bb82/fraxzi/getbitmap.png[/img:13tw2u3e]
How to do it in FW/xHarbour?
Best regards,
Frances
|
Bitmap/Icon associated with certain file
|
Hello fraxzi
look here: [url:3374mqjf]http://forums.fivetechsupport.com/viewtopic.php?p=91422#p91422[/url:3374mqjf]
|
Bitmap/Icon associated with certain file
|
Hi Daniel,
Thank you so much! I'll start working with this.. I just want to display the icon/bitmap to column when user select file so associated icon/bitmap is displayed.
I will work on it.
Thank you and regards,
Frances
|
Bitmaped and transparent dialogs
|
Do you like them ? Do you want them for FW ?
Built with the upcoming FWH 2.7 February build:
[url=http://imageshack.us:24n5yjex][img:24n5yjex]http://img227.imageshack.us/img227/1041/image15lv.png[/img:24n5yjex][/url:24n5yjex]
|
Bitmaped and transparent dialogs
|
Great!
EMG
|
Bitmaped and transparent dialogs
|
Looks Great !!!
Rick Lipkin
SC Dept of Health, USA
|
Bitmaped and transparent dialogs
|
Antonio,
Did you figure out how to make the SAYs transparent without REDEFINING them all?
James
|
Bitmaped and transparent dialogs
|
Antonio you can create also dialogs with folder trasparent ?
I'd like see the source code here...
|
Bitmaped and transparent dialogs
|
James,
yes. We have implemented a C function that does it automatically. No need to REDEFINE the SAYs.
|
Bitmaped and transparent dialogs
|
Good news, and congratulations on solving that!
James
|
Bitmaped and transparent dialogs
|
Dear Antonio,
I hope you insert it on new release of fwh...
...and for a dialog with folders
|
Bitmaped and transparent dialogs
|
Work in progress...
[url=http://imageshack.us:1gjilzla][img:1gjilzla]http://img212.imageshack.us/img212/8904/image14gm.png[/img:1gjilzla][/url:1gjilzla]
|
Bitmaped and transparent dialogs
|
gooooood mr guru Antonio
|
Bitmaped and transparent dialogs
|
Transparency using XP themes <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
[url=http://imageshack.us:28rrz6q7][img:28rrz6q7]http://img59.imageshack.us/img59/4643/image10gd.png[/img:28rrz6q7][/url:28rrz6q7]
Thanks to Brian Hays for his great help on this!
|
Bitmaped and transparent dialogs
|
Dear my friend Antonio,
Can I see the source code to make dialog and folder trasparent ?
Regards
Silvio
|
Bitmaped and transparent dialogs
|
Silvio,
There are many changes. FWH 2.7 February build will provide them.
|
Bitmaped and transparent dialogs
|
Dear antonio,
I wrote you on privete email.
I hope you help me ..
|
Bitmaped and transparent dialogs
|
Antonio,
This is excellent. I have been looking for this since Fivewin 1.8.
Many years ago I hired several artists to make my applications look especially "pretty". I experimented with this concept, but ran into difficulties.
One problem I had was "re-using" a dialog. I could get it to display correctly the 1st time, but, if I ::end() the dialog and save the dialog object to an array to re-call at a later time, the dialog background would be "invisible" and the Windows desktop would bleed through on subsequent ::activate() commands.
Is it possible for you to test this and let me know the result.
As always, thanks much. I really appreciate the work you have done for all of us.
|
Bitmaped and transparent dialogs
|
If you issue oDlg:End() then you will have to recreate the DIALOG (DEFINE DIALOG etc.) again. You can't reuse an ended DIALOG.
EMG
|
Bitmaped and transparent dialogs
|
I have done this in the past. Each control needed to be "refreshed" in the initialization of the ::activate()
The reason I did this was due to many controls / folder pages, etc, which were created from data driven applications. The computers were much slower ( 386 speed ) and this saved lots of overhead.
Upon 're-activation' the controls worked fine, but, my dialog's background was "transparent".
Not an issue anymore - computers are much faster and no problem saving data-driven parms in an array and define / activate each time needed.
Things have come a long way, haven't they?
|
Bitmaped and transparent dialogs
|
I think it is not correct to reuse an ended DIALOG. You can hide it instead.
EMG
|
Bitmaped and transparent dialogs
|
Enrico,
I agree, but I think he is just saying that he is storing the parameters in an array, then reusing the parameters to define and acitvate the dialog each time. I guess this would be no different than rereading them from a resource file.
Don, am I right?
James
|
Bitmaped and transparent dialogs
|
Exactly -
For me, easier to store dialog parms in a database and build dynamically vs. create resource, manually code controls to variables. etc. Using a data dictionary for me, is cleaner - only one input program, only one browse/update program, etc.
|
Bitmaped and transparent dialogs
|
Don,
I am curious as to how you design the dialogs in the first place. Do you design them in Workshop or other, then read the resource file to create your database, or how?
James
|
Bitmaped and transparent dialogs
|
[quote="James Bott":2japoaec]Enrico,
I agree, but I think he is just saying that he is storing the parameters in an array, then reusing the parameters to define and acitvate the dialog each time. I guess this would be no different than rereading them from a resource file.
Don, am I right?
James[/quote:2japoaec]
It is still not correct. Ending a dialog means that the DialogBox Windows object is released and you can't use its handle anymore. If you want to use the dialog again you have to instantiate a new TDialog object.
EMG
|
Bitmaped and transparent dialogs
|
[quote="don lowenstein":1y10n8s4]Exactly -
For me, easier to store dialog parms in a database and build dynamically vs. create resource, manually code controls to variables. etc. Using a data dictionary for me, is cleaner - only one input program, only one browse/update program, etc.[/quote:1y10n8s4]
Are you saying that you issued DEFINE DIALOG etc. again with the same parameter of the first one? If yes then it's ok to do so. What you can't do is to end a dialog and then activate it again without defining it.
Regarding your main problem, try to build a reduced and self-contained sample.
EMG
|
Bitmapped buttons on dialogs
|
We need help to find why the bitmapped buttons on all the dialogs look wrong
Thanks!
|
Bitmaps
|
Hello to all hBmp := { ReadBitmap( 0, oPub:wPathBmp + "ABERTO.BMP" ),; ReadBitmap( 0, oPub:wPathBmp + "BAIXADO.BMP" ),; ReadBitmap( 0, oPub:wPathBmp + "DEVOLV.BMP" ),; ReadBitmap( 0, oPub:wPathBmp + "PENDE.BMP" ) } Which of the classes would the correct be to turn off the created bmps in the way above? DeleteObject( hBmp ) or ReleaseDC( hBmp ) or AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
|
Bitmaps
|
This is the correct way, assuming hBmp is the name of your array of bitmaps handles:[code:3eiz801k]AEval( hBmp, { | hBmp | DeleteObject( hBmp ) } )[/code:3eiz801k]EMG
|
Bitmaps
|
Ok Enrico tanks
|
Bitmaps - change bitmaps in memory
|
Hello,
is it possible to draw on a bitmap without showing the bitmap on the screen.
I mean only in memory and then save the changed bitmap.
Thanks in advance
Otto
|
Bitmaps and Button bars
|
I know there have been changes regarding bitmaps and buttonbars. I did a search but could not find topics on the changes. Here are my questions:
1) Is there a thread or two that discusses the newer capability of higher resolution, or alpha bitmap, button bars ?
2) What would be a good file in the samples folder of these capabilities
Thanks ... I'm using 9.05.
|
Bitmaps and Button bars
|
Hello Tim,
The example shows any Window-Background and a Buttonbar on Top.
Just define the Image ( Alpha-Blended BMP ) for the Buttonbar => FILE c_path + "\system\format.bmp"
I started with the Bar-Tools ( comes close to the Button-Tools ) there it is possible, to test
the Bar-Size and included BMP's, how they look together on a defined Window-Background.
Some nice Button-Sets will be included as well.
[img:1l1ss546]http://www.pflegeplus.com/pictures/ButtonbNew1.jpg[/img:1l1ss546]
[code=fw:1l1ss546]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oWnd, oBar, oImage, oBrush<br /><span style="color: #00C800;">LOCAL</span> oBButt1,oBButt2,oBButt3,oBButt4,oBButt5<br /><span style="color: #00C800;">LOCAL</span> oBButt6,oBButt7,oBButt8,oBButt9<br /><br />c_path := CURDRIVE<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + GETCURDIR() + "</span>\<span style="color: #ff0000;">"<br /><br />DEFINE CURSOR oCursorHand HAND<br />SetBalloon( .T. ) // Balloon shape required for tooltips<br /><br />W_LOGO := "</span>Background2.jpg<span style="color: #ff0000;">"<br />W_BRUSH := "</span>Gray.bmp<span style="color: #ff0000;">"<br />W_COLOR1 := 14853684 <br />W_COLOR2 := 16314573 <br />W_MOVE := 0.50 // Gradient 2. Color-Position<br />W_DIRECT := .T. // Horizontal<br /><br />nDESKTOP := 1<br /><br />// Desktop 1 = Image<br />// Desktop 2 = Image-Brush<br />// Desktop 3 = Gradient<br />// Desktop 4 = Color<br />// Desktop 5 = Style<br /><br />// Color<br />// -------<br />IF nDESKTOP = 4<br /> DEFINE BRUSH oBrush COLOR W_COLOR1<br />ENDIF<br /><br />// Style<br />// -------<br />IF nDESKTOP = 5<br /> IF W_STYLE = "</span>BRICKS<span style="color: #ff0000;">" <br /> DEFINE BRUSH oBrush STYLE "</span>BRICKS<span style="color: #ff0000;">"<br /> ENDIF<br /> IF W_STYLE = "</span>BORLAND<span style="color: #ff0000;">" <br /> DEFINE BRUSH oBrush STYLE "</span>BORLAND<span style="color: #ff0000;">"<br /> ENDIF<br /> IF W_STYLE = "</span>TILED<span style="color: #ff0000;">" <br /> DEFINE BRUSH oBrush STYLE "</span>TILED<span style="color: #ff0000;">"<br /> ENDIF<br />ENDIF<br /><br />// Brush<br />// -------<br />IF nDESKTOP = 2<br /> DEFINE BRUSH oBrush FILE c_path + "</span>\project\<span style="color: #ff0000;">" + W_BRUSH<br />ENDIF<br /><br />IF nDESKTOP = 1 .or. nDESKTOP = 3<br /> DEFINE WINDOW oWnd TITLE "</span>Test<span style="color: #ff0000;">" ;<br /> MDI MENU TMenu():New() <br />ENDIF<br />IF nDESKTOP = 2 .or. nDESKTOP = 4 .or. nDESKTOP = 5<br /> DEFINE WINDOW oWnd TITLE "</span>Test<span style="color: #ff0000;">" ;<br /> MDI MENU TMenu():New() BRUSH oBrush<br />ENDIF<br /><br />DEFINE BUTTONBAR oBar OF oWnd SIZE 95, 70 2007 TOP<br /><br />// Some Buttons ......<br /><br />DEFINE BUTTON oBButt1 OF oBar FILE c_path + "</span>\system\format.bmp<span style="color: #ff0000;">" MESSAGE "</span>Color-Background<span style="color: #ff0000;">" ;<br /> ACTION ( nSTYLE := 1, ;<br /> PROMPT "</span>Color-<span style="color: #0000ff;">Select</span><span style="color: #ff0000;">" <br /><br />oBButt1:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + ;<br /> "</span>Color-Background selected.<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>Please aktivate all Previews<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>with <span style="color: #0000ff;">Button</span> < Show All >, or<span style="color: #ff0000;">" + CRLF + ;<br /> "</span><span style="color: #0000ff;">select</span> a single <span style="color: #0000ff;">Dialog</span> <span style="color: #0000ff;">from</span> the<span style="color: #ff0000;">" + CRLF + ;<br /> "</span><span style="color: #0000ff;">right</span> <span style="color: #0000ff;">Buttonbar</span><span style="color: #ff0000;">", "</span>C o l o r - Background <span style="color: #ff0000;">", 1, 0, 128 }<br /><br />DEFINE BUTTON oBButt2 OF oBar FILE c_path + "</span>\system\format.bmp<span style="color: #ff0000;">" MESSAGE "</span>Gradient-Background<span style="color: #ff0000;">" ;<br /> ACTION ( nSTYLE := 2, ;<br /> PROMPT "</span>Gradient-<span style="color: #0000ff;">Select</span><span style="color: #ff0000;">" <br /><br />oBButt2:cToolTip := { "</span> <span style="color: #ff0000;">" + CRLF + ; <br /> "</span>Gradient-Background selected.<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>Please aktivate all Previews<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>with <span style="color: #0000ff;">Button</span> < Show All >, or<span style="color: #ff0000;">" + CRLF + ;<br /> "</span><span style="color: #0000ff;">select</span> a single <span style="color: #0000ff;">Dialog</span> <span style="color: #0000ff;">from</span> the<span style="color: #ff0000;">" + CRLF + ;<br /> "</span><span style="color: #0000ff;">right</span> <span style="color: #0000ff;">Buttonbar</span><span style="color: #ff0000;">", "</span>G r a d i e n t - Background<span style="color: #ff0000;">", 1, 0, 128 }<br /><br />...<br />...<br />...<br /><br />// Show Hand-Cursor on Caption<br />AEval( oBar:aControls, { | o | o:oCursor := oCursorHand } )<br /><br />SET MESSAGE OF oWnd TO "</span>Button-Test<span style="color: #ff0000;">" ;<br />CENTERED CLOCK KEYBOARD 2007<br /><br />ACTIVATE WINDOW oWnd MAXIMIZED ;<br />ON PAINT ( IIF( nDESKTOP = 1, WI_LOGO( oWnd, hDC ), NIL ), ; // Image<br /> IIF( nDESKTOP = 3, W_GRAD( oWnd, hDC ), NIL ) ) // Gradient<br /><br />RETURN NIL<br /><br />//--------- 1 ) W - LOGO ------------------------ <br /><br />STATIC FUNCTION WI_LOGO( oWnd, hDC ) <br />LOCAL oImage1<br />LOCAL nWidth := oWnd:nWidth()<br />LOCAL nHeight := oWnd:nHeight()<br /><br />DEFINE IMAGE oImage1 FILE c_path + "</span>\project\<span style="color: #ff0000;">" + W_LOGO <br />PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. ) <br />oWnd:ReleaseDC()<br /><br />RETURN NIL<br /><br />// --------- 3 ) GRADIENT -----------------------<br /><br />STATIC FUNCTION W_GRAD( oWnd, hDC )<br />LOCAL nWidth := oWnd:nWidth()<br />LOCAL nHeight := oWnd:nHeight()<br /><br />aGrad := { { W_MOVE, W_COLOR1, W_COLOR2 }, ; <br /> { W_MOVE, W_COLOR2, W_COLOR1 } } <br /><br />IF W_DIRECT = .T.<br /> GradientFill( hDC, 0, 0, nHeight, nWidth, aGrad, .T. )<br />ENDIF<br />IF W_DIRECT = .F.<br /> GradientFill( hDC, 0, 0, nHeight, nWidth, aGrad, .F. )<br />ENDIF<br />oWnd:ReleaseDC()<br /><br />RETURN NIL<br /><br /></span></div>[/code:1l1ss546]
|
Bitmaps and Button bars
|
Tim,
Alpha channel bitmaps are automatically detected and used from FWH.
All you have to do is to create an alpha channel bitmap and use it as you use other bitmaps.
You can find some alpha channel bitmaps in c:\FWH\bitmaps\AlphaBmp\*.bmp
|
Bitmaps and Button bars
|
Working on the Tools, I noticed after changing the Gradient, Style 2007 gets lost ?
Normal Buttonbar with Style 2007 and no Gradient change :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )
[img:10f6vzh1]http://www.pflegeplus.com/pictures/BBartest1.jpg[/img:10f6vzh1]
The same Buttonbar with Style 2007 and defined Gradient :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 TOP
oBar1:SetColor( D_TCOLOR )
oBar1:bClrGrad = { || { { D_MOVE, D_COLOR1, D_COLOR2 },;
{ D_MOVE, D_COLOR2, D_COLOR1 } } }
[img:10f6vzh1]http://www.pflegeplus.com/pictures/BBartest2.jpg[/img:10f6vzh1]
Style 2007 gets lost with the new Gradient-Define ?
RBest Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Bitmaps and Button bars
|
Thanks for the replies. I'm also reviewing the "whats new" notes ...
|
Bitmaps and Button bars
|
Tim,
Testing all possible Solutions I still found a wrong Position of the Buttonbar with :
DEFINE BUTTONBAR oBar1 OF oWnd1 SIZE D_BUTTONH, D_BUTTONV 3DLOOK 2007 [color=#FF0000:17s3ckf7]BOTTOM[/color:17s3ckf7]
The Bottom of the Buttonbar is covered with the Messagebar.
Bottom Buttonbar must be Top Messagebar.
[img:17s3ckf7]http://www.pflegeplus.com/pictures/BBartest3.jpg[/img:17s3ckf7]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Bitmaps desde Recursos
|
Holas a todos..
Tengo un BMP de 50 * 250
Lo incorpore a mi RC, en las propiedades, tambien tiene 50 * 250
Cree un Bitmap dentro de un dialogo, sus medidas tambien son de 50 * 250
Pero al mostrarlo en el dialogo ocupa el cuarto del tamaño asignado. ¿ PORQUE ?
Si le pongo la clausula ADJUST me llena el tamaño completo, pero se distorsiona...
Algun consejo... tip o algo por el estilo.
Ocupo Pelles C como editor y compilador de RC
Gracias de Antemano
Desde Chile
Adolfo
|
Bitmaps desde Recursos
|
Adolfo:
Tube un problema similar en mi anterior proyecto y encontre una clase que es modificación de la TImage: se llama tZoomImage, te dejo el fuente y el CH para que lo pruebes... Por cierto que es de la autoría de Jaime Irurzun.
zImage.Prg
[code=fw:3qpc00mj]<div class="fw" id="{CB}" style="font-family: monospace;"><br />**<br />* PROYECTO ...: <span style="color: #000000;">Clase</span> tZoomImage<br />* COPYRIGHT ..: <span style="color: #000000;"><span style="color: #000000;">(</span>c</span><span style="color: #000000;">)</span> Jaime Irurzun<br />**<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">CLASS</span> TZoomImage <span style="color: #0000ff;">FROM</span> TImage<br /><br /> CLASSDATA lRegistered AS LOGICAL<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">PAINT</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">/*_____________________________________________________________________________*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">PAINT</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TZoomImage<br /><br /> <span style="color: #B900B9;">// jaime 17.10.04</span><br /> <span style="color: #00C800;">LOCAL</span> nWBmp := nBmpWidth<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nHBmp := nBmpHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> aRect := GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nWidth := aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span> - aRect<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">LOCAL</span> nHeight := aRect<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> - aRect<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> <span style="color: #B900B9;">// fin jaime</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> .and. ! EMPTY<span style="color: #000000;">(</span> ::<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bPainted</span> != <span style="color: #00C800;">nil</span><br /> EVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">bPainted</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #B900B9;">// jaime 17.10.04</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">lStretch</span><br /> PALBMPDraw<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nX</span>, ::<span style="color: #000000;">nY</span>, ::<span style="color: #000000;">hBitmap</span>, ::<span style="color: #000000;">hPalette</span>,;<br /> nWidth, nHeight,, ::<span style="color: #000000;">lTransparent</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// (nClrPane) Added by RRR 23/04/01 07:58</span><br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nZoom</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">IF</span> nHBmp > nHeight .OR. nWBmp > nWidth<br /> <span style="color: #B900B9;">// si es más alta que ancha (o son iguales)</span><br /> <span style="color: #00C800;">IF</span> nHBmp >= nWBmp<br /> nWBmp := <span style="color: #000000;">(</span> nWBmp * nHeight <span style="color: #000000;">)</span> / nHBmp<br /> nHBmp := nHeight<br /> <span style="color: #B900B9;">// si el lado contrario ha quedado más grande, reajusto</span><br /> <span style="color: #00C800;">IF</span> nWBmp > nWidth<br /> nHBmp := <span style="color: #000000;">(</span> nHBmp * nWidth <span style="color: #000000;">)</span> / nWBmp<br /> nWBmp := nWidth<br /> <span style="color: #00C800;">ENDIF</span><br /> PALBMPDraw<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nX</span>, ::<span style="color: #000000;">nY</span>, ::<span style="color: #000000;">hBitmap</span>, ::<span style="color: #000000;">hPalette</span>,;<br /> nWBmp, nHBmp,, ::<span style="color: #000000;">lTransparent</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// (nClrPane) Added by RRR 23/04/01 07:58</span><br /> <span style="color: #B900B9;">// si es más ancha que alta</span><br /> <span style="color: #00C800;">ELSE</span><br /> nHBmp := <span style="color: #000000;">(</span> nHBmp * nWidth <span style="color: #000000;">)</span> / nWBmp<br /> nWBmp := nWidth<br /> <span style="color: #B900B9;">// si el lado contrario ha quedado más grande, reajusto</span><br /> <span style="color: #00C800;">IF</span> nHBmp > nHeight<br /> nWBmp := <span style="color: #000000;">(</span> nWBmp * nHeight <span style="color: #000000;">)</span> / nHBmp<br /> nHBmp := nHeight<br /> <span style="color: #00C800;">ENDIF</span><br /> PALBMPDraw<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nX</span>, ::<span style="color: #000000;">nY</span>, ::<span style="color: #000000;">hBitmap</span>, ::<span style="color: #000000;">hPalette</span>,;<br /> nWBmp, nHBmp,, ::<span style="color: #000000;">lTransparent</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// (nClrPane) Added by RRR 23/04/01 07:58</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ELSE</span><br /> PALBMPDraw<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nX</span>, ::<span style="color: #000000;">nY</span>, ::<span style="color: #000000;">hBitmap</span>, ::<span style="color: #000000;">hPalette</span>,;<br /> nWBmp, nHBmp,, ::<span style="color: #000000;">lTransparent</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// (nClrPane) Added by RRR 23/04/01 07:58</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #B900B9;">// fin jaime</span><br /><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bPainted</span> != <span style="color: #00C800;">nil</span><br /> EVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">bPainted</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3qpc00mj]
y el archivo de Cabecera ZIMAGE.CH
[code=fw:3qpc00mj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*----------------------------------------------------------------------------//<br />!short: ZoomImage */</span><br /><br />#xcommand <span style="color: #0000ff;">REDEFINE</span> ZoomImage <span style="color: #000000;">[</span> <oBmp> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">ID</span> <nId> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <of: <span style="color: #0000ff;">OF</span>, <span style="color: #0000ff;">WINDOW</span>, DIALOG> <oWnd> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <resource: <span style="color: #0000ff;">NAME</span>, <span style="color: #0000ff;">RESNAME</span>, RESOURCE> <cResName> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <file: <span style="color: #000000;">FILE</span>, FILENAME, DISK> <cBmpFile> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <lClick: <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ClICK</span>, <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">LEFT</span> CLICK> <uLClick> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <rClick: <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">RIGHT</span> CLICK> <uRClick> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <scroll: <span style="color: #000000;">SCROLL</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <adjust: <span style="color: #000000;">ADJUST</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">CURSOR</span> <oCursor> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">MESSAGE</span> <cMsg> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <update: <span style="color: #000000;">UPDATE</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">WHEN</span> <uWhen> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">VALID</span> <uValid> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <span style="color: #000000;">[</span> <oBmp> := <span style="color: #000000;">]</span> TZoomImage<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #0000ff;">ReDefine</span><span style="color: #000000;">(</span> <nId>, <cResName>, <cBmpFile>,;<br /> <oWnd>, <span style="color: #000000;">[</span>\<span style="color: #000000;">{</span> |nRow,nCol,nKeyFlags| <uLClick> \<span style="color: #000000;">}</span><span style="color: #000000;">]</span>,;<br /> <span style="color: #000000;">[</span>\<span style="color: #000000;">{</span> |nRow,nCol,nKeyFlags| <uRClick> \<span style="color: #000000;">}</span><span style="color: #000000;">]</span>,;<br /> <.<span style="color: #0000ff;">scroll</span>.>, <.<span style="color: #0000ff;">adjust</span>.>, <oCursor>, <cMsg>, <.<span style="color: #0000ff;">update</span>.>,;<br /> <<span style="color: #000000;">{</span>uWhen<span style="color: #000000;">}</span>>, <<span style="color: #000000;">{</span>uValid<span style="color: #000000;">}</span>> <span style="color: #000000;">)</span><br /> </div>[/code:3qpc00mj]
dentro de tu prg inclulles la definición a ZImage
[code=fw:3qpc00mj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FIVEWIN.CH"</span><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"ZIMAGE.CH"</span><br />...<br />...<br /><span style="color: #00C800;">Local</span> oBmp<br /><span style="color: #0000ff;">REDEFINE</span> ZOOMIMAGE oBmp <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDlg FILENAME <span style="color: #ff0000;">".<span style="color: #000000;">\L</span>LAVE.BMP"</span> <span style="color: #B900B9;">//Resource "LLAVE"</span><br /> </div>[/code:3qpc00mj]
Y dentro del Pelles C creas un nuevo control personalizado llamado "TZoomImage" con estilo de Ventana "0x50000000" y estilo de Ventana Extendido "0x00000000" y listo, no se si haya sido de tu ayuda, pero espero te funcione...
Saludos. <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: --> <!-- s:mrgreen: --><img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green" /><!-- s:mrgreen: -->
|
Bitmaps desde Recursos
|
Gracias Cuatecatl82
Pruebo y te comento...
Pero igual tengo la duda... porque la tbitmap no es capaz de mostrarlo como se debe, el tamaño de la imagen es identica a la del recurso, deberia cuadrar sin problemas...o no ?
Antonio.. algo tengo mal ?
Saludos y comento mis experiecias.
Desde Chile
Adolfo
|
Bitmaps desde Recursos
|
Cuatecatl82...
Pues no me resulto, sigue igual, y ademas con la clausula ADJUST. el Bitmap se ve deforme.
Antonio, Daniel, hay algun metodo para convertir el tamaño real de la imagen al tamaño que posee el recurso bitmap definido en el RC.
Hasta el momento voy probando medidas para ver si se ajustan, pero es un problema.
Repito la inquietud, Si el tamaño del Recurso es igual al del bitmap ( en pixeles ) Porque no se muestra completo ?
Desde Chile
Adolfo
PD: Recien cambiado completamente a HARBOUR 3 + BCC 5.8.2 + FWH 11.5 + Pelles C
|
Bitmaps desde Recursos
|
Hola
El tamano del recurso que ves en el pelles no esta en pixeles (son dpi), si quiers obtener le tamano en pixles tendras que modificarlo desde codigo
te dejo un ejemplo sencillo y para que compruebes lo que te comento,
[code=fw:2dyptiuz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span> <br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> <span style="color: #00C800;">local</span> oDlg, oBmp1<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Test"</span> <br /><br /> <span style="color: #0000ff;">REDEFINE</span> BITMAP oBmp1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BMPTEST"</span> <br /> <br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">(</span> GetClientRect<span style="color: #000000;">(</span> oBmp1:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBmp1:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> , , nBmpWidth<span style="color: #000000;">(</span> oBmp1:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span>, nBmpHeight<span style="color: #000000;">(</span> oBmp1:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2dyptiuz]
RC
[code=fw:2dyptiuz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.00".</span><br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <commctrl.h><br /><span style="color: #00D7D7;">#include</span> <richedit.h><br /><br />LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US<br /><br />TEST <span style="color: #0000ff;">DIALOG</span> DISCARDABLE <span style="color: #000000;">17</span>, <span style="color: #000000;">36</span>, <span style="color: #000000;">239</span>, <span style="color: #000000;">284</span><br /><span style="color: #0000ff;">STYLE</span> WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE<br />CAPTION <span style="color: #ff0000;">"Test"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">110</span>, <span style="color: #ff0000;">"TBitmap"</span>, 0x00000000, <span style="color: #000000;">4</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">200</span>, <span style="color: #000000;">239</span><br /> CONTROL <span style="color: #ff0000;">"Button"</span>, <span style="color: #000000;">111</span>, <span style="color: #ff0000;">"Button"</span>, WS_TABSTOP, <span style="color: #000000;">4</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /><span style="color: #000000;">}</span><br /><br />BMPTEST BITMAP <span style="color: #ff0000;">"007.bmp"</span><br /><br /> </div>[/code:2dyptiuz]
|
Bitmaps desde Recursos
|
Daniel..
Gracias por tu respuesta, ahora ya me queda mas claro...
Mira Aqui
[url:3nfviyet]http://tiporama.com/tools/pixels_inches.html[/url:3nfviyet]
Eso solo para empezar, asi que la cosa es un poco mas dificil, depende de la calidad del monitor, tamaño etc etc.
Asi que modifique los 3 tipos de bitmaps que usaba a tamaños "standard" para saber que tamaño usar en el RC.
Gracias, algo mas aprendi hoy.
Saludos
Desde Chile
Adolfo
|
Bitmaps desde Recursos
|
Adolfo prueba asi
REDEFINE IMAGE oBmp ID 200 OF odlg1 Resource "imagen UPDATE
oBmp:lTransparent:=.T.
ACTIVATE DIALOG oDlg1 Centered ON PAINT;
(DrawBitmap(oDlg1:hDC,oBmp:hBitmap,0,0,oDlg1:nWidth,oDlg1:nHeight),;
HollowText(oDlg1,5,200,"",oFont1,CLR_BLUE,2));
saludos
|
Bitmaps desde Recursos
|
JBrita
Gracias, pruebo y te comento
Desde Chile
Adolfo
|
Bitmaps en Header del TWBrowse
|
Hola a todos del foro
Como puedo poner bitmaps en el header del twbrowse de hernan, es que no tengo ningun ejemplo sobre ello.
Quiero que en una columna aparesca un bitmap con una señal que indique que esta ordenado por esa columna y si cambio de columna, el de la primera aparesca el bitmap desactivado, y la otra activado.
Gracias
Salu2
|
Bitmaps en Header del TWBrowse
|
Francis
aqui la respuesta por RF
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=151&highlight=">http://fivetechsoft.com/forums/viewtopi ... highlight=</a><!-- m -->
salu2
paco
|
Bitmaps en Header del TWBrowse
|
Hola a todos del foro
Gracias Paco, eso era lo que estaba buscando, y la verdad no recordaba en que parte del foro estaba.
Mil gracias nuevamente...
Salu2
Francis
|
Bitmaps en Menus. ¿Es posible?
|
Hola amigos
¿Es posible incorporar botones con bitmaps en Menu's ?
Aquí tienen un ejemplo de una demo de programa que usa este sistema.
[img:31a8k1ol]http://hyperupload.com/download/02293ced80/Dibujo.JPG.html[/img:31a8k1ol]
Saludos
Toni Sales
|
Bitmaps en Menus. ¿Es posible?
|
Toni,
Aún no lo hemos implementado en FWPPC.
|
Bitmaps en TXbrowse como funciona...
|
hola amigos del foro.
no logro poner un bitmaps en la TXBrowse cuando la muestro la informacion desde un array..
por favor alguien, tiene alguna idea de como hacerlo
Directo de la DBF, Funciona correctamente.
::oBrw := TXBrowse():New( ::oWnd )
::oBrw:cAlias := DBF_GIRBAN:cAlias
::oCol := Array( 01 )
::oCol[01] := ::oBrw:AddCol()
::oCol[01]:cHeader := "Conciliado"
::oCol[01]:AddResource( "CHECK_SI" )
::oCol[01]:AddResource( "CHECK_NO" )
::oCol[01]:bBmpData := { || IF( DBF_GIRBAN:ESTGIR == .T. , 1, 2) }
::oCol[01]:BStrData := { || "" }
::oCol[01]:nWidth := 60
::oBrw:CreateFromCode()
....
....
Desde un Array, NO muestra el BMP
WITH OBJECT ::oBrw
:SetArray( AR_DATOS, .T. )
WITH OBJECT :aCols[ ESTADO ]
:cHeader := "Conciliado"
:AddResource( "CHECK_SI" )
:AddResource( "CHECK_NO" )
:bBmpData := { || IF(Len(AR_DATOS) >0, (IF ( AR_DATOS[::oBrw:nArrayAt][ESTGIR] == .T. , 1, 2) ), NIL) }
:bStrData := { || ""}
:nWidth := 40
END
END
...
...
gracias
salu2
Mauro
|
Bitmaps en TsButton: M. Mercado
|
Saludos.
En cuestion de la clase de Mster. M. Mercado, tengo un detalle que no he podido resolver:
En un boton envio 2 bitmaps para que cambie al recibir el foco, pero ello solo con el mouse, que podre hacer para que al tener el foco cambie al segundo bitmap, sin uso del mouse. Mi fuente es:
#define COLOR_ACEPTA {|oBtn|If(oBtn:lMouseOver.or.oBtn:lFocused,COLOR_MAGENTA,If(oBtn:lPressed,COLOR_BLANCO,aCOLOR(10)))}
@ 0,nDer SBUTTON oBtn FILE 'LEVEL2.BMP','LEVEL1.BMP' OF oDLG SIZE 8,8;
ACTION (...)
COLOR COLOR_ACEPTA;
PIXEL
Tengo antes de este boton una serie de gets, y al llegar al oBtn como puedo hacer para que cambie al bitmap 2.
Gracias.
Fwh 8.11, xH 1.1, bcc 5.5
|
Bitmaps en el header de XBrwColumn
|
Cuando hacemos una columna cuyo header solo contiene un bitmap, se pinta mal. Como ejemplo modifique el Testxbrw.prg, en el ejemplo de bitmaps, la columna que dice CLIP y pone un clip. Quité la palabra "CLIP" quedando oCol:cHeader:= "", y queda así:
<!-- m --><a class="postlink" href="http://www.box.net/shared/y0fg7h9mq9">http://www.box.net/shared/y0fg7h9mq9</a><!-- m -->
Lo he corregido cambiando el siguiente código ( en PaintHeader )
[code:ya2iws5t]
if nBmpNo > 0 .and. nBmpNo <= len( ::aBitmaps )
aBitmap := ::aBitmaps[ nBmpNo ]
// nWidth -= aBitmap[ BITMAP_WIDTH ] -> quité esto
if Empty(cHeader)
nBmpCol := nCol + ( ( nWidth - aBitmap[ BITMAP_WIDTH ] ) / 2 )
elseif ::nHeadBmpAlign == AL_LEFT
nWidth -= aBitmap[ BITMAP_WIDTH ] // Agregué esto
nBmpCol := nCol
nCol += aBitmap[ BITMAP_WIDTH ] + BMP_EXTRAWIDTH
else
nWidth -= aBitmap[ BITMAP_WIDTH ] // Agregué esto
nBmpCol := nCol + nWidth
endif
nWidth -= BMP_EXTRAWIDTH
nBmpRow := ( nHeight - aBitmap[ BITMAP_HEIGHT ] ) / 2 + 4
PalBmpDraw( hDC, nBmpRow, nBmpCol,;
aBitmap[ BITMAP_HANDLE ],;
aBitmap[ BITMAP_PALETTE ],;
aBitmap[ BITMAP_WIDTH ],;
aBitmap[ BITMAP_HEIGHT ];
,, .t., aColors[ 2 ] )
endif
[/code:ya2iws5t]
Y asi funciona bien,
Saludos
|
Bitmaps en el header de XBrwColumn
|
Carlos,
Gracias!
|
Bitmaps en una Window
|
Antonio,
Este código:
[code:2t9rv20o]@ 000, 000 IMAGE oBmp NAME "LOGO" OF oWnd[/code:2t9rv20o]
Me da este error de compilación:
[quote:2t9rv20o] Creating library globalpda.lib and object globalpda.exp
globalpda.obj : error LNK2001: unresolved external symbol "void __cdecl HB_FUN_T
IMAGE(void)" (?HB_FUN_TIMAGE@@YAXXZ)
globalpda.exe : fatal error LNK1120: 1 unresolved externals
El sistema no puede hallar el archivo especificado.
* Application successfully built[/quote:2t9rv20o]
Y este código:
[code:2t9rv20o] @ 000, 000 BITMAP oBmp NAME "LOGO" OF oWnd[/code:2t9rv20o]
Me da el mensaje en ejecución "Not implemented yet: CreateDIBitmap"
¿Como puedo colocar un Bitmap (que está en recursos) a una Window?
Saludos,
José Luis Capel
|
Bitmaps en una Window
|
Jose Luis,
De momento hazlo como en el tutor11.prg. gracias.
|
Bitmaps en una Window
|
Antonio,
Gracias!!
Quedo a la espera de la implementación de bitmaps por recursos.
Saludos,
José Luis Capel
|
Bitmaps en una Window
|
Jose Luis,
De momento, desde recursos puedes usar botones TBtnBmp con imágenes desde recursos. Revisa el ejemplo samples\TestBmp.prg.
|
Bitmaps en una columna de xbrowse
|
Quizá esto sea muy sencillo, o ya esté en el foro, pero no pude encontrarlo.....
Lo que quiero es en un xbrowse una columna donde dependiendo del valor contenido en otra me presente un bmp diferente, vale decir, tengo 4 bmps, uno rojo, uno verde, uno amarillo y uno transparente.
Quiero colocar en la primer celda de cada línea un bmp que será verde, amarillo y rojo, dependiendo de un valor en otra celda de la misma línea si una variable estática ldesp está en .t., pero... si está en .f. no debe presentar nada o presentar un bmp transparente.
He estado trabajando para hacerlo, pero no me ha sido posible.... <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
Si alguien puede ayudarme en esto sería de gran valor, porque llevo varios días preparando esta consulta y es el único detalle que no sale. <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Gracias desde ya por la ayuda que puedan brindarme <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Bitmaps en una columna de xbrowse
|
José:
Te voy a mostrar un código que yo uso con un recordset pero la idea es la misma para DBFs
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:= oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"SI"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"NO"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Aut"</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>oRsPro:<span style="color: #000000;">BOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> .AND. oRsPro:<span style="color: #000000;">EOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">2</span>,IIF<span style="color: #000000;">(</span>oRsPro:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"PRO_AUT"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nDataBmpAlign</span> := AL_RIGHT<br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">25</span><br /> </div>[/code:2c1z74g7]
Lo destacable de este código es la parte donde se agregan los BMPs
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"SI"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"NO"</span><span style="color: #000000;">)</span><br /> </div>[/code:2c1z74g7]
que en tu caso debería ser
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Verde"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Amarillo"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Rojo"</span><span style="color: #000000;">)</span><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Transparente"</span><span style="color: #000000;">)</span><br /> </div>[/code:2c1z74g7]
y la prte donde se define cual BMP se debe presentar
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>oRsPro:<span style="color: #000000;">BOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> .AND. oRsPro:<span style="color: #000000;">EOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">2</span>,IIF<span style="color: #000000;">(</span>oRsPro:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"PRO_AUT"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2c1z74g7]
Me parece que te conviene usar una función que te devuelva el número BMP a mostrar
y te quedaría así:
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aCol<span style="color: #000000;">[</span> <span style="color: #000000;">5</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>oRsPro:<span style="color: #000000;">BOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> .AND. oRsPro:<span style="color: #000000;">EOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">2</span>,CualBmp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2c1z74g7]
Y la función CualBmp() debería ser + - así
[code=fw:2c1z74g7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> CualBmp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> nBmp := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /> <span style="color: #00C800;">CASE</span> Algo<br /> nBmp := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// Verde</span><br /> <span style="color: #00C800;">CASE</span> Algomas<br /> nBmp := <span style="color: #000000;">2</span> <span style="color: #B900B9;">// Amarillo</span><br /> <span style="color: #00C800;">CASE</span> Algomasmas<br /> nBmp := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// Rojo</span><br /> OTHERWHISE<br /> nBmp := <span style="color: #000000;">4</span> <span style="color: #B900B9;">// Transparente</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>nBmp<span style="color: #000000;">)</span><br /> </div>[/code:2c1z74g7]
Saludos
|
Bitmaps en una columna de xbrowse
|
Gracias Armando,
Lo pruebo y te comento el lunes!!!!!!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Bitmaps en una columna de xbrowse
|
Tal como lo dijeras, con unos pequeños retoques ha funcionado de maravillas!!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Muchas Gracias!!!!!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Bitmaps in Xbrowse
|
Hi,
I'm converting a listbox that used to contain bitmaps to an xBrowse.
Before, i used to create an array of bitmaps
[code=fw:2vyp6xuc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">PUBLIC</span> aPics := <span style="color: #000000;">{</span> ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"CHECKOFF"</span> <span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"CONFIRMED"</span><span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"CHECKON"</span> <span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"TRAXSENT"</span> <span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"TRAXFAIL"</span> <span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"TICKED"</span> <span style="color: #000000;">)</span> , ;<br /> LoadBitmap<span style="color: #000000;">(</span> GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"NOTTICKED"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2vyp6xuc]
and then just have a field in the listbox that called a function like this:
[code=fw:2vyp6xuc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> MdiConfirmed<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> aPics<span style="color: #000000;">[</span><span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>&cAlias.->CONFIRMED,<span style="color: #000000;">8</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span><br /> </div>[/code:2vyp6xuc]
I'm now trying to replicate this in an xBrowse, but all i get is a number appearing. The added problem i have, is that i give my customers the ability to define what appears and where it appears in the browse, so i can't hardcode that column 1 will be the bitmap
Thanks in advance
Pete
|
Bitmaps in Xbrowse
|
In XBrowse:
oBrw:aCols[ n ]:LoadResource( 'CHECKON' )
oBrw:aCols[ n ]:LoadResource( 'CHECKOFF' )
etc....
then
oBrw:aCols[n]:bBmpData := { || If( (oBrw:cAlias)->CONFIRMED, 1, 2 ) }
|
Bitmaps in Xbrowse
|
Still getting a number i'm afraid
Pete
|
Bitmaps in Xbrowse
|
Here is a working sample where my bitmaps are resources compiled in the .exe :
[code=fw:2s62bdjn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PCASIMPT"</span> ;<br /> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"N/W"</span> ;<br /> <span style="color: #0000ff;">TITLE</span> cTITLE ;<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbx1 ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">of</span> oDlg1 ;<br /> RECORDSET oRsImport ;<br /> COLUMNS <span style="color: #ff0000;">'load_row'</span>, ;<br /> <span style="color: #ff0000;">'name'</span>, ;<br /> <span style="color: #ff0000;">'pcas_date'</span>, ;<br /> <span style="color: #ff0000;">'clinic'</span>, ;<br /> <span style="color: #ff0000;">'location'</span>, ;<br /> <span style="color: #ff0000;">'program'</span>, ;<br /> <span style="color: #ff0000;">'activity'</span>, ;<br /> <span style="color: #ff0000;">'starttime'</span>, ;<br /> <span style="color: #ff0000;">'endtime'</span>, ;<br /> <span style="color: #ff0000;">'hours'</span>, ;<br /> <span style="color: #ff0000;">'service_type'</span>, ;<br /> <span style="color: #ff0000;">'rectype'</span>, ;<br /> <span style="color: #ff0000;">'unitid'</span>, ;<br /> <span style="color: #ff0000;">'system'</span> ;<br /> COLSIZES <span style="color: #000000;">30</span>,<span style="color: #000000;">125</span>,<span style="color: #000000;">75</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">47</span>,<span style="color: #000000;">47</span>,<span style="color: #000000;">47</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">70</span> ;<br /> HEADERS <span style="color: #ff0000;">'Load_row'</span>, ;<br /> <span style="color: #ff0000;">'Name'</span>, ;<br /> <span style="color: #ff0000;">'Service Date'</span>, ;<br /> <span style="color: #ff0000;">'Clinic'</span>, ;<br /> <span style="color: #ff0000;">'Location'</span>, ;<br /> <span style="color: #ff0000;">'Program'</span>, ;<br /> <span style="color: #ff0000;">'Activity'</span>, ;<br /> <span style="color: #ff0000;">'Start'</span>, ;<br /> <span style="color: #ff0000;">'End '</span>, ;<br /> <span style="color: #ff0000;">'Hours'</span>, ;<br /> <span style="color: #ff0000;">'Service Type'</span>, ;<br /> <span style="color: #ff0000;">'Record Type'</span>, ;<br /> <span style="color: #ff0000;">'Unit Type'</span>, ;<br /> <span style="color: #ff0000;">'System'</span> ;<br /> <span style="color: #0000ff;">ON</span> dblclick<span style="color: #000000;">(</span> _Recalc<span style="color: #000000;">(</span>oRsImport, oLbx1<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> FOOTERS LINES CELL<br /><br /> oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Hours"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">nTOTAL</span> := nHOURS<br /> oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Hours"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">lTOTAL</span> := .t.<br /> <br /> <span style="color: #00C800;">if</span> .not. Empty<span style="color: #000000;">(</span> oCol := oLbx1:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Load_row"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"CHECKON"</span>, <span style="color: #ff0000;">"CHECKOFF"</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cSortOrder</span> := <span style="color: #00C800;">nil</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> <span style="color: #B900B9;">// oCol:lBmpStretch = .T.</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBTN1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> <span style="color: #0000ff;">of</span> oDLG1 ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> _Loadum<span style="color: #000000;">(</span> oRsImport, oDlg1, oBtn3, cMODE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #00C800;">DEFAULT</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBTN2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">118</span> <span style="color: #0000ff;">of</span> oDLG1 ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDlg1:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">(</span> oLbx1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span><br /><br /> </div>[/code:2s62bdjn]
|
Bitmaps in Xbrowse
|
This is the code i'm using to build the columns:
[code=fw:3u4p3kqb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWndBrw <span style="color: #000000;">)</span><br /> ReBuildSched<span style="color: #000000;">(</span>.F., oBrw, oWndBrw, <span style="color: #00C800;">Self</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">bPopup</span> := <span style="color: #000000;">{</span> || SchedPopup<span style="color: #000000;">(</span>oBrw, ::<span style="color: #000000;">cScedAlias</span>, <span style="color: #00C800;">Self</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">IF</span> Alltrim<span style="color: #000000;">(</span>Upper<span style="color: #000000;">(</span>GetIwsSysIni<span style="color: #000000;">(</span><span style="color: #ff0000;">"System Info"</span>, <span style="color: #ff0000;">"Browse 2007 Style"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <> <span style="color: #ff0000;">"NO"</span><br /> oBrw:<span style="color: #000000;">l2007</span> := .T. <span style="color: #B900B9;">//2007 Style</span><br /> <span style="color: #00C800;">ELSE</span><br /> oBrw:<span style="color: #000000;">l2007</span> := .F.<br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS <span style="color: #B900B9;">//Ticking Style</span><br /> <br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span>GetIwsSysIni<span style="color: #000000;">(</span><span style="color: #ff0000;">"System Info"</span>, <span style="color: #ff0000;">"Browse Column Dividers"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nColStyle := Val<span style="color: #000000;">(</span>GetIwsSysIni<span style="color: #000000;">(</span><span style="color: #ff0000;">"System Info"</span>, <span style="color: #ff0000;">"Browse Column Dividers"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">IF</span> nColStyle > <span style="color: #000000;">0</span><br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .T.<br /> <span style="color: #00C800;">ENDIF</span><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := nColStyle<br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span>GetIwsSysIni<span style="color: #000000;">(</span><span style="color: #ff0000;">"System Info"</span>, <span style="color: #ff0000;">"Browse Row Dividers"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nRowStyle := Val<span style="color: #000000;">(</span> GetIwsSysIni<span style="color: #000000;">(</span><span style="color: #ff0000;">"System Info"</span>, <span style="color: #ff0000;">"Browse Row Dividers"</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := nRowStyle<br /> <br /> <span style="color: #B900B9;">// Select a Drag cursor </span><br /> oBrw:<span style="color: #000000;">oDragCursor</span> := oCursor <br /> <span style="color: #B900B9;">// Start the dragging operations from the listbox </span><br /> oBrw:<span style="color: #000000;">bDragBegin</span> := <span style="color: #000000;">{</span> | nRow, nCol, nKeyFlags | ;<br /> <span style="color: #000000;">(</span>SetDropInfo<span style="color: #000000;">(</span> STR<span style="color: #000000;">(</span>&ScedAlias.->SITE_ID,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span>+STR<span style="color: #000000;">(</span>&ScedAlias.->OR_TICKNBR,<span style="color: #000000;">8</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">// Set a DropOver action for the ListBox</span><br /> oBrw:<span style="color: #000000;">bDropOver</span> := <span style="color: #000000;">{</span> | uDropInfo, nRow, nCol, nKeyFlags | ;<br /> ::<span style="color: #000000;">MoveTicket</span><span style="color: #000000;">(</span>uDropInfo<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">(</span>::<span style="color: #000000;">cMessage</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || MdiMessage<span style="color: #000000;">(</span> ::<span style="color: #000000;">cMessage</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> ::<span style="color: #000000;">oBrw</span> := oBrw<br /> <br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oWndBrw:<span style="color: #000000;">oClient</span> := oBrw<br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ReBuildSched<span style="color: #000000;">(</span>lDelete, oBrw, oWnd, oSchedule<span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> nLines := <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">IF</span> lDelete<br /> DeletexBrowse<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> <span style="color: #B900B9;">//Go top to bottom of database to read in what columns should appear</span><br /> SCHEDETS-><span style="color: #000000;">(</span>DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !SCHEDETS-><span style="color: #000000;">(</span>EOF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> SCHEDETS->SCHED_SEQ <> <span style="color: #ff0000;">"ZZ"</span> <br /> nLines := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span>nLines, numat<span style="color: #000000;">(</span><span style="color: #ff0000;">"CHR(13)"</span>, UPPER<span style="color: #000000;">(</span>SCHEDETS->SCHED_COL<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #000000;">1</span><span style="color: #000000;">)</span> <br /> cCol := Alltrim<span style="color: #000000;">(</span>SCHEDETS->SCHED_COL<span style="color: #000000;">)</span> <br /> <span style="color: #B900B9;">//This swaps database names to the aliases used</span><br /> cCol := UpdateSced<span style="color: #000000;">(</span>cCol, <span style="color: #000000;">{</span><span style="color: #ff0000;">"CUSTOMER"</span>, <span style="color: #ff0000;">"ORDERS"</span>, <span style="color: #ff0000;">"CONTCAT"</span>, <span style="color: #ff0000;">"SCHEDULE"</span>, <span style="color: #ff0000;">"OrdConfirmed()"</span>, <span style="color: #ff0000;">"Printed()"</span>, <span style="color: #ff0000;">"OBCStatus()"</span>,<span style="color: #ff0000;">"SITEADDR"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span>oSchedule:<span style="color: #000000;">cCustAlias</span>, oSchedule:<span style="color: #000000;">cOrdAlias</span>, oSchedule:<span style="color: #000000;">cContAlias</span>, oSchedule:<span style="color: #000000;">cOrdAlias</span>, <span style="color: #ff0000;">"MdiConfirmed('"</span> + oSchedule:<span style="color: #000000;">cOrdAlias</span> + <span style="color: #ff0000;">"')"</span>, <span style="color: #ff0000;">"ScedPrinted()"</span>, <span style="color: #ff0000;">"ScedOBCStatus()"</span>, oSchedule:<span style="color: #000000;">cSiteAlias</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #B900B9;">//This is the function that i used to use to display the bitmap</span><br /> <span style="color: #00C800;">IF</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span>cCol, <span style="color: #000000;">13</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"MdiConfirmed("</span> <br /> oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"CONFIRMED"</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"NOTTICKED"</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> &OrdAlias.->CONFIRMED, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">ELSE</span> <br /> oCol:<span style="color: #000000;">bStrData</span> := GenbStrData<span style="color: #000000;">(</span> cCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oCol:<span style="color: #000000;">cHeader</span> := SCHEDETS->SCHED_HEAD<br /> <br /> oCol:<span style="color: #000000;">nWidth</span> := SCHEDETS->SCHED_SIZE<br /> <span style="color: #00C800;">ENDIF</span><br /> SCHEDETS-><span style="color: #000000;">(</span>DBSKIP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDDO</span><br /> oBrw:<span style="color: #000000;">nDataLines</span> := nLines<br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">(</span><span style="color: #000000;">18</span> + <span style="color: #000000;">(</span><span style="color: #000000;">(</span>nLines - <span style="color: #000000;">1</span><span style="color: #000000;">)</span> * <span style="color: #000000;">13</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> lDelete<br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GenbStrData<span style="color: #000000;">(</span> cCol <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">{</span> || &<span style="color: #000000;">(</span>cCol<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> </div>[/code:3u4p3kqb]
|
Bitmaps in Xbrowse
|
Anyone find any problems with the ReBuildSched function above?
Regards,
Pete
|
Bitmaps in Xbrowse
|
If you can provide a small self contained sample, which we can compile and run at our end, we could come up with some solution for you
|
Bitmaps in Xbrowse
|
Found the problem, it was my mistake <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
Pete
|
Bitmaps in buttonbar got shifted up
|
Antonio, linking with the latest lib emailed to me causes the images in my buttonbar seems to be shifted up. It became from this,
[img:3t19h4vn]http://img713.imageshack.us/img713/5618/barok.jpg[/img:3t19h4vn]
to this,
[img:3t19h4vn]http://img37.imageshack.us/img37/1627/barnotok.jpg[/img:3t19h4vn]
WindowsXP.Manifest was linked-in and BUTTONBAR was using neither 2007 nor 2010 clause.
Snippet of buttonbar creation[code=fw:3t19h4vn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">buttonbar</span> oBar <span style="color: #0000ff;">of</span> oWnd <span style="color: #0000ff;">size</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">33</span> 3dlook<br /> oBar:<span style="color: #000000;">setBrush</span><span style="color: #000000;">(</span>oBrush1<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtnB_Xtract <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EXTRACT"</span> <span style="color: #0000ff;">OF</span> oBar ;<br /> TOOLTIP <span style="color: #ff0000;">"Xtract"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ;<br /> lExtract := <span style="color: #00C800;">TRUE</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> cStat == STAT_DISP, ;<br /> <span style="color: #000000;">(</span> ;<br /> EVAL<span style="color: #000000;">(</span> oBtnB_Add:<span style="color: #000000;">bAction</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">)</span>, ;<br /> I_Xtract<span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span> </div>[/code:3t19h4vn]
Please tell me how to fix this.
TIA
p.s. I could've sworn I've read something similar in the past but couldn't find the thread
|
Bitmaps in buttonbar got shifted up
|
Hua,
Please add this function to your main PRG:
[code=fw:21vcycsj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> IsAppThemed<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> .F.</div>[/code:21vcycsj]
|
Bitmaps in buttonbar got shifted up
|
Hua,
This is the right fix to apply:
[img:3ng0c37o]http://img707.imageshack.us/img707/1860/capturesoq.png[/img:3ng0c37o]
|
Bitmaps in buttonbar got shifted up
|
Thanks Antonio. Changed btnbmp.prg and the bitmaps position is now ok but the buttons seems kinda "flat", as though they're in pressed state
Now,
[img:1sa2tk9n]http://img594.imageshack.us/img594/235/buttonflat.jpg[/img:1sa2tk9n]
With FWH11.8 31st Aug
[img:1sa2tk9n]http://img713.imageshack.us/img713/5618/barok.jpg[/img:1sa2tk9n]
* edited *
|
Bitmaps in buttonbar got shifted up
|
Hua,
I missed that painting effect, please revert the previous change and apply this one, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[img:397xox8m]http://img856.imageshack.us/img856/7682/capturetf.png[/img:397xox8m]
|
Bitmaps in buttonbar got shifted up
|
Hi Antonio, with the latest fwbmp.c compiled and updated to fivehgc.lib, I got this error message
[code=fw:2co0biob]<div class="fw" id="{CB}" style="font-family: monospace;">Error: <span style="color: #000000;">Unresolved</span> external <span style="color: #ff0000;">'_HB_ISCHAR'</span> referenced <span style="color: #0000ff;">from</span> J:\HARBOUR\FWH\LIB\FIVEHC.LIB|fwbmp</div>[/code:2co0biob]
|
Bitmaps in buttonbar got shifted up
|
Resolved by adding to fwbmp.c[code=fw:7l27x909]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#ifndef HB_ISCHAR<br /> <span style="color: #00D7D7;">#define</span> HB_ISCHAR<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">(</span> hb_param<span style="color: #000000;">(</span> n, HB_IT_STRING <span style="color: #000000;">)</span> != <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span><br />#endif </div>[/code:7l27x909]
This issue is now resolved <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
Bitmaps in buttonbar got shifted up
|
Hua,
HB_ISCHAR() is defined in hbapi.h, so you just need to add #include <hbapi.h> <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bitmaps in buttonbar got shifted up
|
I see, thanks for the clarification. I guess the error arise as I'm still using a very old version of xHarbour (rev 6406) due to some bugs making my hbapi.h outdated.
|
Bitmaps in buttonbar got shifted up
|
Antonio,
FYI, I tried compiling fwbmp.c using MinGW + Harbour 17053. To get the obj file I compile using my [color=#4000FF:2w0tw925][b:2w0tw925]-.bat[/b:2w0tw925][/color:2w0tw925] which contain this[code=fw:2w0tw925]<div class="fw" id="{CB}" style="font-family: monospace;"><br />hbmk2 %<span style="color: #000000;">1</span> %<span style="color: #000000;">2</span> xhb.hbc j:\harbour\fwh\fwh.hbc</div>[/code:2w0tw925]
Amidst the warnings there are 2 errors as below (I'm using hbmk2's -clipper switch so it'll compile up to obj only and produces no exe)[code=fw:2w0tw925]<div class="fw" id="{CB}" style="font-family: monospace;"><br />J:\harbour\fwh\samples>- fwbmp.c -clipper<br />hbmk2 fwbmp.c -clipper xhb.hbc j:\harbour\fwh\fwh.hbc<br />fwbmp.c: <span style="color: #000000;">In</span> <span style="color: #00C800;">function</span> <span style="color: #ff0000;">'HB_FUN_PALBMPLOAD'</span>:<br /><span style="color: #000000;">fwbmp</span>.c:<span style="color: #000000;">344</span>:<span style="color: #000000;">11</span>: <span style="color: #000000;">error</span>: <span style="color: #000000;">too</span> many arguments <span style="color: #0000ff;">to</span> <span style="color: #00C800;">function</span> <span style="color: #ff0000;">'hb_stornl'</span><br />C:/downloads/Harbour/trunk/harbour/include/hbapi.h:<span style="color: #000000;">754</span>:<span style="color: #000000;">25</span>: <span style="color: #000000;">note</span>: <span style="color: #000000;">declared</span> here<br />fwbmp.c:<span style="color: #000000;">345</span>:<span style="color: #000000;">11</span>: <span style="color: #000000;">error</span>: <span style="color: #000000;">too</span> many arguments <span style="color: #0000ff;">to</span> <span style="color: #00C800;">function</span> <span style="color: #ff0000;">'hb_stornl'</span><br />C:/downloads/Harbour/trunk/harbour/include/hbapi.h:<span style="color: #000000;">754</span>:<span style="color: #000000;">25</span>: <span style="color: #000000;">note</span>: <span style="color: #000000;">declared</span> here<br />fwbmp.c: <span style="color: #000000;">In</span> <span style="color: #00C800;">function</span> <span style="color: #ff0000;">'hPalBitmapDraw'</span>:<br /><span style="color: #000000;">fwbmp</span>.c:<span style="color: #000000;">387</span>:<span style="color: #000000;">15</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">unused</span> variable <span style="color: #ff0000;">'cZeroZeroColor'</span> <span style="color: #000000;">[</span>-Wunused-variable<span style="color: #000000;">]</span><br />fwbmp.c:<span style="color: #000000;">385</span>:<span style="color: #000000;">21</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">unused</span> variable <span style="color: #ff0000;">'nCol'</span> <span style="color: #000000;">[</span>-Wunused-variable<span style="color: #000000;">]</span><br />fwbmp.c:<span style="color: #000000;">385</span>:<span style="color: #000000;">15</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">unused</span> variable <span style="color: #ff0000;">'nRow'</span> <span style="color: #000000;">[</span>-Wunused-variable<span style="color: #000000;">]</span><br />fwbmp.c: <span style="color: #000000;">In</span> <span style="color: #00C800;">function</span> <span style="color: #ff0000;">'HB_FUN_PALBTNPAINT'</span>:<br /><span style="color: #000000;">fwbmp</span>.c:<span style="color: #000000;">654</span>:<span style="color: #000000;">10</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">suggest</span> explicit braces <span style="color: #0000ff;">to</span> avoid ambiguous <span style="color: #ff0000;">'else'</span> <span style="color: #000000;">[</span>-Wparentheses<span style="color: #000000;">]</span><br />fwbmp.c:<span style="color: #000000;">706</span>:<span style="color: #000000;">16</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">suggest</span> explicit braces <span style="color: #0000ff;">to</span> avoid ambiguous <span style="color: #ff0000;">'else'</span> <span style="color: #000000;">[</span>-Wparentheses<span style="color: #000000;">]</span><br />fwbmp.c:<span style="color: #000000;">754</span>:<span style="color: #000000;">16</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">suggest</span> explicit braces <span style="color: #0000ff;">to</span> avoid ambiguous <span style="color: #ff0000;">'else'</span> <span style="color: #000000;">[</span>-Wparentheses<span style="color: #000000;">]</span><br />fwbmp.c:<span style="color: #000000;">583</span>:<span style="color: #000000;">16</span>: <span style="color: #000000;">warning</span>: <span style="color: #000000;">unused</span> variable <span style="color: #ff0000;">'tm'</span> <span style="color: #000000;">[</span>-Wunused-variable<span style="color: #000000;">]</span><br />hbmk2: <span style="color: #000000;">Error</span>: <span style="color: #000000;">Running</span> C/C++ compiler. <span style="color: #000000;">1</span><br />gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -ofwbmp.o -IC:/downloads/Harbour/trunk/harbour/include -IC:/download<br />s/Harbour/trunk/harbour/contrib/xhb -IC:/downloads/Harbour/trunk/harbour/contrib/hbct -IC:/downloads/Harbour/trunk/harbour/contrib/hbtip -IC:/<span style="color: #00C800;">do</span><br />wnloads/Harbour/trunk/harbour/contrib/hbwin -IC:/downloads/Harbour/trunk/harbour/contrib/hbfship -IC:/downloads/Harbour/trunk/harbour/contrib/hb<br />xpp -Ij:/harbour/fwh/include fwbmp.c</div>[/code:2w0tw925]
|
Bitmaps in buttonbar got shifted up
|
Hua,
Please check how hb_stornl() is defined in your used hbapi.h and copy it here, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bitmaps in buttonbar got shifted up
|
Here you go[code=fw:xbcr1xw6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />extern HB_EXPORT int hb_stornl<span style="color: #000000;">(</span> long lValue, int iParam <span style="color: #000000;">)</span>; <span style="color: #B900B9;">/* stores a long on a variable by reference */</span><br />#ifndef HB_LONG_LONG_OFF<br />extern HB_EXPORT int hb_stornll<span style="color: #000000;">(</span> HB_LONGLONG llValue, int iParam <span style="color: #000000;">)</span>; <span style="color: #B900B9;">/* stores a long long on a variable by reference */</span><br />#endif</div>[/code:xbcr1xw6]
|
Bitmaps limitation
|
Dear Antonio, have you found the time to examine the issue I sent you some days ago?
EMG
|
Bitmaps limitation
|
Enrico,
Not yet. Its on the to-do list
|
Bitmaps limitation
|
Thank you!
EMG
|
Bitmaps on listbox
|
I cannot see the bitmaps
why ?
[code=fw:2tfw9cic]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FWCE.ch"</span><br /><br /><br /><span style="color: #00D7D7;">#Define</span> EVENT_SIP <span style="color: #000000;">224</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">Static</span> lsave:=.f.<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">local</span> oDlgClient , oTabs<br /><span style="color: #00C800;">local</span> oLbx<br /><span style="color: #00C800;">local</span> cVar<br /><span style="color: #00C800;">local</span> aHBitMaps:=Array<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> n<br /><br /><br />aHBitMaps:= <span style="color: #000000;">{</span> ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #ff0000;">"<span style="color: #000000;">\L</span>evel1.bmp"</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// BitMaps de 10x10</span><br /> ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #ff0000;">"<span style="color: #000000;">\L</span>evel2.bmp"</span> <span style="color: #000000;">)</span>, ;<br /> ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #ff0000;">"<span style="color: #000000;">\L</span>evel3.bmp"</span> <span style="color: #000000;">)</span>, ;<br /> ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #ff0000;">"<span style="color: #000000;">\L</span>evel4.bmp"</span> <span style="color: #000000;">)</span>,;<br /> ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> +<span style="color: #ff0000;">"<span style="color: #000000;">\L</span>evel5.bmp"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />USE <span style="color: #000000;">(</span> CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\C</span>lientes"</span> <span style="color: #000000;">)</span> VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /><br /><span style="color: #00C800;">if</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span><br />APPEND BLANK<br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">if</span> ! File<span style="color: #000000;">(</span> CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\C</span>liName.CDX"</span> <span style="color: #000000;">)</span><br /><span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> Clientes->Nombre <span style="color: #0000ff;">TO</span> <span style="color: #000000;">(</span> CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\C</span>liName"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br />Clientes-><span style="color: #000000;">(</span>DbSetIndex<span style="color: #000000;">(</span> CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\C</span>liName"</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br />Clientes-><span style="color: #000000;">(</span> OrdSetFocus<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CliName"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br />Clientes-><span style="color: #000000;">(</span> DbGoTop<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgClient <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Clients"</span><br /><br />@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0.2</span> <span style="color: #0000ff;">LISTBOX</span> oLbx FIELDS aHBitmaps<span style="color: #000000;">[</span> <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, Clientes->Nivel <span style="color: #000000;">)</span> <span style="color: #000000;">]</span>,;<br /> Clientes->Nombre, AllTrim<span style="color: #000000;">(</span> Clientes->Direccion <span style="color: #000000;">)</span>,;<br /> Clientes->Telefono,;<br /> Str<span style="color: #000000;">(</span> Clientes->Edad, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> ;<br /> HEADERS <span style="color: #ff0000;">"L"</span>, <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Address"</span>, <span style="color: #ff0000;">"Phone"</span>, <span style="color: #ff0000;">"Age"</span> ;<br /> FIELDSIZES <span style="color: #000000;">16</span>, <span style="color: #000000;">222</span>, <span style="color: #000000;">213</span>, <span style="color: #000000;">58</span>, <span style="color: #000000;">24</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">118</span>, <span style="color: #000000;">132</span> <span style="color: #0000ff;">OF</span> oDlgClient<br /><br /><br /><br />oLbx:<span style="color: #000000;">nClrPane</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> OrdKeyNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span><span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">190</span>, <span style="color: #000000;">215</span>, <span style="color: #000000;">190</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />oLbx:<span style="color: #000000;">nClrForeHead</span>:=CLR_BLUE<br /><br />*oLbx::<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span>|nKey| Val_nKey<span style="color: #000000;">(</span>nKey,oDlg<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br />oDlgClient:<span style="color: #000000;">bSettingChange</span> := <span style="color: #000000;">{</span>|uVal|PocketEvent<span style="color: #000000;">(</span> uVal,oDlgClient,olbx <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgClient;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> SetOKButton<span style="color: #000000;">(</span> oDlgClient:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>,;<br />DlgFullScreen<span style="color: #000000;">(</span> oDlgClient:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ;<br />oDlgClient:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">(</span> DialogBar<span style="color: #000000;">(</span>oDlgClient,oLbx<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><br /><br />AEval<span style="color: #000000;">(</span> aHBitmaps, <span style="color: #000000;">{</span> | hBmp | DeleteObject<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br />Clientes-><span style="color: #000000;">(</span>DbCloseArea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br />RETU <span style="color: #00C800;">NIL</span><br /> </div>[/code:2tfw9cic]
|
Bitmaps transparentes
|
Hola,
He intentado mostrar un bitmap transparente y da error en el método paint.
oBitmap:lTransparent := .T. después de definirlo
¿ No se puede poner transparente en una pocket ?
Un Saludo,
Joaquín
|
Bitmaps transparentes
|
Joaquín,
Puedes publicar un pequeño ejemplo autocontenido de cómo lo has probado ? gracias
|
Bitmaps transparentes
|
Antonio,
REDEFINE BITMAP ::oBitmap ID 200;
OF ::oDlg;
RESOURCE "MIBITMAP"
::oBitmap:lTransparent := .T.
Esto sí me funciona en FWH.
Un Saludo,
Joaquín
|
Bitmaps transparentes
|
Antonio,
¿ Alguna noticia sobre esto de las transparencias ?
Un Saludo,
Joaquín
|
Bitmaps transparentes
|
Joaquín,
Podemos proporcionar soporte técnico más rapidamente cuando se nos proporciona un ejemplo completo, pequeño y autocontenido, que podamos probar rapidamente.
|
Bitácora de Sistema
|
Hola a todos <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Quería pedir a Uds. sugerencias sobre como hacer para almacenar en una tabla de bitácora todos los tipos de movimientos, terminal y usuario que los realizó, tengo que hacer una modificación para implementar esto en mis aplicaciones y he estado viendo el modo, pero me pareció bueno comentarlo, y quizá recibir algun feedback de quienes ya lo han hecho, y de lo que a vuestro criterio podría ser la solución más adecuada.
Gracias desde ya <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
Bitácora de Sistema
|
Jose:
Lo que hago es que cada usuario tiene un nombre y contrañesa para poder saber quien entra al sistema y hacer movimientos, cada usuario tiene ciertos niveles y privilegios a funciones dentro del sistema y permisos ya sea para crear nuevos registros, borrarlos, modificarlos o consultar en pantalla o imprimirlos:
[img:k6no2pw1]http://s21.postimg.org/pfy0tknw7/sisa0010.png[/img:k6no2pw1]
En una base de datos guardo cada acción que hacen para luego consultar, sle llamo Auditoria a Usuarios:
Ejemplo y una imagen de como lo tengo en uno de mis sistemas..
[code=fw:k6no2pw1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> Auditor<span style="color: #000000;">(</span>cUser, cAcción,cTime,dDate<span style="color: #000000;">)</span><br /> </div>[/code:k6no2pw1]
[img:k6no2pw1]http://s21.postimg.org/5mlx0vaif/sisa0044.png[/img:k6no2pw1]
Es lo más facil, lo liado es poner la función en cada accion o procedimiento dentro de tu aplicación..
Espero te de una ayuda..
|
Bitácora de Sistema
|
Saludos
Podrian poner un ejemplo de auditar un usuario que realize una insercion de datos a una tabla?
|
Bitácora de Sistema
|
Muy bello trabajo,
Gracias por tu ayuda, ya me ha dado algunas ideas que combinaré con otras que ya tengo, MUUUUUCHAS GRACIAS <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Si alguien más quisiera poner su granito de harena lo agradeceré <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Un fuerte abrazo!!
|
Bitácora de Sistema
|
Si estas usando algo diferente a MySQL, puedes hacer como lo que dice el colega, llamas una funcion al momento de agregar, modificar, elimina o hasta de imprimir datos, que en mi caso tambien la llamo bitacora de usuario y alli dependiendo de lo que haga, creo un registro que contiene..COD.USER, COD.DEL MODULO, COD.SI A.M.E.R.(Agrego,Modifico,Elimino,Reporte), FECHA y HORA. Si usas MySql, MAriaBD o algo parecido, puedes usar disparadores(trigger) en tus tablas que haga lo antes mencionado, espero te de algunas ideas, gracias, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
|
Bitácora de Sistema
|
José, mira si estos trozos de codigo ayudan en algo. Servirían para controlar accesos desde el menú principal.
[code=fw:3vpms87v]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> aAMB := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <span style="color: #B900B9;">//control niveles de acceso</span><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"WINC"</span><br /> oWnd:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">(</span> oMenu:=BuildMenu<span style="color: #000000;">(</span>oBar<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//MENUINFO 2</span><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">Function</span> BuildMenu<span style="color: #000000;">(</span>oBar<span style="color: #000000;">)</span><br />...<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Comprobantes"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Grabar "</span> <span style="color: #0000ff;">ACTION</span> Comprobante<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Modificar"</span> <span style="color: #0000ff;">ACTION</span> Comprobante<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Consultar"</span> <span style="color: #0000ff;">ACTION</span> ConsulDoc<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Anular/Borrar "</span> <span style="color: #0000ff;">ACTION</span> BorrAnulDoc<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">ENDMENU</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br />/----------------------------------<br /><span style="color: #00C800;">Function</span> lAutorizado<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlg,oBt1,oBt2, oIco, oCbx, oPw, cItems:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>,cVar, cPw, lOK:=.f., lAutoriza:=.f.<br /><span style="color: #00C800;">LOCAL</span> cPath:=GetPvProfString<span style="color: #000000;">(</span><span style="color: #ff0000;">"config"</span>,<span style="color: #ff0000;">"DrivDirUsers"</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\"</span>,cIniFile)<br /><br />SET DELETED ON<br /><br />dbUseArea(.t.,,cPath+"</span>\Usuarios<span style="color: #ff0000;">","</span>Usuarios<span style="color: #ff0000;">",.t.)<br />usuarios->(dbgotop())<br /><br />if Usuarios->(bof()) // Si no hay permisos, acceso es total por defecto.<br /> cUsuario:="</span> <span style="color: #ff0000;">"<br /> cNombUser:="</span>No users<span style="color: #ff0000;">"<br /> cPermiso:="</span>T<span style="color: #ff0000;">" <br /> aAMB:={.T.,.T.,.T.}<br /> usuarios->(dbCloseArea())<br /> return .t.<br />endif<br /><br />While Usuarios->(!eof())<br /> aadd(cItems,Usuarios->nombre)<br /> usuarios->(dbskip())<br />Enddo<br /><br />cPw:=space(len(usuarios->codigo))<br />cVar:=cItems[1]<br />DEFINE DIALOG oDLG RESOURCE "</span>USUARIOS<span style="color: #ff0000;">" TRANSPARENT<br />REDEFINE ICON oIco ID 400 OF oDlg RESOURCE "</span>USUARIOS<span style="color: #ff0000;">" <br />REDEFINE SAY ID 101 OF oDlg<br />REDEFINE SAY ID 102 OF oDlg<br />REDEFINE ComboBox oCbx VAR cVar ID 103 OF oDLG ITEMS cItems ON CHANGE (oCbx:GotFocus(),oCbx:Refresh())<br />REDEFINE GET oPw VAR cPw ID 202 OF oDLG<br />REDEFINE BUTTONBMP oBt1 ID 312 OF oDLG BITMAP "</span>ACEPTAR<span style="color: #ff0000;">" TEXTRIGHT ACTION (lOK:=.t.,oDlg:End())<br />REDEFINE BUTTONBMP oBt2 ID 313 OF oDLG BITMAP "</span>CANCELAR<span style="color: #ff0000;">" TEXTRIGHT ACTION (lOK:=.f.,oDlg:End())<br />ACTIVATE DIALOG oDlg CENTERED <br />if lOK<br /> usuarios->(dbgotop())<br /> locate for ALLTRIM(usuarios->codigo)+ALLTRIM(usuarios->nombre) = ALLTRIM(Encrypt(cPw,"</span>oleaje<span style="color: #ff0000;">"))+ alltrim(cVar)<br /> IF found()<br /> if upper(Usuarios->Administ)="</span>T<span style="color: #ff0000;">" //acceso total<br /> lAutoriza:=.t.<br /> cUsuario:=usuarios->codigo<br /> cNombUser:=cVar<br /> cPermiso:=usuarios->administ<br /> elseif upper(Usuarios->Administ)<>"</span>T<span style="color: #ff0000;">" .and. Usuarios->CONTAB=.t.<br /> lAutoriza:=.t.<br /> cUsuario:=usuarios->codigo<br /> cNombUser:=cVar<br /> cPermiso:=usuarios->administ<br /> elseif upper(Usuarios->Administ)<>"</span>T<span style="color: #ff0000;">" .and. Usuarios->CONTAB !=.t.<br /> lAutoriza:=.f.<br /> MsgStop("</span>No tiene autorizacion para este modulo.<span style="color: #ff0000;">","</span>Alto<span style="color: #ff0000;">")<br /> endif<br /><br /> //[A]gregar,[M]odificar,[B]orrarAnular<br /> aAMB := {} //static para controlar nivel de acceso<br /> aadd(aAMB,usuarios->Grabar)<br /> aadd(aAMB,usuarios->Modifi)<br /> aadd(aAMB,usuarios->AnuBor)<br /><br /> ELSE<br /> MsgStop("</span>Acceso Denegado.<span style="color: #ff0000;">","</span>Alto<span style="color: #ff0000;">")<br /> ENDIF<br />endif<br />usuarios->(dbCloseArea())<br />return lAutoriza<br /></span></div>[/code:3vpms87v]
Saludos.
|
Bitácora de Sistema
|
[quote="FranciscoA":26xql6ux]José, mira si estos trozos de codigo ayudan en algo. Servirían para controlar accesos desde el menú principal.
[code=fw:26xql6ux]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> aAMB := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <span style="color: #B900B9;">//control niveles de acceso</span><br /><span style="color: #00C800;">static</span> oWnd<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"WINC"</span><br /> oWnd:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">(</span> oMenu:=BuildMenu<span style="color: #000000;">(</span>oBar<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//MENUINFO 2</span><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">Function</span> BuildMenu<span style="color: #000000;">(</span>oBar<span style="color: #000000;">)</span><br />...<br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Comprobantes"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Grabar "</span> <span style="color: #0000ff;">ACTION</span> Comprobante<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Modificar"</span> <span style="color: #0000ff;">ACTION</span> Comprobante<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Consultar"</span> <span style="color: #0000ff;">ACTION</span> ConsulDoc<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"&Anular/Borrar "</span> <span style="color: #0000ff;">ACTION</span> BorrAnulDoc<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">WHEN</span> aAMB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <br /> <span style="color: #0000ff;">ENDMENU</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br />/----------------------------------<br /><span style="color: #00C800;">Function</span> lAutorizado<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlg,oBt1,oBt2, oIco, oCbx, oPw, cItems:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>,cVar, cPw, lOK:=.f., lAutoriza:=.f.<br /><span style="color: #00C800;">LOCAL</span> cPath:=GetPvProfString<span style="color: #000000;">(</span><span style="color: #ff0000;">"config"</span>,<span style="color: #ff0000;">"DrivDirUsers"</span>,<span style="color: #ff0000;">".<span style="color: #000000;">\"</span>,cIniFile)<br /><br />SET DELETED ON<br /><br />dbUseArea(.t.,,cPath+"</span>\Usuarios<span style="color: #ff0000;">","</span>Usuarios<span style="color: #ff0000;">",.t.)<br />usuarios->(dbgotop())<br /><br />if Usuarios->(bof()) // Si no hay permisos, acceso es total por defecto.<br /> cUsuario:="</span> <span style="color: #ff0000;">"<br /> cNombUser:="</span>No users<span style="color: #ff0000;">"<br /> cPermiso:="</span>T<span style="color: #ff0000;">" <br /> aAMB:={.T.,.T.,.T.}<br /> usuarios->(dbCloseArea())<br /> return .t.<br />endif<br /><br />While Usuarios->(!eof())<br /> aadd(cItems,Usuarios->nombre)<br /> usuarios->(dbskip())<br />Enddo<br /><br />cPw:=space(len(usuarios->codigo))<br />cVar:=cItems[1]<br />DEFINE DIALOG oDLG RESOURCE "</span>USUARIOS<span style="color: #ff0000;">" TRANSPARENT<br />REDEFINE ICON oIco ID 400 OF oDlg RESOURCE "</span>USUARIOS<span style="color: #ff0000;">" <br />REDEFINE SAY ID 101 OF oDlg<br />REDEFINE SAY ID 102 OF oDlg<br />REDEFINE ComboBox oCbx VAR cVar ID 103 OF oDLG ITEMS cItems ON CHANGE (oCbx:GotFocus(),oCbx:Refresh())<br />REDEFINE GET oPw VAR cPw ID 202 OF oDLG<br />REDEFINE BUTTONBMP oBt1 ID 312 OF oDLG BITMAP "</span>ACEPTAR<span style="color: #ff0000;">" TEXTRIGHT ACTION (lOK:=.t.,oDlg:End())<br />REDEFINE BUTTONBMP oBt2 ID 313 OF oDLG BITMAP "</span>CANCELAR<span style="color: #ff0000;">" TEXTRIGHT ACTION (lOK:=.f.,oDlg:End())<br />ACTIVATE DIALOG oDlg CENTERED <br />if lOK<br /> usuarios->(dbgotop())<br /> locate for ALLTRIM(usuarios->codigo)+ALLTRIM(usuarios->nombre) = ALLTRIM(Encrypt(cPw,"</span>oleaje<span style="color: #ff0000;">"))+ alltrim(cVar)<br /> IF found()<br /> if upper(Usuarios->Administ)="</span>T<span style="color: #ff0000;">" //acceso total<br /> lAutoriza:=.t.<br /> cUsuario:=usuarios->codigo<br /> cNombUser:=cVar<br /> cPermiso:=usuarios->administ<br /> elseif upper(Usuarios->Administ)<>"</span>T<span style="color: #ff0000;">" .and. Usuarios->CONTAB=.t.<br /> lAutoriza:=.t.<br /> cUsuario:=usuarios->codigo<br /> cNombUser:=cVar<br /> cPermiso:=usuarios->administ<br /> elseif upper(Usuarios->Administ)<>"</span>T<span style="color: #ff0000;">" .and. Usuarios->CONTAB !=.t.<br /> lAutoriza:=.f.<br /> MsgStop("</span>No tiene autorizacion para este modulo.<span style="color: #ff0000;">","</span>Alto<span style="color: #ff0000;">")<br /> endif<br /><br /> //[A]gregar,[M]odificar,[B]orrarAnular<br /> aAMB := {} //static para controlar nivel de acceso<br /> aadd(aAMB,usuarios->Grabar)<br /> aadd(aAMB,usuarios->Modifi)<br /> aadd(aAMB,usuarios->AnuBor)<br /><br /> ELSE<br /> MsgStop("</span>Acceso Denegado.<span style="color: #ff0000;">","</span>Alto<span style="color: #ff0000;">")<br /> ENDIF<br />endif<br />usuarios->(dbCloseArea())<br />return lAutoriza<br /></span></div>[/code:26xql6ux]
Saludos.[/quote:26xql6ux]
Francisco, aprovechando lo que publicas, por casualidad tendras la creacion del MENU pero dinamicamente, es decir, dependiendo del nivel del usuario, entonces se agreguen unas opciones y otras no, estas ya creadas en una TABLA o DBF..? gracias, saludos..
En relacion a lo que necesita el colega, es guardar las acciones del usuario durante su estadia en el sistema, algo como un diario, lo que le llamamos..BITACORA DE USUARIO...
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.