English
Includes

extendedbuttons.inc

 

Ragnar
Rehbein
short introduction to extendedbuttons.inc
I belong to the of course small but hartgesottenen gemeinde The Visual windows Prof. 2 to programmentwicklung not missen would.
any projetkte a surface having go with VWP2 prepares.
it could discretionary fensterelemente prepares umbenannt moved go etc. without in anybody point into quelltest interfere To must.
but too for fangemeinde the Object Creator 4.1 it can include useful his.
unfortunately are The possibilities to buttongestaltung right limited.
with the skcontrol.dll has one against it crazy possibilities. The benutzung means however jedesmal manuellen invasion into quelltext, if one element moved or in the size changed becomes.

my idea was now following:
I have a include written, The one überblenden of beliebigen controls allows.

one prepares So how dwelt (z.b. with VWP2) its surface with the buttons.
z.b. can now with extbut#.hoverbutton(addr(Button1&)) from the button1 a hoverbutton zaubern.
the method get The address the variables übermittelt, The the lever of button1 contains.
she puts then the stature and site the button1 solid.
then becomes the buttontext gotten.
then becomes the button1 destroy.
then is with the skcontrol.dll one hoverbotton on the equal position and identischer size prepares.
and To guter letzt becomes the new lever in the middle-aged variables button1& stored. I can means moreover with the variables button1& works, The now the lever the hoverbuttons contains.

I can means with one Program the 10 buttons has by the add of only 13 zeilen quelltext, from all buttons hoverbuttons make. the appearance remaining unchanged, no quelltext must changed go.

shift I buttons in of my entwicklungsumgebung or change sizes, affects the immediate without further hoisted on The hoverbuttons from.
to the principle can I arbitrary items, The only as Placeholder serve with others self-defined überblenden.
too for positionierung of listviews with franks listview.dll inspired suitable !!

nachfolgend whom quelltext and a short codeschnipsel for syntax.
CompileMarkSeparation
 $I SKControl.inc
Def GetWindowRect(2) !"USER32", "GetWindowRect"
Def GetWindowRgn(2) !"USER32", "GetWindowRgn"
DEF MapWindowPoints(4) ! "USER32", "MapWindowPoints"
Def GetSysColor(1) !"USER32","GetSysColor"
class extbuttons = bcolor&,   farbe des buttons
tcolor&,   farbe der schrift
hfont&,    fonthandle von create font
x&,        koordinate
y&,
sx&,        breite des buttons
sy&,
skdll_init@,
skdll_deinit@,
hskdll&,
get_bdimension@,             buttondimension ermitteln und umrechnen rückgabe gettext des buttons
hoverbutton@,
colorhoverbutton@,
colorhoverimagebutton@,
setcolor@,
setfont@,
dateedit@

proc extbuttons.skdll_init

    declare .hskdll&
    .hskdll& = UseDll("SKControl.dll")

    if .hskdll& = 0

        MessageBox("SKControl.dll konnte nicht geladen werden","Fehler",48+4096)
        end

    endif

    SKCtrl_InitDll()   Dll initialisieren...

endproc

----------------auf jeden fall vor beenden des programms ausführen--------------

proc extbuttons.skdll_deinit

    SKCtrl_DeInitDll()
    FreeDll .hskdll&

endproc

--------------nur ne hilfsfunktion-----------------------------------------

proc extbuttons.get_bdimension

    parameters bhadr&
    declare bh&,bt$,adr&,b#
    dim b#,16
    bh& = long(bhadr&,0)
    GetWindowRect(bh&,b#)
    MapWindowPoints(0,%hwnd,b#,2)
    bt$ = gettext$(bh&)
    DestroyWindow(bh&)
    .x& = Long(b#,0)
    .y& = Long(b#,4)
    .sx& = Long(b#,8)-Long(b#,0)
    .sy& = Long(b#,12)-Long(b#,4)
    dispose b#
    return bt$   buttontext

endproc

-----------um farben für colorbutton zu setzen, gilt dann für alle nachfolgenden buttons---------

proc extbuttons.setcolor

    parameters tcolor&,bcolor&
    .tcolor& = tcolor&
    .bcolor& = bcolor&

endproc

----------------erklärt sich wohl alleine----------------------------------

proc extbuttons.setfont

    parameters font$,höhe&,breite&,fett&,kursiv&,unterstrichen&
    .hfont& = CreateFont("Arial",höhe&,breite&,fett&,kursiv&,unterstrichen&)

endproc

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

proc extbuttons.hoverbutton

    parameters bhadr&    speicheradresse des buttonhandles
    declare bt$
    bt$ = .get_bdimension(bhadr&)
    long bhadr&,0=SKCtrl_CreateHoverButton(%hwnd,addr(bt$),.x&,.y&,.sx&,.sy&, %hInstance)
    setfont long(bhadr&,0),.hfont&

endproc

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

proc extbuttons.colorhoverbutton

    parameters bhadr&    speicheradresse des buttonhandles
    declare bt$
    bt$ = .get_bdimension(bhadr&)
    long bhadr&,0=SKCtrl_CreateClrHoverButton(%hwnd,addr(bt$),.tcolor&,.bcolor&,.x&,.y&,.sx&,.sy&, %hInstance)
    setfont long(bhadr&,0),.hfont&

endproc

------------------imagehandle& ist optional--------------------------------

proc extbuttons.colorhoverimagebutton

    parameters bhadr&,image$,pos&,imagehandle&    speicheradresse des buttonhandles
    declare bt$,ico&,hndl&
    bt$ = .get_bdimension(bhadr&)
    case right$(lower$(image$),4) = ".ico" : ico& = 1
    case pos& = 1 : .sx& = -.sx&    rechts daneben
    case pos& = 2 : .sy& = -.sy&    unten

    if pos& = 3                     oben

        .sx& = -.sx&
        .sy& = -.sy&

    endif

    if imagehandle& <> 0

        hndl& = 1  noch nicht fertig

    else

        imagehandle& = addr(image$)

    endif

    long bhadr&,0=SKCtrl_CreateClrHvrImageButton(%hwnd,imagehandle&,addr(bt$),ico&,hndl&,.tcolor&,.bcolor&,.x&,.y&,.sx&,.sy&, %hInstance)
    setfont long(bhadr&,0),.hfont&

endproc

-------------------------------macht aus einem bel. control ein dataedit----------------

proc extbuttons.dateedit

    parameters bhadr&
    .get_bdimension(bhadr&)
    long bhadr&,0 = Create("DateEdit",%hwnd
class=s3>"",.x&,.y&,.sx&,.sy&) endproc

statement to application:
CompileMarkSeparation
declare extbut#
dim extbut#,extbuttons
..... buttondefinitionen etc.

Proc shape1OnInit

    extbut#.skdll_init()

ENDPROC

Proc shape1OnShow

    extbut#.setcolor(0,getsyscolor(15)+rgb(10,10,10))
    extbut#.setfont("Arial",16,0,0)
    extbut#.hoverbutton(addr(Button1&))
    extbut#.colorhoverimagebutton(addr(Button2&),"liste.ico")
    extbut#.colorhoverimagebutton(addr(Button3&),"liste.ico")
    extbut#.colorhoverimagebutton(addr(Button4&),"leer.ico")

ENDPROC


over one feedback would I forward.
too ask To VWP2 beantworte I gladly.

r.r.
 
06/21/04  
 



Hmmm klinkt cool, means either be I powerful dull, or just not up-to-date. I belt manchen Topics here really garnix. don't be cross with me therefore, but I do not have really kappiert How I these Inc nutzbringend anwende, means I mean should The inc what on it Change, the one to-How-to its Buttons simply anlegt How yet? I faith The Inc birgt something Geniales insich, but I begreife it only not.

Nixkappier, iF
 
06/22/04  
 




Ragnar
Rehbein
I know Yes not, How You your buttons anlegst ?
if You everything only hard codiert inkl. the Coordinates into quelltext reinhämmerst, do you need The inc not.
if You however with a tools, your surfaces quasi by drag and drop erstellst (z.b. with VWP2, so in delphi), become You check, that the möglichtkeiten the present controls not always suffice.
with this inc sustain one the possibility the entire proposition always fully grafisch edit to, however Own controls To using.
The buttons serve quasi only as Placeholder, The to laufzeit ausgetauscht go. The properties the erstellten controls go vererbt and the parents then gekillt .
I know with XProfan no einfachere method circa quick and flexibly !!! surfaces to create.

r.r.
 
06/22/04  
 



Argh now habs ichs understood. Nunja, clear, means i'm so one code-Einhämmerer How You Yes so beautiful meant, Controls with of/ one GUI create/positionieren is for me one Grauß. this is for me vergleichbar with the works with Frontpage & Co. circa Htmls to create, what me not in whom head weg likes. there praise I me The Präzision of Notepad.

game here but no role, I have sense and weight your Inc now understood (I know too the the nix with GUI To do has), and these too ausprobiert. I find The idea supahh!

iF
 
06/22/04  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.865 Views

Untitledvor 0 min.
Gast.0815 vor 6 Tagen
ecki01/11/23
Axel Berse01/04/23
Langer01/29/22
More...

Themeninformationen

this Topic has 2 subscriber:

unbekannt (2x)
Ragnar Rehbein (2x)


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