Page 1 of 3

DirectUIhwnd 1.0 : Emulation of MS control Released

Posted: Sun Aug 07, 2005 6:13 pm
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.

Posted: Sun Aug 07, 2005 7:44 pm
by thefool
works fast, flicker-free and easly here. nice job :)

Posted: Sun Aug 07, 2005 8:04 pm
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

Posted: Sun Aug 07, 2005 8:17 pm
by Fred
Yep, cool control !

Posted: Sun Aug 07, 2005 10:57 pm
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)

Posted: Mon Aug 08, 2005 8:53 am
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.

Posted: Mon Aug 08, 2005 9:56 am
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)

Posted: Mon Aug 08, 2005 10:00 am
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.!

Posted: Mon Aug 08, 2005 10:29 am
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)

Posted: Mon Aug 08, 2005 3:56 pm
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.

Posted: Mon Aug 08, 2005 4:10 pm
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!

Posted: Mon Aug 08, 2005 4:55 pm
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!

Posted: Mon Aug 08, 2005 5:19 pm
by Dare2
:lol:

Re: DirectUIhwnd 1.0 : Emulation of MS control Released

Posted: Mon Aug 08, 2005 8:39 pm
by Max.
localmotion34 wrote:here is the compliation of quite a while's work to emulate the DUIhwnd of MS. ...
Quite impressing!

Posted: Mon Aug 08, 2005 10:04 pm
by Num3
Been messing around with your code....

Here's how it looks now ;)

Image