DirectUIhwnd 1.0 : Emulation of MS control Released

Developed or developing a new product in PureBasic? Tell the world about it.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

DirectUIhwnd 1.0 : Emulation of MS control Released

Post by localmotion34 »

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.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

works fast, flicker-free and easly here. nice job :)
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Very Very Cool localmotion 8) :D
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. :twisted: :lol:
But it works really fine, cool one there Localmotion. :D

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.
Best regrads
Henrik
Fred
Administrator
Administrator
Posts: 18237
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yep, cool control !
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

really cool! congrat, nice work! :wink:


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,
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

@va!n:

imageplugin:

Code: Select all

up1:IncludeBinary "h:\PureBasic Files\up.jpg"
down:IncludeBinary "h:\PureBasic Files\up1.jpg"
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.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@thefool:

Code: Select all

up1:IncludeBinary "h:\PureBasic Files\up.jpg"
down:IncludeBinary "h:\PureBasic Files\up1.jpg"
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)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

..? Of course the lib contains those images! he just forgot to put them in the source package!

thats why i suggest him to re-release with the images so i can test if filesize drops using bmp's instead.!
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

thefool wrote:..? Of course the lib contains those images! he just forgot to put them in the source package!
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
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 aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

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.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

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!
@}--`--,-- A rose by any other name ..
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

@localm: thanks. However its not the "huge" jpeg's its the jpeg plugin wich is huge.! so even if both images increases 100% in size when bmp's i think the lib will be several kb's smaller because it doesnt need jpeg plugin.
dare2: I need 48 hour days!
k, that will be on my todo-list. -the operator!
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

:lol:
@}--`--,-- A rose by any other name ..
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Re: DirectUIhwnd 1.0 : Emulation of MS control Released

Post by Max. »

localmotion34 wrote:here is the compliation of quite a while's work to emulate the DUIhwnd of MS. ...
Quite impressing!
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
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Been messing around with your code....

Here's how it looks now ;)

Image
Post Reply