Archive: Color, backgrounds, etc...


Color, backgrounds, etc...
I'm trying to make a custom page menu that will show some links for user options (using InstallOptionsEx) and these links will be images. But I want to change the color of the grey background of the dialog and was wondering how to do this?

I've got


...
Page Custom Pre Post
...
Function Pre
InstallOptionsEx::initDialog /NOUNLOAD PLUGINSDIR\install_menu.ini
Pop $HWND
SetCtlColors $HWND 000000 ff0000
InstallOptionsEx::show
FunctionEnd

I don't want blue, but this is just to see if it works. Any help would be much appreciated.

Also, I've modified Contrib/UIs/modern.exe as well as modern_headerbmp.exe to be larger (550x399) and was wondering what all the controls in there were for? It seems as if there are multiple controls for different items?

Ok, I've partly answered my own question (I guess that's Murphy's Law, once you post, you figure it out). Anyways, I'm able to change the background color through .onGuiInit with


...
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
...
Function myGuiInit
SetCtlColors $HWNDPARENT 000000 777777
...
FunctionEnd

This could be considered as a feature request. Right now you can't set the page color just by configurating the INI file (you had to use SetCtlColors instead). I'm gonna look over this to see what I can do in short term.


So, I've got this stuff working, but now I want to make an image into a link and I can't get it to work. This is what I've got so far...


[Field 1]
Type=Link
Left=
Right=
Top=
Bottom=
Width=
Height=
Notify=ONCLICK

[Field 2]
Type=Bitmap
Text=resource\image.bmp
Left=
Right=
Top=
Bottom=
Width=
Height=

*Note: left, right, top, bottom, width, and height all have the same values for these two fields (and they're non-blank).

If I do it in this order, nothing is shown, but there is a link at those coordinates. If I switch the order of the two fields, then the image is shown, but there is no link there.

Also, is there a way to make a link transparent so that the bitmap I have placed beneath it can be seen?

Help...!

Don't specify Height and Width. Right and Bottom are considered first.

Hmmm... The non-transparency bug of Link controls is a bug. Now, the bitmap one is not a bug because you didn't put any notifications in it. If you did, there would be another bug that don't change the mouse pointer cursor to a hand, the problem that all controls have at this moment. I'll gonna try to fix them when I return to the development of IOEx.


Okay, so now I've got this:


[Field 1]
Type=Bitmap
Text=resource\image.bmp
Left=0
Right=100
Top=0
Bottom=100
Width=
Height=
Notify=ONCLICK

[Field 2]
Type=Link
Left=0
Right=100
Top=0
Bottom=100
Width=
Height=
Notify=ONCLICK


and this will work, but the image doesn't have the hand when the cursor is over it like a normal link.

Hmm... I don't think I should fix the non-transparency problem with Link controls, because I would need to do this with other of controls like Label and Checkbox. This would make necessary manually handling most of the messages to change those controls when the page is running, making the plugin even bigger.

I don't know how to implement the change of mouse pointers for controls. Maybe adding another INI value name for this purpose and make it work with certain notifications?


I think that this would be another one of those link transparency issues because if I had the link field first (which causes the bitmap not be shown, then the mouse changes to the hand in the appropriate place), then the link would be transparent and you would only see the bitmap.

I think I found in the code where to make the link transparent, but I'm not sure how to go about it and I don't really have time to figure it out. I think it's at the switch statement around line 1899:


// BgColor
//--------------------------------------------------------------
if((COLORREF)myGetProfileInt("BgColor", 0xFFFFFFFF) == 0xFFFFFFFF)
switch(pField->nType) {
case FIELD_TEXT:
case FIELD_LISTBOX:
case FIELD_COMBOBOX:
pField->crBgColor = GetSysColor(COLOR_WINDOW);
break;
case FIELD_DATETIME:
case FIELD_MONTHCALENDAR:
pField->crBgColor = GetSysColor(COLOR_INFOBK);
break;
case FIELD_LINK:
pField->crBgColor = myGetProfileInt("BgColor", 0xFFFFFFFF);
break;
default:
pField->crBgColor = myGetProfileInt("BgColor", 0xFFFFFFFF);
break;
}
else
{
if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)
pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;
pField->crBgColor = myGetProfileInt("BgColor", 0xFFFFFFFF);
}

And I put in the case for FIELD_LINK, even though it's not doing anything right now.

Did you even read what I wrote in my last 2 posts? I just told you why I'm not going to support this feature of "transparency" anymore. I had that "feature" because of a bug that existed with Link controls, which was fixed on the current IOEx version. Means that this feature you're pursuing was really a bug.


Is there a place I can get this older version from so that I can have this bug that I want?


Oh crap. I always thought that I had someday implemented this but actually never even did. I don't know why this "trick" was still on docs... :confused: Thank you anyways for reporting this.