Commit 0ce22489 authored by Diederik van Arkel's avatar Diederik van Arkel

proper dialogue backgrounds

parent 202b7ac8
......@@ -8,7 +8,7 @@ import EdMouse, EdKeyboard
from StrictList import slFromList
from UtilStrictLists import StrictListToList,List,IsEmptyList,:!
import IDE,IdeState
import IDE,IdeState,IdePlatform
//--
......@@ -315,7 +315,8 @@ conswinPane ps
:+: Receiver lsid lsfun []
)
# watt = [ WindowPen [PenBack LightGrey]
# (dback,ps) = GetDialogBackgroundColour ps
# watt = [ WindowPen [PenBack dback]
, WindowClose (cancelFun win wloc wId)
, WindowId wId
, WindowOk okId
......
......@@ -14,7 +14,7 @@ import StdTuple, StdEnum, StdList, StdFunc, StdMisc
import StdMenu, StdWindow, StdId, StdPSt, StdControl
import StdClipboard, StdControlReceiver
import EdKeyMapping, EdState, EdClient, EdKeyboard
import IDE, IdeState, ExtNotice
import IDE, IdeState, ExtNotice, IdePlatform
import colorpickcontrol
import ioutil, morecontrols
import typewin, colourclip
......@@ -100,6 +100,7 @@ editColours ps
(Just (0,0)) ps
# buttonWidth = ContentWidth "Cancel"
# (ilook,wloc) = idslook wloc
# (dback,ps) = GetDialogBackgroundColour ps
# wdef = Dialog "Editor Colours"
( RGBColourPickControl` rgbid (prefs.syncols.textColour) ilook Nothing
:+: ButtonControl "&Copy"
......@@ -167,7 +168,7 @@ editColours ps
:+: TextControl "Keywords" []
:+: Receiver lsid lsfun []
)
[ WindowPen [PenBack LightGrey]
[ WindowPen [PenBack dback]
, WindowClose (cancelFun wloc wId)
, WindowId wId
, WindowInit (setBoxCol)
......@@ -345,6 +346,7 @@ defaultColours ps
5 -> prefs.syncols.backgroundColour
6 -> prefs.syncols.keywordColour
_ -> abort "edoptions[defaultColours]: unknown ls"
# (dback,ps) = GetDialogBackgroundColour ps
# wdef = Dialog "Pick a colour"
( RGBColourPickControl rgbid col Nothing
:+: PopUpControl
......@@ -358,7 +360,7 @@ defaultColours ps
] wloc []
:+: ButtonControl "Set" [ControlFunction (cset rgbid)]
)
[ WindowPen [PenBack LightGrey]
[ WindowPen [PenBack dback]
, WindowClose (dlogClose wId)
, WindowId wId
]
......
......@@ -28,6 +28,7 @@ from IDE import OpenModule ,Selection,Modulename,Position,ColumnNr,LineNr
from IdeState import General, getErrInfo, setErrInfo, ErrorInfo, MenuIds, getMenuIds, ErrPrefs
from IdeState import SearchMenuIds, PLMMessage, PLMReply, MIn, EditMenuLS, getInteract, writeLog
from EdClient import lineSelection
import IdePlatform
//from dodebug import trace_n`
trace_n _ f :== f
......@@ -126,6 +127,7 @@ err_open errinfo ps
, (flbKeyboard fifi)
]
#! (win_size,ps) = controlSize elb True Nothing Nothing Nothing ps
# (dback,ps) = GetDialogBackgroundColour ps
#! wdef = Window "Errors & Warnings"
( infobar errinfo :+: elb
)
......@@ -134,7 +136,7 @@ err_open errinfo ps
, WindowPos (LeftTop,OffsetVector errinfo.err_offset)
, WindowViewSize win_size
, WindowInitActive errinfo.infoId.fcontrolId
, WindowPen [PenBack LightGrey]
, WindowPen [PenBack dback]
, WindowActivate (noLS ew_activate)
, WindowDeactivate (noLS ew_deactivate)
]
......
......@@ -8,7 +8,7 @@ import EdMouse, EdKeyboard
from StrictList import slFromList
from UtilStrictLists import StrictListToList,List,IsEmptyList,:!
import IDE,IdeState
import IDE,IdeState,IdePlatform
//--
......@@ -330,7 +330,8 @@ typewinPane ps
:+: Receiver lsid lsfun []
)
# watt = [ WindowPen [PenBack LightGrey]
# (dback,ps) = GetDialogBackgroundColour ps
# watt = [ WindowPen [PenBack dback]
, WindowClose (cancelFun win wloc wId)
, WindowId wId
, WindowOk okId
......
......@@ -6,8 +6,10 @@ from IdeState import General
PlatformProcessAttributes :: [ProcessAttribute *(PSt General)]
RunProgram :: !.String !*(PSt General) -> *PSt General
SetWindowIcon :: !Id !Int !(PSt .l) -> PSt .l
SetProcessIcon :: !Int !(PSt .l) -> PSt .l
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour, !PSt .l)
ProjectIcon :== 32513
ImpmodIcon :== 32516
......
......@@ -226,3 +226,58 @@ ImpmodIcon :== 32516
DefmodIcon :== 32515
CleanIcon :== 32512
AbcmodIcon :== 32514
//===
COLOR_SCROLLBAR :== 0
COLOR_BACKGROUND :== 1
COLOR_ACTIVECAPTION :== 2
COLOR_INACTIVECAPTION :== 3
COLOR_MENU :== 4
COLOR_WINDOW :== 5
COLOR_WINDOWFRAME :== 6
COLOR_MENUTEXT :== 7
COLOR_WINDOWTEXT :== 8
COLOR_CAPTIONTEXT :== 9
COLOR_ACTIVEBORDER :== 10
COLOR_INACTIVEBORDER :== 11
COLOR_APPWORKSPACE :== 12
COLOR_HIGHLIGHT :== 13
COLOR_HIGHLIGHTTEXT :== 14
COLOR_BTNFACE :== 15
COLOR_BTNSHADOW :== 16
COLOR_GRAYTEXT :== 17
COLOR_BTNTEXT :== 18
COLOR_INACTIVECAPTIONTEXT :== 19
COLOR_BTNHIGHLIGHT :== 20
COLOR_3DDKSHADOW :== 21
COLOR_3DLIGHT :== 22
COLOR_INFOTEXT :== 23
COLOR_INFOBK :== 24
COLOR_HOTLIGHT :== 26
COLOR_GRADIENTACTIVECAPTION :== 27
COLOR_GRADIENTINACTIVECAPTION :== 28
COLOR_DESKTOP :== COLOR_BACKGROUND
COLOR_3DFACE :== COLOR_BTNFACE
COLOR_3DSHADOW :== COLOR_BTNSHADOW
COLOR_3DHIGHLIGHT :== COLOR_BTNHIGHLIGHT
COLOR_3DHILIGHT :== COLOR_BTNHIGHLIGHT
COLOR_BTNHILIGHT :== COLOR_BTNHIGHLIGHT
GetSysColor :: !Int -> Int
GetSysColor nIndex = code {
ccall GetSysColor@4 "PI:I"
}
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour, !PSt .l)
GetDialogBackgroundColour ps
= (RGB {r = rcol, g = gcol, b = bcol}, ps)
where
col = GetSysColor COLOR_BTNFACE
rcol = (col bitand 0x000000FF)
gcol = (col bitand 0x0000FF00) >> 8
bcol = (col bitand 0x00FF0000) >> 16
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment