Jump to content


Photo

Max Winapi - My Windows Controls Dll


  • Please log in to reply
372 replies to this topic

#101 fogger

fogger

    Clockwerk Studios

  • GMC Member
  • 430 posts
  • Version:GM6

Posted 02 February 2007 - 05:36 AM

I was thinking, many dlls were made like this windows, buttons and whatnot. What I
want to ask really is can Gm draw on it? can it be treated like a normal Gm window and ill just add graphics stuff here and there, if I create a new object will it show up? or
is it just like roaches Dll (or whoever it was) that just creates a new window?

BTW: I still downloading
  • 0

#102 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 02 February 2007 - 06:58 AM

It is an API window, GM cannot draw on other windows there is no function that enables it to draw on other windows (except our own program communication example found somewere in the extending GM forum).

Hobbel, does your dll support richedits? here is a suggestion (which you guess you didn't already use). I suppose your dll could stream out normal text from richtexts so add a new function (ie: richtedit_getrtf) which streams out text in rtf format. This is completely possible using standard winAPI (look for stream out, EDITSTREAM and CALLBACK EDITSTREAM).
Regards,
  • 0

#103 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 02 February 2007 - 01:25 PM

I was thinking, many dlls were made like this windows, buttons and whatnot. What I
want to ask really is can Gm draw on it? can it be treated like a normal Gm window and ill just add graphics stuff here and there, if I create a new object will it show up? or
is it just like roaches Dll (or whoever it was) that just creates a new window?

BTW: I still downloading

<{POST_SNAPBACK}>


Yes, you can draw in the GM window.
But you have to place a static control behind your controls used as background.
  • 0

#104 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 02 February 2007 - 01:29 PM

It is an API window, GM cannot draw on other windows there is no function that enables it to draw on other windows (except our own program communication example found somewere in the extending GM forum).

Hobbel, does your dll support richedits? here is a suggestion (which you guess you didn't already use). I suppose your dll could stream out normal text from richtexts so add a new function (ie: richtedit_getrtf) which streams out text in rtf format. This is completely possible using standard winAPI (look for stream out, EDITSTREAM and CALLBACK EDITSTREAM).
Regards,

<{POST_SNAPBACK}>


It has a richedit control.
But it doesn't have special functions for it yet.
I was planning to make them, but I'm working on other new functions requested by Seeker right now.
  • 0

#105 fogger

fogger

    Clockwerk Studios

  • GMC Member
  • 430 posts
  • Version:GM6

Posted 03 February 2007 - 04:57 AM

Nice to know, and this pwns!! :)
<now where did I put that .dll>
  • 0

#106 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 03 February 2007 - 07:56 AM

It has a richedit control.
But it doesn't have special functions for it yet.
I was planning to make them, but I'm working on other new functions requested by Seeker right now.

If you implement what i asked for i'll definately use this, currently i couldn't create a working richedit rtf streamout without messing the whole dll. Take your time though.
NB: i was working on a private dll (it won't be exported to the public) and i really need to fix the richedit problem so could you help me? I also have a problem tab's icons for some reason the 32bit color gets degrade to 24 (or 16 not sure which) i used external file loading and the API i'm using doesn't have the option of which colour type to use so something else is wrong.
Rergards,
  • 0

#107 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 06 February 2007 - 06:15 PM

Update to version 1.5.0.0
- Added font dialog
- Added internal window scrollbar functions
- Added function to get control focus
- Added function to change the background color of a window
  • 0

#108 Seeker

Seeker

    GMC Member

  • GMC Member
  • 365 posts

Posted 07 February 2007 - 01:58 AM

Alright! Thanks a lot, h0bbel! :) I'll leave you alone now, since you've already done so much that was requested. I know it's not just for me, but still, I very much appreciate it.

Well, there is ONE thing I have to ask about.... The scrollbars are better now. But is it possible for you to make it so that every time one of the scroll components are clicked, the dll grabs the handles of all of the controls and child windows on the parent window and automatically moves/redraws them according to the scrollbar settings? I should be able to easily manipulate them, since I set up a data management system, and I should be able to use the get scrollbar position function to move the controls around as necessary, but I was hoping that this could be done automatically.

Also, the scrollbars don't react when you click on the scroll shaft.

Thanks again. :)
  • 0

#109 Da-Huntha

Da-Huntha

    GMC Member

  • New Member
  • 113 posts

Posted 09 February 2007 - 01:28 AM

Nice.
Recently I PMed you with a few bugs, did you get the PMs?
  • 0

#110 zephroelectro

zephroelectro

    GMC Member

  • New Member
  • 265 posts

Posted 09 February 2007 - 05:05 AM

Wow at the new functions :)
  • 0

#111 zephroelectro

zephroelectro

    GMC Member

  • New Member
  • 265 posts

Posted 09 February 2007 - 05:05 AM

Wow at the new functions :)
  • 0

#112 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 09 February 2007 - 11:18 AM

Nice.
Recently I PMed you with a few bugs, did you get the PMs?

<{POST_SNAPBACK}>


Yes, I'll try to fix them. :)
  • 0

#113 DtD

DtD

    Owner of DtD Software

  • New Member
  • 207 posts

Posted 11 February 2007 - 06:01 AM

Nice start! It also doesn't crack up too bad when you put the controls on the main GM window :D (Except that there is an exception 1000 when the game is ended, maybe the DLL is trying yo close GM's window which will be or already was closed)

Anyway, keep up the good work!

~DtD
  • 0

#114 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 12 February 2007 - 07:03 PM

Hobbel, do you support changing a richtext's background color and richtext text color+effects(ie: bold)?
If no, i could give you some c++ source code for both functions.
  • 0

#115 Darth

Darth

    GMC Member

  • New Member
  • 436 posts

Posted 12 February 2007 - 08:18 PM

Okay, I just have to ask this. After reading this topic, or at least trying to read it, I have found no where the solution to my previous post in this topic.

How do you create these controls into the game maker window?
Or something along those lines.

If anyone would at the very least point me in the right direction*

* I have not yet tried this DLL in detail so no jargon please.
  • 0

#116 antidote

antidote

    GMC Member

  • New Member
  • 117 posts

Posted 13 February 2007 - 12:56 AM

The biggest problem i've seen with API dlls is in regards to the Status bar it never updates and stays the same size. so you may want to look into that (you to Roach it is the same deal with yours)
  • 0

#117 Seeker

Seeker

    GMC Member

  • GMC Member
  • 365 posts

Posted 13 February 2007 - 01:10 AM

Okay, I just have to ask this. After reading this topic, or at least trying to read it, I have found no where the solution to my previous post in this topic.

How do you create these controls into the game maker window?
Or something along those lines.

If anyone would at the very least point me in the right direction*

* I have not yet tried this DLL in detail so no jargon please.

<{POST_SNAPBACK}>


You can put the controls on the Game Maker window using a static control so that it looks right, or you can place them on a window that is placed inside the Game Maker window.

<{POST_SNAPBACK}>


Option 1

// Create static control
API_Static_Create(window_handle(),x,y,width,height,style flags);

// Now when you create another control using one of the other functions, place it somewhere within the x and y range of the static control. Example:

WinGm = window_handle();
API_Static_Create(WinGm,0,0,100,100,SS_BLACKRECT);
API_Edit_Create(WinGm,0,0,100,15);

Option 2

But, for those of you who want to know how to make the second window a child window, just change this in the Create event of the Controller object in the example (line 5):

Win2 = API_Window_Create(100,100,800,620,WS_CAPTION|WS_SYSMENU|WS_MINIM
IZEBOX|WS_POPUP,Win);

to this

Win2 = API_Window_Create(100,100,800,620,WS_CAPTION|WS_SYSMENU|WS_MINIM
IZEBOX|WS_CHILD,Win);

<{POST_SNAPBACK}>


If you want to place the controls directly on the Gamemaker window, you'll have to use the static control option to make sure the controls are drawn correctly on the window. By specifying the style flags for the static control, found in the Manual, you can change the background color of the static control.

However, I suggest not using the static control option at all, but instead make another window inside of Gamemaker, then placing the controls on that internal window.

Could anyone make an example on how to use the scrollbars?

I really want to use them but i cant figure out how to make them work.

Thanks :)

<{POST_SNAPBACK}>


As of right now, the scrollbars will not fully work as you would want them to :lol: . They don't automatically update the contents of a window, so you have to do things manually. And even then, I've noticed that the scrollbars only work when they are placed on the window in check slot number 1. I have a working example, but it requires that you have a data management system set up for your application and some other structures that I set up for the visual designer I'm creating for the dll. I can't just give you the source file for it at this time, and you won't benefit from having tidbits of code, so you'd be better off making your windows condensed enough so that you don't need any scrollbars, or use multiple windows. I hope that the scrollbars can be even more improved in future releases, along with uuf6429's rich edit requests.

For better help on the dll, see h0bbel's forum at THIS LINK. I know most people don't like signing up for something new, but h0bbel took the time to set it up, and you'll definately get better and quicker answers over there.

Edited by Seeker, 14 February 2007 - 01:16 AM.

  • 0

#118 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 13 February 2007 - 01:39 PM

Okay, I just have to ask this. After reading this topic, or at least trying to read it, I have found no where the solution to my previous post in this topic.

How do you create these controls into the game maker window?
Or something along those lines.

If anyone would at the very least point me in the right direction*

* I have not yet tried this DLL in detail so no jargon please.

<{POST_SNAPBACK}>


You can put the controls on the Game Maker window using a static control so that it looks right, or you can place them on a window that is placed inside the Game Maker window.

<{POST_SNAPBACK}>


Option 1

// Create static control
API_Static_Create(window_handle(),x,y,width,height,style flags);

// Now when you create another control using one of the other functions, place it somewhere within the x and y range of the static control. Example:

WinGm = window_handle();
API_Static_Create(WinGm,0,0,100,100,SS_BLACKRECT|WS_VISIBLE);
API_Edit_Create(WinGm,0,0,100,15);

Option 2

But, for those of you who want to know how to make the second window a child window, just change this in the Create event of the Controller object in the example (line 5):

Win2 = API_Window_Create(100,100,800,620,WS_CAPTION|WS_SYSMENU|WS_MINIM
IZEBOX|WS_POPUP,Win);

to this

Win2 = API_Window_Create(100,100,800,620,WS_CAPTION|WS_SYSMENU|WS_MINIM
IZEBOX|WS_CHILD,Win);

<{POST_SNAPBACK}>


If you want to place the controls directly on the Gamemaker window, you'll have to use the static control option to make sure the controls are drawn correctly on the window. By specifying the style flags for the static control, found in the Manual, you can change the background color of the static control.

However, I suggest not using the static control option at all, but instead make another window inside of Gamemaker, then placing the controls on that internal window.

Could anyone make an example on how to use the scrollbars?

I really want to use them but i cant figure out how to make them work.

Thanks :P

<{POST_SNAPBACK}>


As of right now, the scrollbars will not fully work as you would want them to :wub: . They don't automatically update the contents of a window, so you have to do things manually. And even then, I've noticed that the scrollbars only work when they are placed on the window in check slot number 1. I have a working example, but it requires that you have a data management system set up for your application and some other structures that I set up for the visual designer I'm creating for the dll. I can't just give you the source file for it at this time, and you won't benefit from having tidbits of code, so you'd be better off making your windows condensed enough so that you don't need any scrollbars, or use multiple windows. I hope that the scrollbars can be even more improved in future releases, along with uuf6429's rich edit requests.

For better help on the dll, see h0bbel's forum at THIS LINK. I know most people don't like signing up for something new, but h0bbel took the time to set it up, and you'll definately get better and quicker answers over there.

<{POST_SNAPBACK}>


Damn I think I forgot to place the scrollbars in the other check slots.
I'll add them and say it when I done this.
  • 0

#119 h0bbel

h0bbel

    GMC Member

  • New Member
  • 252 posts

Posted 13 February 2007 - 02:49 PM

I updated the scrollbars.
But I still need to make the richedit functions.
  • 0

#120 Seeker

Seeker

    GMC Member

  • GMC Member
  • 365 posts

Posted 14 February 2007 - 01:16 AM

I updated the scrollbars.
But I still need to make the richedit functions.

<{POST_SNAPBACK}>


Thank you.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users