Ttitle and Timage problems

Ttitle and Timage problems

Postby Adolfo » Tue Oct 06, 2009 7:11 pm

AS i asked in the spanish forums

I've been trynig with all means, but with bno succes to solve this two problems
Please download the following

http://200.72.140.34/privado/Test.rar

1.- If you move any dialog over the TTITLE, this get erased, Ex. Call the taskmanager and roll it over and see how it dissapears
2.- In menu option TImage, search for a jpg, and see if it gets shown

Tested in 3 Pc's all with XP and 1 without themes

Tested with FWH 907 y 909, with no success
I use xHarbour.org, Borland 5.5.1 and PellesC 6.0

Thanks in advance

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Ttitle and Timage problems

Postby ukoenig » Thu Oct 08, 2009 9:09 am

Hello Adolfo,

to many Mistakes, because You are using a MDI-Window, some Changes needed :

Image

Code: Select all  Expand view

#include "FiveWin.ch"
#include "Image.ch"
#include "ttitle.ch"

static oWnd, hDC

//-------------------------------------------------------------------------------------

Function Main()
Local nAncho:=WndWidth(GetDesktopWindow())

DEFINE WINDOW oWnd FROM 1, 1 TO 25, 79 MDI ;
TITLE "Sistema" Menu BuildMenu()


ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT W_TITLE( oWnd, nAncho )

Return Nil

// -------------------------------------------------------------------

FUNCTION W_TITLE( oWnd, nAncho )
Local oDlg, oTitle1
Local cTitulo:=( "TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO ")

nDLGStyle = nOR( DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_BORDER )
DEFINE DIALOG oDlg SIZE 60, nAncho STYLE nDLGStyle

@ 0,0 TITLE oTitle1 Size nAncho, 60 of oDlg SHADOW SHADOWSIZE 0
oTitle1:aGrdBAck:= { {1,nRGB(251,230,148),nRGB(238,149,21) }}
oTitle1:lRound:=.F.
@  10,  10  TITLETEXT OF oTitle1 TEXT cTitulo COLOR CLR_BLACK

ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT ( oDlg:Move( 50, 0, nAncho, 60,  .f. ) )

RETURN( NIL )

//--------------------------------------------------------------------

Function BuildMenu()
local oMenu

MENU oMenu 2007
MENUITEM "TTitle"
MENU
            MENUITEM "Error de Ttitle"  ACTION MsgAlert("Mover sobre TTitle","Confirme")
ENDMENU
MENUITEM "TImage"
MENU
            MENUITEM "Error de TImage y JPG" ACTION TestImage()
ENDMENU

ENDMENU

Return oMenu

//-----------------------------------------------------------------------

Function TestImage()
Local oDlgTest, oImg1
Local oFoto1:=Space(150)

Define Dialog oDlgTest Resource "IMAGENES"

// RESOURCE "Blanc" = any small BMP-resource
REDEFINE BITMAP oImg1  ID 11  ADJUST  RESOURCE "Blanc"  OF oDlgTest
oImg1:bPainted := {|hDC| DRAW_IMAGE( oImg1, "ZARZAR.JPG" ) }

REDEFINE GET oGet1  VAR oFoto1  ID 101 Of oDlgTest Picture "@K!" ;
VALID ( oImg1:LoadBmp(ALLTRIM(oFoto1)), oImg1:Refresh(), .T.) ;
ACTION ( oFoto1:=cGetFile32("JPEG  | *.jpg |" + "Todos los Archivos | *.* ", ;
"Seleccione imagen",1,"C:\",,.T.), oGet1:refresh()) update

Redefine Button oBtn1 Id 201 of oDlgTest Action oDlgTest:End()

Activate Dialog oDlgTest Centered NOWAIT

Return Nil

// -------------------------------

FUNCTION DRAW_IMAGE( oBitmap, cBitmap)
Local oImage

DEFINE IMAGE oImage FILENAME cBitmap

aRect := GETCLIENTRECT( oBitmap:hWnd )
nBmpWidth := oBitmap:nWidth()
nBmpHeight := oBitmap:nHeight()

PalBmpDraw( oBitmap:GETDC(), 0, 0, oImage:hBitmap, , aRect[4], aRect[3] )
oBitmap:ReleaseDC()

RETURN( NIL )



Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Ttitle and Timage problems

Postby Adolfo » Thu Oct 08, 2009 12:20 pm

UWE...

Thanks...

I'll try it as soon as posible.
:D
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Ttitle and Timage problems

Postby Cgallegoa » Thu Oct 08, 2009 3:01 pm

Adolfo,

All you need to do is assign TTitle to oWnd:oWndClient becouse you are using MDI Window:

This works fine:
Code: Select all  Expand view
Function Main()
Local cTitulo:=( "TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO TEXTO ")
Local nAncho:=WndWidth(GetDesktopWindow())

   DEFINE WINDOW oWnd FROM 1, 1 TO 25, 79 MDI ;
   TITLE "Sistema con MDI" Menu BuildMenu()

    @ 70,0 TITLE oTitle1 Size nAncho, 60 of oWnD:oWndClient SHADOW SHADOWSIZE 0
      oTitle1:aGrdBAck:= { {1,nRGB(251,230,148),nRGB(238,149,21) }}
      oTitle1:lRound:=.F.
    @  10,  10  TITLETEXT OF oTitle1 TEXT cTitulo COLOR CLR_BLACK

   ACTIVATE WINDOW oWnd MAXIMIZED

Return Nil


Regards,

Carlos Gallego
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: Ttitle and Timage problems

Postby Adolfo » Thu Oct 08, 2009 4:33 pm

Carlos, Uwe

Both solutions works fine.
... sorry I completely forgot I was using a MDI Window, my mistake.
.. I guess I'll have to rest some days, I have some faulty IRQ's
:oops:

Thanks a lot

From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 76 guests