Page 5 of 7

Re: Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 3:46 am
by srvet_claudio
Pablo, when I have time I make it.

Re: Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 7:44 am
by mol
great!

Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 12:49 pm
by Pablo César
Ok Claudio. I understand.

Sorry to ak to you do... :oops:

The strange is accept to be BS_OWNERDRAW by initbutton and by changing style function but the button is not displaying. Exists, you can click where supose to be and works but not appears any button image. :|

I think need redraw button and to implement at event to keep its properties... :?

Searching at this msdn link https://msdn.microsoft.com/en-us/librar ... S.85).aspx
(most probably it's the same way of Grigory done in ODT_TAB)

The DRAWITEMSTUCT is what we will be using to color our buttons:

Code: Select all

typedef struct tagDRAWITEMSTRUCT {
	UINT CtlType;
	UINT CtlID;
	UINT itemID;
	UINT itemAction;
	UINT itemState;
	HWND hwndItem;
	HDC hDC;
	RECT rcItem;
	ULONG_PTR itemData;
} DRAWITEMSTRUCT;
I suppose that we need to make our own WM_DRAWITEM. So, after this, we have converted the lParam into our DRAWITEMSTRUCT, now all you have to do is color it.

Code: Select all

case WM_DRAWITEM:
	 {
		DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)lParam;
		return TRUE;
	 }
This is C++, but it could give an idea. In HMG Extended it's using OwnButtonPaint function (which I also included as comment).

Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 1:43 pm
by Pablo César
Hi All,

Regarding USER_COMPONENTS in both examples, note we are not defining at demo prgs, this is doing by HMG calling i_UsrSOOP.ch file automactically. ;)

Very nice, doesn't It ? :)

Roberto left us a flexible way that allows the user to add components. I've never understood this availability as well as now. It's hard to understand a genius.

Thanks again, Roberto.

Image Image

Re: Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 4:53 pm
by srvet_claudio
Pablo César wrote:Ok Claudio. I understand.

Sorry to ak to you do... :oops:

The strange is accept to be BS_OWNERDRAW by initbutton and by changing style function but the button is not displaying. Exists, you can click where supose to be and works but not appears any button image. :|

I think need redraw button and to implement at event to keep its properties... :?

Searching at this msdn link https://msdn.microsoft.com/en-us/librar ... S.85).aspx
(most probably it's the same way of Grigory done in ODT_TAB)

The DRAWITEMSTUCT is what we will be using to color our buttons:

Code: Select all

typedef struct tagDRAWITEMSTRUCT {
	UINT CtlType;
	UINT CtlID;
	UINT itemID;
	UINT itemAction;
	UINT itemState;
	HWND hwndItem;
	HDC hDC;
	RECT rcItem;
	ULONG_PTR itemData;
} DRAWITEMSTRUCT;
I suppose that we need to make our own WM_DRAWITEM. So, after this, we have converted the lParam into our DRAWITEMSTRUCT, now all you have to do is color it.

Code: Select all

case WM_DRAWITEM:
	 {
		DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)lParam;
		return TRUE;
	 }
This is C++, but it could give an idea. In HMG Extended it's using OwnButtonPaint function (which I also included as comment).
Button and Tab are examples of controls that have to be redrawn whole. That's why I do not like to implement them because it's like re-creating the UI.

Fixed and enhanced SAMPLES

Posted: Sat Nov 19, 2016 4:59 pm
by Pablo César
Yes, I'm understanding Claudio.

But we can do it for USER_COMPONENTS proposes and with this we can encourage the user to create their own new controls instead.

As first example, the coloured TAB which many user liked. ;)

We can show the way and users have to do their part...

Rgds
USER_COMPONENTS was updated:
viewtopic.php?p=47854#p47854

Fixed and enhanced SAMPLES

Posted: Sun Nov 20, 2016 9:42 pm
by Pablo César
Returning back "Print" which it were without any objective, now it can print the for thry internal HMG function PRINTWINDOW with PREVIEW optional.

So please be reconsidered as updated <HMG_Root_Folder>\include\i_UsrSOOP.ch file and updated USER_COMPONENTS pack for download it again with new options a main menu of Demo1.

See again previous mensage at:

viewtopic.php?p=47854#p47854

Fixed and enhanced SAMPLES

Posted: Wed Nov 23, 2016 1:40 am
by Pablo César
Hi Rathi and all,

I would like to add more one example for C:\hmg.3.4.3\SAMPLES\Advanced\USER_COMPONENTS.
Screen12.png
Screen12.png (36.5 KiB) Viewed 7601 times
This time some USER definition for HYPERLINKs and LABELs simulating hyperlink. This example contemplates chnging visual link color when be clicked (as normal browsers does) and address links now it could be for https, www, ErrorLog file (which is in html format), Word files by explorer association or any other document. Of course this example uses a differentiated i_UsrInit.ch file.

I've attached all files for your appreciation.

Hope everyone enjoys :P

Fixed and enhanced SAMPLES

Posted: Tue Nov 29, 2016 2:59 pm
by Pablo César
Dear Rathi,

There is this folder C:\hmg.3.4.3\SAMPLES\Miscellaneous\PEDIDOS that it could be moved to inside of C:\hmg.3.4.3\SAMPLES\Applications.

Do you agree ?

Fixed and enhanced SAMPLES

Posted: Wed Mar 01, 2017 1:47 pm
by Pablo César
Hi Rathinagiri,

At D:\hmg.3.4.3\SAMPLES\HFCL\ComboSearchBox\DEMO_1\main.hbc and D:\hmg.3.4.3\SAMPLES\HFCL\ComboSearchBox\DEMO_2\main.hbc contain:
incpaths=c:\hmg.3.0.45\hfcl\include
libpaths=
libs=hfcl
gt=
mt=no
instpaths=
Which is not necessary any more and not path is not available in this version, correct ? The HBC file would be deleted.
Pablo César wrote: Tue Nov 29, 2016 2:59 pm Dear Rathi,

There is this folder C:\hmg.3.4.3\SAMPLES\Miscellaneous\PEDIDOS that it could be moved to inside of C:\hmg.3.4.3\SAMPLES\Applications.

Do you agree ?
No answer to me about it ? :oops: