DirectUIhwnd 1.0 : Emulation of MS control Released
-
- Enthusiast
- Posts: 665
- Joined: Fri Sep 12, 2003 10:40 pm
- Location: Tallahassee, Florida
DirectUIhwnd 1.0 : Emulation of MS control Released
here is the compliation of quite a while's work to emulate the DUIhwnd of MS. ive seen similar attempts on codeproject, which use drawing, hittest and other messages to emulate this. the result was a 105K LIB.
my lib should add about 20K to an EXE, which can be alot for you size freaks out there, but you cant get a control like this for free, sizewise.
this is a control for those of you who arent obsessed with EXE size, but do not be fooled into thinking that it is by any means slow at all.
if you peek at the design, this control naturally leads into a MS Outlook control, which will be based on the same principles as this. i designed it this way on purpose, so both will really extend functionality of PB and not bloat the EXE much at all.
HOW IT WORKS:
add a DUI pane, add a DUIhwnd, and then you can add a particular link. the ProcedureReturn for the DUI link is the PB NUMBER OF THE HYPERLINK GADGET. that way, you can do this:
link=addDUIlink(0,0,0,"Message Box",$FF04)
and in the event loop:
case link
dowhatever()
each link you add can have any function at all that PB or the API supports.
and here's the link for the ZIP:
http://www.penguinbyte.com/apps/pbwebst ... rectUI.zip
please report any bugs, or comments and suggestions before i make this a final release and continue on to the Outlook control.
my lib should add about 20K to an EXE, which can be alot for you size freaks out there, but you cant get a control like this for free, sizewise.
this is a control for those of you who arent obsessed with EXE size, but do not be fooled into thinking that it is by any means slow at all.
if you peek at the design, this control naturally leads into a MS Outlook control, which will be based on the same principles as this. i designed it this way on purpose, so both will really extend functionality of PB and not bloat the EXE much at all.
HOW IT WORKS:
add a DUI pane, add a DUIhwnd, and then you can add a particular link. the ProcedureReturn for the DUI link is the PB NUMBER OF THE HYPERLINK GADGET. that way, you can do this:
link=addDUIlink(0,0,0,"Message Box",$FF04)
and in the event loop:
case link
dowhatever()
each link you add can have any function at all that PB or the API supports.
and here's the link for the ZIP:
http://www.penguinbyte.com/apps/pbwebst ... rectUI.zip
please report any bugs, or comments and suggestions before i make this a final release and continue on to the Outlook control.
Code: Select all
!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Very Very Cool localmotion
Workes perfect..
it would be even more perfect if "you = the user", could ad other gadgets but addDUIlink's
But i guess you would say "Go make your own DUI if you want that" he. he.
But it works really fine, cool one there Localmotion.
Ups btw. in the example add delay it eats up a hell of cpu as is now..
Best regrads
Henrik


Workes perfect..
it would be even more perfect if "you = the user", could ad other gadgets but addDUIlink's
But i guess you would say "Go make your own DUI if you want that" he. he.


But it works really fine, cool one there Localmotion.

Ups btw. in the example add delay it eats up a hell of cpu as is now..
Code: Select all
Select WindowEvent()
Case 0
Delay (10)
Case #PB_Event_Gadget
bla. bla.
Henrik
really cool! congrat, nice work! 
Edit:
@localmotion: i have studied your great lib a bit more! But there are a lot of purebasic libs/commands you are included in your lib and so your lib will still add some KB to the exe!
i dont know why you are using libs like...
- Date
- ImagePlugIn
- ImagePlugInJPEG
I am sure, you can remove the "ImagePlugin/ImagePlugInJPEG" stuff and the exe size of projects using your lib will be a lot smaller!!?
anyway nice stuff (all done with 2d drawing as i can see, right? respect)

Edit:
@localmotion: i have studied your great lib a bit more! But there are a lot of purebasic libs/commands you are included in your lib and so your lib will still add some KB to the exe!
i dont know why you are using libs like...
- Date
- ImagePlugIn
- ImagePlugInJPEG
I am sure, you can remove the "ImagePlugin/ImagePlugInJPEG" stuff and the exe size of projects using your lib will be a lot smaller!!?

anyway nice stuff (all done with 2d drawing as i can see, right? respect)
Last edited by va!n on Mon Aug 08, 2005 9:59 am, edited 1 time in total.
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
@va!n:
imageplugin:
he is using the pics for the arrows 
when is he using date plugin?
and furthur: does pb add all the libs he is using to the userlib?
@LocalMotion: are you 100% sure it isnt worth to stop using jpeg pics and use bmp instead then leave jpeg plugin out?
if you supplied the arrow pics i could compile it myself and test, however i cant do that now.
imageplugin:
Code: Select all
up1:IncludeBinary "h:\PureBasic Files\up.jpg"
down:IncludeBinary "h:\PureBasic Files\up1.jpg"

when is he using date plugin?
and furthur: does pb add all the libs he is using to the userlib?
@LocalMotion: are you 100% sure it isnt worth to stop using jpeg pics and use bmp instead then leave jpeg plugin out?
if you supplied the arrow pics i could compile it myself and test, however i cant do that now.
@thefool:
the package dont include this two jpg images! i think he included it inside the lib and that may be the reason why he is using ImagePluginJPEG in his lib instead using just normal BMP to increase the size 
i dont know when and where he is using the DateLib but his Lib will use any part of it (i am still wondering too).
i think, if you write your own lib and need to use any command of another lib, so this lib (or its part) will be included as well to your compiled exe! (else it would make no sence)
Code: Select all
up1:IncludeBinary "h:\PureBasic Files\up.jpg"
down:IncludeBinary "h:\PureBasic Files\up1.jpg"

i dont know when and where he is using the DateLib but his Lib will use any part of it (i am still wondering too).
i think, if you write your own lib and need to use any command of another lib, so this lib (or its part) will be included as well to your compiled exe! (else it would make no sence)
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
thefool wrote:..? Of course the lib contains those images! he just forgot to put them in the source package!
yes, what i say... the images are included isnside the lib!! so you need the two includebinary lines for the jpg (as the jpg are not included in the zip as standalone)va!n wrote: the package dont include this two jpg images! i think he included it inside the lib and that may be the reason why he is using ImagePluginJPEG in his lib instead using just normal BMP to increase the size Wink
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
-
- Enthusiast
- Posts: 665
- Joined: Fri Sep 12, 2003 10:40 pm
- Location: Tallahassee, Florida
thats exactly it. i have included the JPEG inside the LIB itself to prevent from having to redistribute the JPEGs themselves. they are like 2k each, very small and for the buttons of the DUI. i released the source for people to look over and get an idea of how i did this. many of my ideas were sparked by code someone else wrote.
i did not bring my USB thumb drive to school today with me, and it has the images on it. when i get home, i will reZIP the package, complete with the button images.
i did not bring my USB thumb drive to school today with me, and it has the images on it. when i get home, i will reZIP the package, complete with the button images.
Code: Select all
!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Pretty neat!
(I used the source for a quick play with it - and two oddball jpegs and renamed them, so it has an odd look. But I got the drift of it.)
Not sure (I might be imagining this, it was a fast glance) but it seems the last two boxes sometimes lose their displayed text when open and then scrolling up and down again.
Anyhow, gotta check out your source and see how you did this!
I need 48 hour days!
(I used the source for a quick play with it - and two oddball jpegs and renamed them, so it has an odd look. But I got the drift of it.)
Not sure (I might be imagining this, it was a fast glance) but it seems the last two boxes sometimes lose their displayed text when open and then scrolling up and down again.
Anyhow, gotta check out your source and see how you did this!

@}--`--,-- A rose by any other name ..
Re: DirectUIhwnd 1.0 : Emulation of MS control Released
Quite impressing!localmotion34 wrote:here is the compliation of quite a while's work to emulate the DUIhwnd of MS. ...
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0