IUP/Controls/IupNavmap

From Vendetta Lua
Revision as of 22:50, 10 May 2023 by Draugath (Talk | contribs) (Created page with "__NOTOC__ __NOEDITSECTION__ navmap{size, expand, scrollbar} navmap uses 0-based systemids. all systemid inputs/outputs for navmap methods and events will be this way. elsew...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


navmap{size, expand, scrollbar}

navmap uses 0-based systemids. all systemid inputs/outputs for navmap methods and events will be this way. elsewhere systemids are 1-based

navmap:loadmap(mode, mappath, page)

mode: 1 or 2; 1 = gridless; 2 = grid mode
mappath: "/lua/maps/(navmap.universemap.lua | system%02dmap.lua)"
page: systemid - 1; sets the page for sector ids. start index (upper left) == 1 + (256 * page)

navmap:setpath(GetFullPath())

navmap.currentid = <id>; universe map: values are systemid-1; system map: sectorid range determined by the map page navmap.clickedid = <id>; moves the clicked sector. universe map: values are systemid-1; system map; range determined by the map page

navmap.["color"..number] does not work in mode 1; number is the sectorid. available sector ids are determined by the current page; changing the page resets all colors; changing back to a previous page does not show previous colors


if no mappoint is selected,

tab will navigate in tab order to other controls


function navmap:k_any(c)

key presses repeat so long as the key is held down
ctrl does not repeat, but the combination does.
no character code for combinations. in a ctrl combo, ctrl only triggers once and the other key triggers repeatedly
arrows trigger mouseover_cb, not k_any.
enter triggers click_cb
space triggers click_cb

keys

ctrl triggers, but does not repeat
shift does not trigger
alt triggers; can't combine with a mouse click on linux

end

function navmap:click_cb(index, flags)

only triggers when clicking on a mappoint, on mouseup
pressing enter does not set a flag
pressing space does not set a flag
in mode 2, if the long-press timeout is met, the callback finishes, not waiting for the button release.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


:flags "SC1            L "
:	1: S (shift)
:	2: C (ctrl)
:	3: 1 (left mouse click)
:	16: L (long-press 1 second(?))
use string.byte() to test for a specific flag

end

function navmap:getfocus_cb()

triggers:
when opening the navmap's dialog
when pressing escape if the last action was a click
After this callback has triggered, all keyboard presses will trigger :k_any()

end

function navmap:mouseover_cb(index, str)

triggers when
mousing over a map point. nothing happens when moving the mouse over anything else
pressing arrow keys after a mappoint has been selected; order of system traversal on the universe map is in systemid order
pressing tab when a mappoint has been clicked on; triggers the mouseover for the active mappoint

end