jpm Posted March 26, 2004 Share Posted March 26, 2004 I want to be able to have specific background color of a label control.I modified the handling of WM_CTLCOLORSTATIC in application.cpp case WM_CTLCOLORSTATIC: g_oGUI.SetColor((HDC) wParam, (HWND) lParam); /* if (g_oGUI.m_nBackground != -1) { SetBkColor((HDC)wParam, g_oGUI.m_nBackground); } else SetBkColor((HDC)wParam,GetSysColor(COLOR_BTNFACE)); */and add special code in the gui classvoid CGuiBox::SetColor(HDC hdc, HWND hWnd) { int nColor = GetSysColor(COLOR_BTNFACE); if (m_nBackground != -1) nColor= m_nBackground; int i= GetControlID(hWnd); if (i>0) { if (GUICtrl[i].nBackColor>0) nColor = GUICtrl[i].nBackColor; if (GUICtrl[i].nTextColor>0) SetTextColor(hdc, GUICtrl[i].nTextColor); } SetBkColor(hdc, nColor); } // SetColorI get the following result which does not fill the complete control areathe label have been created with the default valueOpt("GuiCoordMode", 2) GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUICreateEx("",0xFFFFFF) GUISetControl("label", "label1", 0,0,100,300) GUISetControlEx(-1,-1,$GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM, "", 0x0,0xFF0000) GUISetControl("label", "label2", 0,-1) GUISetControlEx(-1,-1,$GUI_DOCKTOP+$GUI_DOCKBOTTOM, "", 0xFF,0xFF00) GuiWaitClose()I need some help in this last feature.do I will just to create the label with special style or I need more code.? Link to comment Share on other sites More sharing options...
jpm Posted March 26, 2004 Author Share Posted March 26, 2004 I get the start of the solution 101.12? Link to comment Share on other sites More sharing options...
jpm Posted March 26, 2004 Author Share Posted March 26, 2004 this new label color thing is french to me.... get it... ha ha. OK, so .12 is final... now Jon needs to get this into unstable (beta) so we can have it released before May.Lar.Sorry English speaking people difficult to do your flag with just labels.Larry,Do you think it is possible to put label on label? I cannot have the latest defined displayed. Link to comment Share on other sites More sharing options...
jpm Posted March 26, 2004 Author Share Posted March 26, 2004 I need to massage the source. is uploaded?I do it Link to comment Share on other sites More sharing options...
jpm Posted March 26, 2004 Author Share Posted March 26, 2004 Upload of the source done. you get GUIcolor.au3 to find out what is good or not. Thanks Larry. Link to comment Share on other sites More sharing options...
jpm Posted March 27, 2004 Author Share Posted March 27, 2004 in controlex() I did this... if (GUICtrl[m_iCurCtrl].cType == GUI_LABEL) { if (nExt1 == -1 ) GUICtrl[m_iCurCtrl].nTextColor = GetSysColor(COLOR_BTNTEXT); else GUICtrl[m_iCurCtrl].nTextColor = nExt1; if (nExt2 == -1 ) GUICtrl[m_iCurCtrl].nBackColor = GetSysColor(COLOR_BTNFACE); else GUICtrl[m_iCurCtrl].nBackColor = nExt2; } I think the GUIcolor.au3 is coded badly... GUISetCoord(20,20) GUISetControl("label", "label", 0,0) or something... if I do... GUISetCoord(20,20) GUISetControl("label", "label", 0,-1) I see my label.Thanks Larry, Since the source for 102 is uploaded perhahs not final but at least a good start I am going to generate 102.12 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now