Jump to content

SciTE change syntax parameter highlight color?


DrLarch
 Share

Recommended Posts

I'm running a black background and have adjusted my colors with SciTEconfig accordingly, but the only thing that I can't figure out is how to change the highlighted parameter color from the syntax description that pops down when you type in a function name. The color is dark blue which is tough to see against a black background. I've dug around in the forums but haven't found a clear answer. Any help much appreciated...

Edited by DrLarch
Link to comment
Share on other sites

  • Moderators

DrLarch,

I have got as far as seeing that you need to use SCI_CALLTIPSETFOREHLT - but as yet I cannot get it to work. You may have to wait until our SciTE guru Jos comes back next week. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

LaCastiglione,

Do not keep us in suspense - you found that where? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Blue_Drache,

No, I had already done that - which is why I asked. ;)

Looks like we wait for Jos... :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Developers

You mean this one?

# Set the fore and back color of the calltip window
style.au3.38=fore:#DADADA,back:#15191E

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You mean this one?

# Set the fore and back color of the calltip window
style.au3.38=fore:#DADADA,back:#15191E

OK, obviously I'm doing something wrong - and I'm obviously in unfamiliar territory...

I fiddled around with the calltips_color_highlight setting in several places, all to no avail. Still the dark blue default...

Here's my relevant(?) files:

SciTE_Doug.lau file: (referenced by SciTEStartup.lua)...

myCallTips = EventClass:new(Common)

function myCallTips:OnOpen(path)
    myCallTips:set_above()
    myCallTips:set_highlight_color()
    return true
end

--------------------------------------------------------------------------------
-- set_above()
-- Displays the calltip above the function.
--------------------------------------------------------------------------------
function myCallTips:set_above()
    local calltips_set_above = tonumber(props["calltips.set.above"])

    if ((calltips_set_above ~= 1) and (calltips_set_above ~= 0)) then
        calltips_set_above = 1
    end

    scite.SendEditor(SCI_CALLTIPSETPOSITION, calltips_set_above)
end

--------------------------------------------------------------------------------
-- set_highlight_color()
-- Set the color of the highlighted calltip property
--------------------------------------------------------------------------------
function myCallTips:set_highlight_color()
    local calltips_color_highlight = props["calltips.color.highlight"]

    if (calltips_color_highlight == '') then
        calltips_color_highlight = "#FFFFFF" -- dark blue default
    end

    calltips_color_highlight = myCallTips:BGR2Decimal(calltips_color_highlight)

    if (calltips_color_highlight == "Error") then
        return true
    end

    scite.SendEditor(SCI_CALLTIPSETFOREHLT, calltips_color_highlight)
end

--------------------------------------------------------------------------------
-- BGR2Decimal()
-- convert BGR to decimal, duh! (albeit in a hack and stab manner)
--------------------------------------------------------------------------------
function myCallTips:BGR2Decimal(BGR)
    if (BGR.len(BGR) ~= 7) then
        return "error"
    end

    BGR = BGR:gsub('#', '') -- remove hash
    BGR = BGR.reverse(BGR)
    BGR = "0x"..BGR

    return tonumber(BGR)
end

SciTEStartup.lua:

--------------------------------------------------------------------------------
-- SciTE startup script.
--------------------------------------------------------------------------------

-- A table listing all loaded files.
LoadLuaFileList = { }

--------------------------------------------------------------------------------
-- LoadLuaFile(file, directory)
--
-- Helper function for easily loading Lua files.
--
-- Parameters:
--  file - The name of a Lua file to load.
--  directory - If specified, file is looked for in that directory.  By default,
--     this directory is $(SciTEDefaultHome)\Lua.
--------------------------------------------------------------------------------
function LoadLuaFile(file, directory)
    if directory == nil then
        directory = props["SciteDefaultHome"] .. "\\Lua\\"
    end
    table.insert(LoadLuaFileList, directory .. file)
    dofile(directory .. file)
end -- LoadLuaFile()

-- Load all the Lua files.
LoadLuaFile("Class.lua")    -- Always load first.
LoadLuaFile("Common.lua")   -- Always load second.
LoadLuaFile("AutoItPixmap.lua")
LoadLuaFile("AutoHScroll.lua")
LoadLuaFile("AutoItAutoComplete.lua")
LoadLuaFile("LoadSession.lua")
LoadLuaFile("AutoItIndentFix.lua")
LoadLuaFile("EdgeMode.lua")
LoadLuaFile("SmartAutoCompleteHide.lua")
LoadLuaFile("Tools.lua")
LoadLuaFile("AutoItTools.lua")
LoadLuaFile("AutoItGotoDefinition.lua")
LoadLuaFile("SciTE_Doug.lau", "C:\\Program Files\\AutoIt3\\")

-- Start up the events (Calls OnStartup()).
EventClass:BeginEvents()

MyTools = EventClass:new(Common)

function stripTrailingSpaces(reportNoMatch)
    local count = 0
    local fs,fe = editor:findtext("[ \\t]+$", SCFIND_REGEXP)
    if fe then
        repeat
            count = count + 1
            editor:remove(fs,fe)
            fs,fe = editor:findtext("[ \\t]+$", SCFIND_REGEXP, fs)
        until not fe
        print("Removed trailing spaces from " .. count .. " line(s).")
    elseif reportNoMatch then
        print("Document was clean already; nothing to do.")
    end
    return count
end

function fixIndentation(reportNoMatch)
    local tabWidth = editor.TabWidth
    local count = 0
    if editor.UseTabs then
        -- for each piece of indentation that includes at least one space
        for m in editor:match("^[\\t ]* [\\t ]*", SCFIND_REGEXP) do
            -- figure out the indentation size
            local indentSize = editor.LineIndentation[editor:LineFromPosition(m.pos)]
            local spaceCount = math.mod(indentSize, tabWidth)
            local tabCount = (indentSize - spaceCount) / tabWidth
            local fixedIndentation = string.rep('\t', tabCount) .. string.rep(' ', spaceCount)

            if fixedIndentation ~= m.text then
                m:replace(fixedIndentation)
                count = count + 1
            end
        end
    else
        -- for each piece of indentation that includes at least one tab
        for m in editor:match("^[\\t ]*\t[\\t ]*", SCFIND_REGEXP) do
            -- just change all of the indentation to spaces
            m:replace(string.rep(' ', editor.LineIndentation[editor:LineFromPosition(m.pos)]))
            count = count + 1
        end
    end
    if count > 0 then
        print("Fixed indentation for " .. count .. " line(s).")
    elseif reportNoMatch then
        print("Document was clean already; nothing to do.")
    end
    return count
end

function cleanDocWhitespace()
    local trailingSpacesCount = stripTrailingSpaces(false)
    local fixedIndentationCount = fixIndentation(false)

    if (fixedIndentationCount == 0) and (trailingSpacesCount == 0) then
        print("Document was clean already; nothing to do.")
    end
end

--switch_buffers.lua - http://lua-users.org/wiki/SciteBufferSwitch
--drops down a list of buffers, in recently-used order

local buffers = {}
local append = table.insert

local function buffer_switch(f)
--- swop the new current buffer with the last one!
  local idx  
  for i,file in ipairs(buffers) do
     if file == f then  idx = i; break end
  end
  if idx then
     table.remove(buffers,idx)
     table.insert(buffers,1,f)
  else append(buffers,f)
  end
end

function OnOpen(f)
  buffer_switch(f)
end

function OnSwitchFile(f)
  buffer_switch(f)
end

function do_buffer_list()
  local s = ''
  local sep = ';'
  local n = table.getn(buffers)
  for i = 2,n-1 do
      s = s..buffers[i]..sep
  end
  s = s..buffers[n]
  _UserListSelection = fn
  editor.AutoCSeparator = string.byte(sep)
  editor:UserListShow(12,s)
  editor.AutoCSeparator = string.byte(' ')
end

function OnUserListSelection(t,str)
  if t == 12 then
     scite.Open(str)
     return true
  else
     return false
  end
end

SciTEUser.properties:

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# START: DO NOT CHANGE ANYTHING AFTER THIS LINE  #-#-#-#-#
# Created by SciTEConfig
#------------------------------------------------------------
font.base=font:Verdana,size:11,$(font.override)
font.monospace=font:Andale Mono,size:14
proper.case=1
check.updates.scite4autoit3=0
use.tabs=1
indent.size=4
indent.size.*.au3=4
tabsize=4
#Background
style.au3.32=style.*.32=$(font.base),back:#010000
#CaretLineBackground
caret.line.back=#6F7D82
# Brace highlight
style.au3.34=fore:#F9EE98,back:#010000
# Brace incomplete highlight
style.au3.35=fore:#5F5A60,italics,back:#010000
#White space
style.au3.0=fore:#F8F8F8,back:#010000
#Comment line
style.au3.1=fore:#5F5A60,italics,back:#010000
#Comment block
style.au3.2=fore:#5F5A60,italics,back:#010000
#Number
style.au3.3=fore:#F52525,back:#010000
#Function
style.au3.4=fore:#A54AFF,back:#010000
#Keyword
style.au3.5=fore:#F9EE98,back:#010000
#Macro
style.au3.6=fore:#DADADA,back:#010000
#String
style.au3.7=fore:#008040,back:#010000
#Operator
style.au3.8=fore:#91E254,back:#010000
#Variable
style.au3.9=fore:#FFFF00,back:#010000
#Sent keys
style.au3.10=fore:#DADADA,back:#010000
#Pre-Processor
style.au3.11=fore:#8996A8,back:#010000
#Special
style.au3.12=fore:#FF8040,back:#010000
#Abbrev-Expand
style.au3.13=fore:#DADADA,back:#010000
#Com Objects
style.au3.14=fore:#DADADA,back:#010000
#Standard UDF's
style.au3.15=fore:#0080FF,back:#010000
# END => DO NOT CHANGE ANYTHING BEFORE THIS LINE  #-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
## CallTips
# Display the calltip above the function
calltips.set.above=1
# Set the fore and back color of the calltip window
style.au3.38=fore:#DADADA,back:#15191E
# Set the highlight color of the function argument
calltips.color.highlight=#FFFFFF
Link to comment
Share on other sites

You have:

LoadLuaFile("SciTE_Doug.lau", "C:Program FilesAutoIt3")

but should be:

LoadLuaFile("SciTE_Doug.lua", "C:Program FilesAutoIt3")

Also, let me get you the latest version of that lua file...

myCallTips = EventClass:new(Common)

function myCallTips:OnOpen(path)
    self.error = "Error"
    myCallTips:set_above()
    myCallTips:set_highlight_color()
    return true
end

-- set_above()
-- Displays the calltip above the function.
function myCallTips:set_above()
    local calltips_set_above = tonumber(props["calltips.set.above"])

    if (calltips_set_above == 1) then
        scite.SendEditor(SCI_CALLTIPSETPOSITION, true)
    else
        scite.SendEditor(SCI_CALLTIPSETPOSITION, false)
    end

    return true
end

-- set_highlight_color()
-- Set the color of the highlighted calltip property
function myCallTips:set_highlight_color()
    local calltips_color_highlight = props["calltips.color.highlight"]

    if (calltips_color_highlight == '') then
        calltips_color_highlight = "#FF0000" -- dark blue default
    end

    calltips_color_highlight = myCallTips:BGR2Decimal(calltips_color_highlight)

    if (calltips_color_highlight == self.error) then
        return false
    end

    scite.SendEditor(SCI_CALLTIPSETFOREHLT, calltips_color_highlight)

    return true
end

-- BGR2Decimal()
-- convert BGR to decimal, duh! (albeit in a hack and stab manner)
function myCallTips:BGR2Decimal(BGR)
    if (BGR.len(BGR) ~= 7) then
        return self.error
    end

    BGR = BGR:gsub('#', '') -- remove hash
    BGR = BGR.reverse(BGR)
    BGR = "0x"..BGR

    return tonumber(BGR)
end
Edited by LaCastiglione
Link to comment
Share on other sites

  • Developers

You don't need any of the LUA stuff to just update the colors, just add the 2 lines I posted into your SciTEUser.properties and set the colors to what you want.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You don't need any of the LUA stuff to just update the colors, just add the 2 lines I posted into your SciTEUser.properties and set the colors to what you want.

Jos

Thanks for your help, but I do have your two lines (thanks Jos) in my SciTEUser.properties (scroll down in the code posted above). I also have the calltips.color.highlight=#FFFFFF line added as well in the same file (last line - put in the FFFFFF and 000000 to see if I could throw it one way or another with no luck). I fixed my bad file extension for the .lua (been a long week, thanks LaCastiglione for catching that), but I still get dark blue text. :) . Nothing seems to effect the highlight color... I do have to say though that after adding all those lua's files and tweaks that LaCastiglione mentioned (in the link), my SciTe is now doing cool stuff ;) it didn't do with just the regular install. Now it's matching parenthesis and doing other nice auto-formatting stuff. Cool!! Edited by DrLarch
Link to comment
Share on other sites

  • Developers

OK, uninstalled and reinstalled just now. Same thing. Nothing will change the highlight color from dark blue. Jos's line changes the foreground and background color just fine. Does this work for anyone?

Did you do the following steps?:

1. Use the Full version of SciTE (Not the one that comes with AutoIt3 installer.)

2. Add the line to sciteuser.properties:

style.au3.38=fore:#DADADA,back:#15191E

3. open a file with .au3 extension.

That does it for me.

Jos :)

This is all I need to do to make it work for AutoIt3

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...