Jump to content
xiantez

SciTE Config - Syntax Color Question

Recommended Posts

xiantez

Hey Community,

I was changing around my color scheme manually for syntax highlighting. I really enjoy using a dark background color. However, this seems to be problematic because my blinking cursor is also very dark. Is there a setting in the ScITE config where I can manipulate the blinking cursor to be a different color like "white" so it is easy to spot when coding. The closest thing I found was "Caret Line Color", but this just changes the line highlight.  Your help is greatly appreciated!!

ScITE config.png

Share this post


Link to post
Share on other sites
alienclone

not sure how to do what you asked, but if it helps, at the very bottom bar of the SciTE window frame it shows the position (line and column) of the cursor.

ex. li=31 co=74


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah patience, how long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites
InunoTaishou

 


Although I would recommend ISN AutoIt Studio. Here's my config that will give you a nice pretty dark style. Right underneath my post is the workaround to change the caret color.

Edited by InunoTaishou

Share this post


Link to post
Share on other sites
xiantez
1 hour ago, InunoTaishou said:

Hey InunoTaishou,

Thanks for the advice.... I have never used the ISN AutoIt Studio, what are some of the key benefits of this application? Also, I grabbed your code for the theme.... I am not sure where I need to apply it though....

 

 

scripteditor_font=Consolas
scripteditor_size=10
scripteditor_bgcolour=0x1F1F1F
scripteditor_rowcolour=0x585858
scripteditor_marccolour=0xFFFFFF
scripteditor_highlightcolour=0x3C9BFF
treefont_font=Segoe UI
treefont_size=9
treefont_colour=0x000000
default_font=Segoe UI
default_font_size=9
AU3_DEFAULT_STYLE1=0xC8C8C8|0x1F1F1F|0|0|0
AU3_DEFAULT_STYLE2=0xC8C8C8|0x1F1F1F|0|0|0
AU3_COMMENT_STYLE1=0x23BC4C|0x1F1F1F|0|1|0
AU3_COMMENT_STYLE2=0x23BC4C|0x1F1F1F|0|0|0
AU3_COMMENTBLOCK_STYLE1=0x23BC4C|0x1F1F1F|0|1|0
AU3_COMMENTBLOCK_STYLE2=0x23BC4C|0x1F1F1F|0|0|0
AU3_NUMBER_STYLE1=0xB5CEA8|0x1F1F1F|1|1|0
AU3_NUMBER_STYLE2=0xB5CEA8|0x1F1F1F|1|0|0
AU3_FUNCTION_STYLE1=0xBD63C5|0x1F1F1F|1|1|0
AU3_FUNCTION_STYLE2=0xBD63C5|0x1F1F1F|1|0|0
AU3_KEYWORD_STYLE1=0xD69C4E|0x1F1F1F|1|0|0
AU3_KEYWORD_STYLE2=0xD69C4E|0x1F1F1F|1|0|0
AU3_MACRO_STYLE1=0xBD63C5|0x1F1F1F|1|0|0
AU3_MACRO_STYLE2=0xBD63C5|0x1F1F1F|1|0|0
AU3_STRING_STYLE1=0x859DD6|0x1F1F1F|1|0|0
AU3_STRING_STYLE2=0x859DD6|0x1F1F1F|1|0|0
AU3_OPERATOR_STYLE1=0xDCDCDC|0x1F1F1F|1|0|0
AU3_OPERATOR_STYLE2=0xDCDCDC|0x1F1F1F|1|0|0
AU3_VARIABLE_STYLE1=0xB0C94E|0x1F1F1F|1|0|0
AU3_VARIABLE_STYLE2=0xB0C94E|0x1F1F1F|1|0|0
AU3_SENT_STYLE1=0xC8C8C8|0x1F1F1F|1|0|0
AU3_SENT_STYLE2=0xC8C8C8|0x1F1F1F|1|0|0
AU3_PREPROCESSOR_STYLE1=0x9B9B9B|0x1F1F1F|0|1|0
AU3_PREPROCESSOR_STYLE2=0x9B9B9B|0x1F1F1F|0|0|0
AU3_SPECIAL_STYLE1=0xC8C8C8|0x1F1F1F|0|1|0
AU3_SPECIAL_STYLE2=0xC8C8C8|0x1F1F1F|0|1|0
AU3_EXPAND_STYLE1=0xC8C8C8|0x1F1F1F|1|0|0
AU3_EXPAND_STYLE2=0xC8C8C8|0x1F1F1F|1|0|0
AU3_COMOBJ_STYLE1=0x00FF00|0x1F1F1F|1|1|0
AU3_COMOBJ_STYLE2=0x00FF00|0x1F1F1F|1|0|0
AU3_UDF_STYLE1=0xFF8000|0x1F1F1F|0|1|0
AU3_UDF_STYLE2=0xFF8000|0x1F1F1F|1|0|0


Although I would recommend ISN AutoIt Studio. Here's my config that will give you a nice pretty dark style. Right underneath my post is the workaround to change the caret color.

 

Edited by xiantez

Share this post


Link to post
Share on other sites
InunoTaishou

It's the closest thing to an IDE for AutoIt that we have. Much more than just the basic Scite Editor.

Once you've got it installed, and you've ran ISN to set everything up first, there's a config.ini under D:\Users\Your Username\My Documents\ISN AutoIt Studio\Data\ You can put those values in the post in that config file. You can also edit more settings by going to File -> Settings (Under Script Editor is the colors)

As for the Macro, to change the color for the caret. Project -> Macros -> New Macro. Click the + button next to functions and make the trigger Open File. Click the + button next to Details and select Execute Command. Hit OK and use this command

SendMessage($SCE_EDITOR[_GUICtrlTab_GetCurFocus($hTab)], $SCI_SETCARETFORE, 0xFFFFFF, 0)

You can change 0xFFFFF to whatever color you want the caret to be. Save your macro and re-open your script to update the caret.

Until the updated ISN comes up you'll have to add the macro to each project, so just save the macro and import it when you start a new project.

  • Like 1

Share this post


Link to post
Share on other sites
xiantez

Well I am using ISN AutoIt Studio now... it is really neat... however I still have the same issues.... Cannot figure out how to change the blinking cursor color to white, since I have a black background....

Share this post


Link to post
Share on other sites
InunoTaishou

The post right under where my config is (in the ISN autoit studio topic) tells you how to change the caret color (the blinking cursor is called the caret)

I also explained how to, step by step, add the macro to change the caret color in my last post in this topic.

2 hours ago, InunoTaishou said:

As for the Macro, to change the color for the caret. Project -> Macros -> New Macro. Click the + button next to functions and make the trigger Open File. Click the + button next to Details and select Execute Command. Hit OK and use this command

SendMessage($SCE_EDITOR[_GUICtrlTab_GetCurFocus($hTab)], $SCI_SETCARETFORE, 0xFFFFFF, 0)

You can change 0xFFFFF to whatever color you want the caret to be. Save your macro and re-open your script to update the caret.

Until the updated ISN comes up you'll have to add the macro to each project, so just save the macro and import it when you start a new project.

 

Share this post


Link to post
Share on other sites
Jos

This color is not part of the SciTEConfig options but can be manually added by adding this line in SciTEUser.properties:

# Make caret white
caret.fore=#FFFFFF

Jos

Dup Threads merged.

Edited by Jos

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

Share this post


Link to post
Share on other sites
xiantez

Oh ok...i apologize for the confusion.... I appreciate all your help!

 

Share this post


Link to post
Share on other sites
QwertoX
Posted (edited)

Here is a Monokai style dark theme for SCITE Editor: 

Look alike or similar to Sublime Text 3.

Simply copy that code in your "SciTEUser.properties" wich is in Options > Open User Options File

Happy coding everyone

# SciTE Customization GUI ----------------------------------------
# Do not remove these lines or anything between them
position.left=-1
position.top=-1
position.width=-1
position.height=-1
position.maximize=0
position.tile=0
minimize.to.tray=0
save.position=1
toolbar.visible=0
end.at.last.line=0
ensure.final.line.end=1
statusbar.visible=1
full.screen.hides.menu=0
title.full.path=1
title.show.buffers=0
blank.margin.right=0
blank.margin.left=6
split.vertical=0
output.vertical.size=256
output.horizontal.size=0
output.initial.hide=1
clear.before.execute=1
output.scroll=1
fold=1
fold.on.open=0
fold.compact=0
fold.preprocessor=0
fold.comment=1
fold.flags=0
fold.symbols=0
fold.highlight=1
fold.highlight.colour=#71FF1C
fold.margin.colour=#282923
fold.margin.highlight.colour=#1E1E1E
fold.margin.width=16
use.tabs=0
tabsize=4
tab.indents=4
backspace.unindents=1
indent.size.$(au3)=4
view.indentation.guides=1
style.au3.37=fore:#1E1E1E,back:#282923
highlight.indentation.guides=1
selection.fore=#38FF1C
selection.back=#f9f9f9
selection.alpha=50
selection.multiple=1
selection.additional.typing=1

selection.additional.back=#282923
selection.additional.alpha=50
highlight.current.word=1
highlight.current.word.by.style=0
highlight.current.word.autoselectword=0
highlight.current.word.wholeword=0
highlight.current.word.matchcase=1
highlight.current.word.minlength=2
highlight.current.word.colour=#C2FFAE
margin.width=16
braces.check=1
braces.sloppy=1
style.au3.34=fore:#8F9D6A,back:#282923,bold,notitalics,notunderlined
style.au3.35=fore:#e7db74,back:#282923,bold,notitalics,notunderlined
caret.fore=#A0A0A0
caret.width=3
caret.period=700
caret.additional.blinks=1
caret.sticky=1
virtual.space=1
caret.line.back=#F8F8F8
caret.line.back.alpha=10
caret.policy.xslop=1
caret.policy.width=20
caret.policy.xstrict=0
caret.policy.xeven=0
caret.policy.xjumps=0
caret.policy.yslop=1
caret.policy.lines=1
caret.policy.ystrict=1
caret.policy.yeven=1
caret.policy.yjumps=0
line.margin.visible=1
line.margin.width=1+
style.*.33=fore:#DADADA,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics
error.select.line=0
style.errorlist.3=fore:#DADADA,back:#282923
error.marker.fore=#DADADA
error.marker.back=#282923
error.inline=0
style.error.1=fore:#e7db74,back:#282923
style.error.2=fore:#FF0000,back:#282923
are.you.sure=1
are.you.sure.for.build=0
are.you.sure.on.reload=0
save.all.for.build=0
load.on.activate=0
save.on.deactivate=0
reload.preserves.undo=1
check.if.already.open=0
quit.on.close.last=0
save.recent=1
save.session=1
save.find=1
session.bookmarks=1
session.folds=1
save.on.timer=600
strip.trailing.spaces=1
open.dialog.in.file.directory=1
calltips.color.highlight=#e7db74
style.au3.38=fore:#DADADA,back:#282923
calltips.set.above=0
calltip.au3.ignorecase=1
calltip.*.use.escapes=0
mousehover.calltips.dwelltime=750
autocomplete.au3.disable=0
autocomplete.choose.single=0
autocomplete.au3.ignorecase=1
autocompleteword.automatic=0
autocomplete.*.fillups =
buffers=100
buffers.zorder.switching=1
tabbar.visible=1
tabbar.multiline=0
tabbar.hideone=0
find.mark=1
find.replace.matchcase=0
find.replace.regexp=0
find.replace.regexp.posix=0
find.replace.wrap=1
find.replace.escapes=0
find.replacewith.focus=1
find.use.strip=0
replace.use.strip=0
find.close.on.find=1
find.in.files.close.on.find=1
find.replace.advanced=1
buffered.draw=1
two.phase.draw=1
technology=1
cache.layout=2
output.cache.layout=0
font.quality=3
ext.lua.auto.reload=1
ext.lua.reset=0
edge.mode=0
edge.column=143
edge.colour=#e7db74
indicators.alpha=50
indicators.under=1
style.au3.32=back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.0=fore:#A688FF,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.1=fore:#74705d,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.2=fore:#77FFBB,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.3=fore:#e7db74,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.4=fore:#f92472,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.5=fore:#FFB96A,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.6=fore:#C4FF55,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.7=fore:#e7db74,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.8=fore:#FF3E3E,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.9=fore:#ffffff,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.10=fore:#DADADA,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.11=fore:#8996A8,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.12=fore:#4ABDAF,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.13=fore:#CEF7BD,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.14=fore:#0080FF,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.au3.15=fore:#FF80FF,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.32=fore:#DADADA,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.4=fore:#8F9D6A,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.10=fore:#e7db74,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.11=fore:#ffffff,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.12=fore:#F9EE98,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.0=fore:#FFFFFF,back:#282923,font:Ubuntu Mono,size:12,notbold,notitalics,notunderlined
style.errorlist.1=fore:#DADADA,back:#282923,font:monoOne,size:12,notbold,notitalics,notunderlined
backup.files=0
check.updates.scite4autoit3=1
proper.case=1
debug.msgbox.option=-1
debug.console.option=0
debug.trace.option=3
# Do not remove these lines or anything between them
# - SciTE Customization GUI ----------------------------------------
import au3.UserUdfs
import au3.keywords.user.abbreviations

"

monokai.PNG

Edited by QwertoX
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Earthshine

very nice. I use Sublime mostly anyway for AutoIt but this is nice when I want to work in the other editor. I also really dig that open source editor SynWrite as well.


My resources are limited. You must ask the right questions

 

Share this post


Link to post
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

  • Similar Content

    • badcoder123
      By badcoder123
      Hey, all.  
      I've been looking for a way to change cursor colour but not the cursor itself. I've been looking for a couple hours now and can't find anything.  I also don't even know where to start, if anyone has any tips or examples please comment them.
      Thanks
    • ademon
      By ademon
      Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C.
      Can you provide an update of this bug?


    • Myicq
      By Myicq
      This may be a dumb question.. but my vertical screen space is fairly limited. I don't need (always) to see all the debug output from autoIT compiler, wrapper etc.
      Can I turn this part off: (optionally)
      >"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\temp\xx.au3" +>11:35:44 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000406 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0406) +> SciTEDir => D:\AutoIt3\SciTE UserDir => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:D:\AutoIt3 input:D:\temp\XX.au3 +>11:35:44 AU3Check ended.rc:0 >Running:(3.3.12.0):D:\AutoIt3\autoit3.exe "D:\temp\xx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop  
    • BugFix
      By BugFix
      This lua script gives you the ability, to search for selected text or word from cursor in an search engine or on an search site of your choice.You can select the engine/site from a list, that you have defined in your user properties.
      To get the right call for your search engine, open the engine and search for one word. You need the url without the searched word. Write to your properties an display name for this engine and, separated by a comma, the url. See my example in the script header.
      For the list with  search sites, you need display name and site address (without http://).
      It will searched for the full selected text or, if none selection exists, for the word touched by the cursor. You can allow in the properties, that also will recognized words with dots (like objVar.Property).
      The script uses the shell.dll. But if you don't have installed it, the browser will opened with an command line call. Thats why the command window will pop up for a short moment.
      You'll find details for installation and key bindings inside the script. Look for free command numbers in SciTE. By default installation, the numbers must be greater than 35 (max. 49).
      -- TIME_STAMP 2018-09-02 09:22:03 --[[ This script publicates two functions - InetSearch.Engine() You can search for the selected/touched text in SciTE and can select a search engine of your choice. - InetSearch.Site() You can search for the selected/touched text in SciTE with a defined search engine and can select a search site of your choice. Copy this script in your Lua scripts folder. Load this file in the Lua startup: dofile("Full\\Path\\InetSearch.lua") Add in "SciTEUser.properties" the following properties with search engines and search sites of your choice: #~ Inet Search Settings #~ List of engines. "display-name,search-url" (if not set: google.com will used) #~ If only one entry exists, the selection box will not shown. Inet.Search.Engines= \ Google,https://www.google.de/search?q=| \ MetaGer,https://metager.de/meta/meta.ger3?focus=web&eingabe=| \ Bing,https://www.bing.com/search?q=| \ Ask,https://de.ask.com/web?q=| \ Yandex,https://www.yandex.com/search/?text= #~ Engine for site based search #~ Use display name from engines list (if not set: google.com will used) Inet.Search.SearchOnSite.Engine=Google #~ List of sites for site based search. "display-name,site-url" #~ If not set, it searches without a special site. #~ If only one entry exists, the selection box will not shown. Inet.Search.SearchOnSite.Sites= \ AutoIt DE,autoit.de| \ AutoIt EN,autoitscript.com| \ MSDN,msdn.microsoft.com #~ By default, words will detected without dots. (0) #~ You can allow dots, to detect object variables with properties or methods too. Inet.Search.Allow.Punctuation=1 #~ Search commands #~ Search word from cursor with engine selection command.name.9.*=Search with engine selection command.9.*=dostring InetSearch.Engine() command.mode.9.*=subsystem:lua,savebefore:no command.shortcut.9.*=Ctrl+Shift+F8 #~ Search word from cursor with search site selection command.name.5.*=Search with site selection command.5.*=dostring InetSearch.Site() command.mode.5.*=subsystem:lua,savebefore:no command.shortcut.5.*=Ctrl+Shift+F9 --]] InetSearch = {} InetSearch.Handler = EventClass:new(Common) do ------------------------------------------------------------------------------------------------ local engineFallback = "Google,https://www.google.com/search?q=" -- default search engine: "display-name,search-url" local search_type = nil local engine_url = nil local search_item = nil local search_site = nil local tableSelection = nil local list_type = 16 ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------- Load library protected local require_protected = function(_lib) local loaded_lib if pcall(function() loaded_lib = require(_lib) end) then return loaded_lib else return nil end end --> require_protected ------------------------------------------------------------------------------------------------ local shell = require_protected("shell") -- loads the shell library if exists ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Starts the search local RunSearch = function(_item, _url, _site) local sSite = '' if _site ~= nil then sSite = "%20site:".._site end local sCmd = _url.._item..sSite if shell then shell.exec(sCmd) else os.execute('start "" "'..sCmd..'"') end end --> RunSearch ------------------------------------------------------------------------------------------------ ----------------------------------------------------------------------------- Show the user list local ShowSelectionList = function() -- create the selection list (display names from engines or sites) local sep, list = '_', tableSelection[1][1] for i = 2, #tableSelection do list = list..sep..tableSelection[i][1] end local sep_tmp = editor.AutoCSeparator editor.AutoCSeparator = string.byte(sep) editor:UserListShow(list_type, list) editor.AutoCSeparator = sep_tmp end --> ShowSelectionList ------------------------------------------------------------------------------------------------ --------------------------------------------------------------------------- Select the user list function InetSearch.Handler:OnUserListSelection(_tp, _sel) if _tp == list_type then local url for i = 1, #tableSelection do if tableSelection[i][1] == _sel then url = tableSelection[i][2] break end end if search_type == 'site' then search_site = url else search_site = nil engine_url = url end RunSearch(search_item, engine_url, search_site) end end ------------------------------------------------------------------------------------------------ --------------------------------------------------------- List of search engines from properties local GetEngines = function() local sEngines = props['Inet.Search.Engines'] -- without settings, the default search engine will used if sEngines == '' then sEngines = engineFallback end local tEngines = {} for entry in sEngines:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tEngines, {name, url}) end end return tEngines end --> GetEngines ------------------------------------------------------------------------------------------------ ----------------------------------------------------------- List of search sites from properties local GetSearchSites = function() local sSites = props['Inet.Search.SearchOnSite.Sites'] if sSites == '' then return nil end local tSites = {} for entry in sSites:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tSites, {name, url}) end end return tSites end --> GetSearchSites ------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- Get search item local GetSearchItem = function() local sSelect = editor:GetSelText() if sSelect ~= '' then return sSelect end local allowDots = false if props['Inet.Search.Allow.Punctuation'] == '1' then allowDots = true end local caret = editor.CurrentPos local iLine = editor:LineFromPosition(caret) local iZero = editor:PositionFromLine(iLine) editor:LineEnd() local iLineEnd = editor.CurrentPos editor.CurrentPos = caret editor:SetSelection(caret,caret) local iStart = editor:WordStartPosition(caret) if allowDots then while iStart > iZero and editor:textrange(iStart -1, iStart) == '.' do iStart = editor:WordStartPosition(iStart -1) end end local iEnd = editor:WordEndPosition(caret) if allowDots then while iEnd < iLineEnd and editor:textrange(iEnd, iEnd +1) == '.' do iEnd = editor:WordEndPosition(iEnd +1) end end sSelect = editor:textrange(iStart, iEnd):gsub('^([^%w]+)', ''):gsub('([^%w]+)$', '') return sSelect end --> GetSearchItem ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------- Search with engine selection local SearchEngineBased = function() search_type = 'engine' search_item = GetSearchItem() if search_item == '' then return nil end tableSelection = GetEngines() -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, tableSelection[1][2], nil) else ShowSelectionList() end end --> SearchEngineBased ------------------------------------------------------------------------------------------------ -------------------------------------------------------------- Search with search site selection local SearchSiteBased = function() search_type = 'site' search_item = GetSearchItem() if search_item == '' then return nil end -- get the default engine for site based searching for _, url in engineFallback:gmatch('([^,]+),(.+)') do engine_url = url end -- if is set, use search engine from properties local sEngine = props['Inet.Search.SearchOnSite.Engine'] if sEngine ~= '' then local tEngines = GetEngines() for i = 1, #tEngines do if tEngines[i][1] == sEngine then engine_url = tEngines[i][2] break end end end tableSelection = GetSearchSites() -- if none entries for search sites, use simple search if tableSelection == nil then RunSearch(search_item, engine_url, nil) else -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, engine_url, tableSelection[1][2]) else ShowSelectionList() end end end --> SearchSiteBased ------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------- Publicate functions InetSearch.Engine = SearchEngineBased InetSearch.Site = SearchSiteBased ------------------------------------------------------------------------------------------------ end ----------------------------------------------------------------------------------------------------  
      InetSearch.lua
    • AndyS01
      By AndyS01
      I want to create a slider that has values representing colors, like the slider on the _ChooseColor() GUI in the Misc.au3 UDF, but the max value for a slider is 32767.  
      Here is my test code:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SliderConstants.au3> #include <Misc.au3> $hGUI = GUICreate("Test", 100, 560) $BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25) ;~ GUICtrlSetOnEvent($BtnID, "handle_choose_btn") $flags = BitOR($TBS_AUTOTICKS, $TBS_VERT) $iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags) $hSlider_hWnd = GUICtrlGetHandle($iSliderID) $iMaxVal = 32767 GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value GUISetState() GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYUP ToolTip("") case $BtnID handle_choose_btn() EndSwitch WEnd ; React to a slider movement Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam If $lParam = $hSlider_hWnd Then $iValue = GUICtrlRead($iSliderID) ConsoleWrite("+++: $iValue = " & $iValue & @CRLF) ToolTip(getRGB($iValue)) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_V_Slider ; Extract the RGB components from the color value Func getRGB($iColorVal) Local $hexstr, $b, $g, $r, $rgb $hexstr = StringFormat("%06X", $iColorVal) $r = StringMid($hexstr, 1, 2) $g = StringMid($hexstr, 3, 2) $b = StringMid($hexstr, 5, 2) $rgb = StringFormat("" & $iColorVal & " - rgb: %02s %02s %02s", $r, $g, $b) Return ($rgb) EndFunc ;==>getRGB Func handle_choose_btn() $color = _ChooseColor(2, 255, 0, $hGUI) ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF) EndFunc ;==>handle_choose_btn  
×