English
Forum

TreeView The second problem

 

Alfred
Wagner
Hello Profaner

first time the code to that testing
CompileMarkSeparation
!
 $P+
SetErrorLevel 0
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
 $U F:PROGRAMMETOOLSXPROFAN9ROCKLIBTRV.PCU = TRV_ (Treeview Unit...) Pfad Anpassen !!
DECLARE TRVDLL$,BUTTON1&,TVITEM0&,TVITEM1&,Checkbox1&,Text1$,Text2&,Text3&
DECLARE TREEVIEW&,IMAGELIST&
TRVDLL$= "Shell32.DLL"
IMAGELIST&=IMAGELIST_CREATE(16,16,32,3,3) IMAGELIST ERZEUGEN

PROC CREATETREEVIEW

    TRV_CREATETREEVIEW %HWND,0013,0010,0120,0285
    TREEVIEW&=&(0)
    REPAINT

ENDPROC

PROC TREEVIEWITEMS

    TRV_SETTEXTCLR TREEVIEW&,0
    TRV_SETBACKCLR TREEVIEW&,RGB(255,255,255)
    TRV_INSERTICON "#1",TRVDLL$
    TRV_INSERTITEM TVITEM0&,0,"1",TREEVIEW&
    TVITEM0&=&(0)
    TRV_INSERTICON "#2",TRVDLL$
    TRV_INSERTITEM TVITEM0&,1,"2",TREEVIEW&
    TVITEM1&=&(0)
    TRV_EXPAND TREEVIEW&,TVITEM0&
    TRV_EXPAND TREEVIEW&,TVITEM1&

ENDPROC

PROC GET_TREEVIEW ABFRAGEN DER TREEVIEWITEMS

    IF GETFOCUS(TREEVIEW&)

        IF TRV_GETITEM(TREEVIEW&)=TVITEM0&

            TVITEM0_ONCLICK
            SETFOCUS(%HWND)

        ENDIF

        ----------------------------------------------------------

        IF TRV_GETITEM(TREEVIEW&)=TVITEM1&

            TVITEM1_ONCLICK
            SETFOCUS(%HWND)

        Endif

    Endif

ENDPROC

Proc Löschen

    @DestroyWindow (Text2&),1
    @DestroyWindow (Text3&),1
    @DestroyWindow (Checkbox1&),1Checkbox verschwindet
    @DestroyWindow (Text1$),1Text verschwindet nicht

Endproc

PROC TVITEM0_ONCLICK

    Löschen
    Text1$ = "Dieser Text sollte beim Klick auf das zweite Treeview verschwinden"
    TextColor RGB($FF,$00,$00),-1
    Drawtext 170,50,Text1$
    Checkbox1& = @Control("BUTTON","",$50008003,150,50,12,12,%HWND,100,%Hinstance,$10000)

ENDPROC

PROC TVITEM1_ONCLICK

    Löschen
    Text2& = @Create("Text",%HWND,"Tut er aber nicht ! Liegt wahrscheinlich an DrawText oder?",150,80,300,15)
    Text3& = @Create("Text",%HWND,"Weiß jemand Rat ?",150,100,300,15)

ENDPROC

WINDOWSTYLE 31
WINDOWTITLE "Neues Fenster"
WINDOW SUB(DIV(%MAXX,2),DIV(543,2)),SUB(DIV(%MAXY,2),DIV(344,2))-543,344
SETTRUECOLOR 1
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
CREATETREEVIEW TREEVIEW ERSTELLEN
TREEVIEWITEMS ITEMS IN TREEVIEW EINFÜGEN
BUTTON1& = CREATE("BUTTON",%HWND,"Ende",0407,0268,0070,0021)
Hauptschleife
SETFOCUS(%HWND)

WHILENOT ENDE%

    WAITINPUT
    GET_TREEVIEW TREEVIEW ABFRAGE

    If @EQU(%KEY,2)

        LET ENDE%= 1

    ELSEIF @EQU(%KEY,4)

    ELSEIF GETFOCUS(BUTTON1&) BUTTON

        ENDE%=1

    ELSEIF GETFOCUS(TVITEM0&) BUTTON

        TVITEM0_ONCLICK

    ELSEIF GETFOCUS(TVITEM1&) BUTTON

        TVITEM1_ONCLICK

    ENDIF

WEND

IMAGELIST_DESTROY(IMAGELIST&)

goes it that the besagte Text the with DrawText prepares watts deleted becomes?

thanks already time in the vorhinein

Alfred with family
 
WinXP-Home ,XProfan10

Alfreds ... Freeware :  [...] 
07/07/06  
 



Hello Alfred
it's located on DrawText....

DrawText has no lever and can therefore not destroy (Destroy...) go
I have it time abgeändert and so works everything
CompileMarkSeparation
DECLARE txt%

Proc Löschen

    @DestroyWindow (Text2&),1
    @DestroyWindow (Text3&),1
    @DestroyWindow (Checkbox1&),0Checkbox verschwindet
    @DestroyWindow (txt%),0Text verschwindet jetzt

Endproc

PROC TVITEM0_ONCLICK

    Löschen
    Text1$ = "Dieser Text sollte beim Klick auf das zweite Treeview verschwinden"
    TextColor RGB($FF,$00,$00),-1
    Drawtext 170,50,Text1$
    txt%=CREATE("TEXT",%HWnd,text1$,170,50,400,20)
    Checkbox1& = @Control("BUTTON","",$50008003,150,50,12,12,%HWND,100,%Hinstance,$10000)

ENDPROC


DrawText überschreibe I always with MKSTR$( ,number%) and set thereby TEXTCOLOR on RGB(background%),RGB(background%)
 
07/07/06  
 




Alfred
Wagner
Hello Horst
thanks for your Help

but unfortunately is the Text not any more coloured,or Have I what overlooking

Regards

Alfred with family
 
WinXP-Home ,XProfan10

Alfreds ... Freeware :  [...] 
07/07/06  
 



Hello Alfred
One Text, the with CREATE(TEXT,etc..... prepares becomes, is always Black
therefore my Tipp with MKSTR$( ,number%)
example:

CLS
TEXTCOLOR RGB(200,0,0),RGB(255,255,255)
DrawText 50,100,this Text is ruddy on weissem background

- into Procedur Delete write You now:

TEXTCOLOR RGB(255,255,255),RGB(255,255,255)
DrawText 50,100,MKSTR$(X,50)

The number 50 is only adopted. must You adjust. now becomes when calling the Procedur Delete the red Text knows (background) überschrieben. the can You naturally with eachone colour make. - GetSyscolor(15) z. B.
 
07/07/06  
 



Have now again whom Text complete rewritten. DrawText position now farbigen Text available and this becomes deleted - think I could help
CompileMarkSeparation
 $P+
SetErrorLevel 0
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
 $U G:XPROFAN_10_ENTWICKLUNGSANDKISTETRV.PCU = TRV_ (Treeview Unit...) Pfad Anpassen !!
DECLARE TRVDLL$,BUTTON1&,TVITEM0&,TVITEM1&,Checkbox1&,Text1$,Text2&,Text3&
DECLARE TREEVIEW&,IMAGELIST&
TRVDLL$= "Shell32.DLL"
IMAGELIST&=IMAGELIST_CREATE(16,16,32,3,3) IMAGELIST ERZEUGEN

PROC CREATETREEVIEW

    TRV_CREATETREEVIEW %HWND,0013,0010,0120,0285
    TREEVIEW&=&(0)
    REPAINT

ENDPROC

PROC TREEVIEWITEMS

    TRV_SETTEXTCLR TREEVIEW&,0
    TRV_SETBACKCLR TREEVIEW&,RGB(255,255,255)
    TRV_INSERTICON "#1",TRVDLL$
    TRV_INSERTITEM TVITEM0&,0,"1",TREEVIEW&
    TVITEM0&=&(0)
    TRV_INSERTICON "#2",TRVDLL$
    TRV_INSERTITEM TVITEM0&,1,"2",TREEVIEW&
    TVITEM1&=&(0)
    TRV_EXPAND TREEVIEW&,TVITEM0&
    TRV_EXPAND TREEVIEW&,TVITEM1&

ENDPROC

PROC GET_TREEVIEW ABFRAGEN DER TREEVIEWITEMS

    IF GETFOCUS(TREEVIEW&)

        IF TRV_GETITEM(TREEVIEW&)=TVITEM0&

            TVITEM0_ONCLICK
            SETFOCUS(%HWND)

        ENDIF

        ----------------------------------------------------------

        IF TRV_GETITEM(TREEVIEW&)=TVITEM1&

            TVITEM1_ONCLICK
            SETFOCUS(%HWND)

        Endif

    Endif

ENDPROC

Proc Löschen

    @DestroyWindow (Text2&),1
    @DestroyWindow (Text3&),1
    ------------------------------------------------------------------------- NEU
    @DestroyWindow (Checkbox1&),0Checkbox verschwindet
    TEXTCOLOR GetSyscolor(15),GetSyscolor(15) Vorder- Hintergrund gleich
    DrawText 170,50,text1$
    TextColor RGB($FF,$00,$00),-1 alte Farben wieder einstellen für neuen Aufruf
    ------------------------------------------------------------------------- NEU

Endproc

PROC TVITEM0_ONCLICK

    Löschen
    Text1$ = "Dieser Text sollte beim Klick auf das zweite Treeview verschwinden"
    TextColor RGB($FF,$00,$00),-1
    Drawtext 170,50,Text1$
    Checkbox1& = @Control("BUTTON","",$50008003,150,50,12,12,%HWND,100,%Hinstance,$10000)

ENDPROC

PROC TVITEM1_ONCLICK

    Löschen
    Text2& = @Create("Text",%HWND,"Tut er aber nicht ! Liegt wahrscheinlich an DrawText oder?",150,80,300,15)
    Text3& = @Create("Text",%HWND,"Weiß jemand Rat ?",150,100,300,15)

ENDPROC

WINDOWSTYLE 31
WINDOWTITLE "Neues Fenster"
WINDOW SUB(DIV(%MAXX,2),DIV(543,2)),SUB(DIV(%MAXY,2),DIV(344,2))-543,344
SETTRUECOLOR 1
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
CREATETREEVIEW TREEVIEW ERSTELLEN
TREEVIEWITEMS ITEMS IN TREEVIEW EINFÜGEN
BUTTON1& = CREATE("BUTTON",%HWND,"Ende",0407,0268,0070,0021)
Hauptschleife
SETFOCUS(%HWND)

WHILENOT ENDE%

    WAITINPUT
    GET_TREEVIEW TREEVIEW ABFRAGE

    If @EQU(%KEY,2)

        LET ENDE%= 1

    ELSEIF @EQU(%KEY,4)

    ELSEIF GETFOCUS(BUTTON1&) BUTTON

        ENDE%=1

    ELSEIF GETFOCUS(TVITEM0&) BUTTON

        TVITEM0_ONCLICK

    ELSEIF GETFOCUS(TVITEM1&) BUTTON

        TVITEM1_ONCLICK

    ENDIF

WEND

IMAGELIST_DESTROY(IMAGELIST&)
 
07/07/06  
 




Alfred
Wagner
thanks Horst
functions tadellos

Regards

Alfred with family
 
WinXP-Home ,XProfan10

Alfreds ... Freeware :  [...] 
07/07/06  
 



Have as a small Einwand!

The principle, with DrawText a DrawText abzulöschen functions often not - particularly on Standartinstallationen.

On one unversautem WinXP is IMHO ClearType active, means The Bildschirmschriftenglättung.

there these often active is yields the take action hässliche Borders - objectively disappears the Text not at all really separate it stay Fragmente spare.

If it already over Pixeltext happen must, then must the überschriebene area correctly. wiederhersgestellt go.
one could a copy the Pixel in the Memorybitmap lay out and this area to that delete benefit, or with Rectangle whom Text ablöschen.

Text on Text is no so good idea.
 
07/08/06  
 



Hello iF

[quote:b8ddee25dd]Text on Text is no so good idea.[/quote:b8ddee25dd]
give you naturally right - was indeed only one Denkanstoss - meinereiner goes there and vergrössert with USEFONT.... whom Schriftfont and then are The Borders too forget. You must me always zugute hold, I hardly with irgendwelchen API- or others command work and letztendlich still to that target come - see my UNIT - there are no negativen Kritiken eingelaufen or be I the review not worth ?
 
07/08/06  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

891 Views

Untitledvor 0 min.
Member 862464104/14/24
RudiB.04/07/22
Andreas Koch04/12/12
boh106/08/11
More...

Themeninformationen

this Topic has 3 subscriber:

unbekannt (4x)
Alfred Wagner (3x)
iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie