Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29306 Discussions

Adding background color to Quickwin or Win32 dialog box

sumitm
Beginner
1,386 Views
Hi,
I was wondering if there was an easy way to add color to the following:
  • text edit box (not rich edit)
  • Scroll bars
  • Buttons

I could not find any examples of these. The only one I could find an example of was a progress bar and

iret = DlgSendCtrlMessage(context % PBDlg, IDC_PROGRESS1, PBM_SETBARCOLOR, 0, cref)

seem to do the job very well.

If some one could show the actual code line to do that for edit boxes, buttons and scroll barsit would be great. I could not make any sense from the help on GETSYSCOLOR and SETSYSCOLOR, WM_CTLCOLOREDIT etc and besides there is not an example of usage alongside that help

Finally, another stupid question. How does one search this forum. The search button on the top will search everything on Intel's site for a keyword. I want to search by keyword just in this forum.

Any help would be appreciated.

Thanks

0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,386 Views
Forum search is at the bottom of the page.
0 Kudos
sumitm
Beginner
1,386 Views
Thanks Steve!
Jugoslav,
I tried to use your XFLOGM to add background colors to my dialog boxes
In my original code I had a number of the following
retlog=DlgSet(dlg,IDC_Z1,1009,dlg_range)
For some reason dlg_range would not be acceptable and when I replaced it with dlg_rangemax it went through (use xflogm instead of use dflogm)
Now when I compile I get the following 7 unresolved externals. What do I need to include to get out of the errors.
I downloaded the xflogm version 2.0 from your website.
My basic question is if I leave my basic code the same and replace use dflogm with use xflogm will that work or do I have to add other things.
Thank you for your help as always.
Sumit
Heatpro.obj : error LNK2001: unresolved external symbol _XFLOGM_mp_PXDLGINIT@12
Heatpro.obj : error LNK2001: unresolved external symbol _XFTCTRL_mp_XCTLSETSUB@16
Heatpro.obj : error LNK2001: unresolved external symbol _XFTCTRL_mp_XCTLSETLOG@16
Heatpro.obj : error LNK2001: unresolved external symbol _XFTCTRL_mp_XCTLSETCHAR@20
Heatpro.obj : error LNK2001: unresolved external symbol _XFTCTRL_mp_XCTLSETINT@16
Heatpro.obj : error LNK2001: unresolved external symbol _XFLOGM_mp_DLGMODAL@8
Heatpro.obj : error LNK2001: unresolved external symbol _XFTDIALOG_mp_XDESTROYDIALOG@4
sbo2_3___Win32_Release/sbo2_3.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,386 Views

Sumit,

If you replace Dflogm with Xflogm it should work. Please let me know if it doesn't.

If I recall correctly, in xflogm 2.0 I removed DLG_RANGE (=hiword+loword)and used DLG_RANGEMIN/DLG_RANGEMAX as in DFLOGM documentation.

To use XFLOGM2, you have to link against XFT.lib (append it to project/settings/link/object-library modules).
Jugoslav
0 Kudos
sumitm
Beginner
1,386 Views

Dear Jugoslav,

I tried using use xflogm in the CVF example sample provided with the compiler by the name of Whizzy and it works great.

I could even change the background of the celcius box to green with the following:

retlog = DlgSet( dlg, IDC_EDIT_CELSIUS,#008000, DLG_BKCOLOR )

However, in the Code (another workspace and project)I have which is much longer and complex, I keep getting the same LNK2001 errors as in my previous posting.

I have added the xft.lib (unlder link)and the xft/include directory is also in the search path

What else could be wrong to get the following type errors.

error LNK2001: unresolved external symbol _XFLOGM_mp_DLGINIT@8

I must be doing something wrong.

I have may dialog boxes in my project. I havent changed all of them to xflogm. Could that be a problem.

Thanks for any suggestions.

Sumit

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,386 Views
Hmmm... there's no such thing as _XFLOGM_mp_DLGINIT@8. DlgInit is generic:
INTERFACE DlgInit
MODULE PROCEDURE PXDlgInit
MODULE PROCEDURE PXDlgInitWithResourceHandle
END INTERFACE
It sounds like you have an old XFLOGM.mod (from XFLOGM 1.0) hanging around, maybe in .Debug folder orin the Include path before XFTInclude directory.
Jugoslav
0 Kudos
sumitm
Beginner
1,386 Views
Thanks.
That was it.
There was a xflogm.mod in my release directory from eons ago.
This a project that has been just building up over the years.
So far it compiles fine.
Thanks for your help.
Sumit
0 Kudos
sumitm
Beginner
1,386 Views
Dear Jugoslav,
I need help with two more items.
1. I have been able to add color to my scrollbars and text boxes but when I go to add ICONS to buttons, I am able to load only the system ICONS.
The following works
Hicon=LoadIcon(NULL, IDI_HAND)
retlog = DlgSet(Dlg, IDC_L11, Hicon, DLG_ICON)
but if I created a 32x32 icon myself called IDI_ICON2 it does not load on the button. I think the LoadIcon function is not filled with correct arguments.
I have tried
Hicon=LoadIcon(GETHWNDQQ(QWIN$FRAMEWINDOW),IDI_ICON2)
and also
hIcon = LoadImage(GETHWNDQQ(QWIN$FRAMEWINDOW), %val(MAKEINTRESOURCE(IDI_ICON2)), IMAGE_ICON,GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON),0)
What do I need to do to load Icon from a resource file and display it on a button.
2. The second help I need is on my scroll bars. After I put xflogm on the scroll bars cannot be slided to increase / decrase values. It is kind of stuck. Does xflogm have dlg_position defined or can I do a use only of dflogm to get that functionality.
Thanks for your help
Sumit
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,386 Views

Sumit,

1) You need hInstance as first argument to LoadIcon/LoadImage, which you can obtain using GetModuleHandle(0).

2) Sounds like bug in XFLOGM (I think I know what I forgot -- see"Example" in xftwnd/message handlers/WM_VSCROLL in help). I'llinvestigate & let you know about the update.

Jugoslav

0 Kudos
sumitm
Beginner
1,386 Views
Thanks Jugoslav,
I have got all the button Icons displayed.
Wish basic quickwin had all these to make life more colorful from the beginning.....
Anyways, when you get a chance to update the XSCROLLBARSet please let me know. I will not try to mess with your code.
One other question, I had was with regard to distributing this new application to other computers. The basic CVF redistributeable package of VFRUN** should still work, right? I do not need to supply anything else like the xft.lib ?
Thanks for your help.
Sumit
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,386 Views

No additional files should be redistributed with XFT-based applications.

I'll let you know about the update -- alas, I'm a little buried at the moment.

Jugoslav

0 Kudos
Reply