LV_Add("",<continuation section>)

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: LV_Add("",<continuation section>)

Re: LV_Add("",<continuation section>)

Post by BNOLI » 24 May 2020, 11:46

Thx, wasn't aware of that. Creating that array (continuation style) was just a by-product :)

Re: LV_Add("",<continuation section>)

Post by swagfag » 24 May 2020, 11:40

if u already have an array it would be easier to just spread it

Code: Select all

LV_Add("", theArray*)

Re: LV_Add("",<continuation section>)

Post by BNOLI » 24 May 2020, 11:28

@swagfag, your second option was close! The fields content has to be handled in expression style :)

Hätte nicht gedacht das wir es doch noch hinbekommen!
Ergebnis: sowohl Gui, Add, ListView als auch LV_Add() kann parameter als :arrow: continuation section entgegen nehmen :thumbup:

Code: Select all

#NoEnv
#SingleInstance, Force

r := [					; array zum Füttern einer LV-Reihe als 'continuation section' ausgeführt
(LTrim Join 
	"a",
	"b",
	"c",
	"d"
)]

;	Nachfolgender Befehl mit Parameterübergabe als fortlaufende Zeile mit allen Spaltenkopfdefinitionen in einer ("endlosen") Zeile.
;	Gui, Add, ListView, w400, langer spaltenkopf| superlanger spaltenkopf| ultrasuperlanger spaltenkopf mit zusatzinformation| und wenn hier jetzt noch zwanzig zeilen mehr kämen| würde das eine verdammt lange einzelne zeile werden, und das wäre nur was für einzeilenliebhaber. Deshalb| also im code als continuation section!

;	Nachfolgender Befehl mit Parameterübergabe als 'continuation section' ausgeführt, mit allen Spaltenkopfdefinitionen in einer jeweils separaten Zeile!
Gui, Add, ListView,% "w"A_ScreenWidth-20,
					( LTrim
					langer eintrag|
					superlanger eintrag|
					ultrasuperlanger eintrag mit zusatzinformation|
					und wenn hier jetzt noch zwanzig zeilen mehr kämen|
					würde das eine verdammt lange einzelne zeile werden|
					und das wäre nur was für einzeilenliebhaber. Deshalb|
					also im code als continuation section!
					)

LV_Add("", 1, 2, 3, 4)	; Parameter-Übergabe für LV_Add() in üblicher Ausführung, in einer Zeile.
LV_Add(""				; Parameter-Übergabe für LV_Add() in Ausführung als 'continuation section'
	, r.1
	, r.2
	, r.3
	, r.4)
LV_Add(""
	,"aaaaaaaaaa"		; Schreibweise = expression style 
	, 9999999999
	, 8888888888
	, 7777777777)
Gui, Show,% "w" A_ScreenWidth, % chr(32)
Return

Re: LV_Add("",<continuation section>)

Post by BNOLI » 24 May 2020, 09:10

swagfag wrote:
24 May 2020, 08:18
granted im not exactly sure what ure asking for, maybe its this
Thx for dropping by :) Unfortunately both options didn't work as intended. The concept is indeed what I'm looking for.

Re: LV_Add("",<continuation section>)

Post by swagfag » 24 May 2020, 08:18

granted im not exactly sure what ure asking for, maybe its this

Code: Select all

LV_Add(
(Join
	"",
	r1,
	r1,
	r1,
	r1)
)
although in this case id just prepend commas and not bother with the continuation section

Code: Select all

LV_Add(""
	, r1
	, r1
	, r1
	, r1)

Re: LV_Add("",<continuation section>)

Post by BNOLI » 24 May 2020, 06:01

Selbstverfreilich :)

Code: Select all

#NoEnv
#SingleInstance, Force

r3 = 
(LTrim	
		r3 ,
	 	r3 ,
	 	r3 , 
	 	r3
)

Gui, Add, ListView,, C1|C2|C3|C4
LV_ModifyCol()
LV_Add("",  r1 ,  r1 ,  r1,   r1)
LV_Add("", "r2", "r2", "r2", "r2")
LV_Add("", 	r3)
LV_Add("", "r4, r4, r4, r4")

Gui, Show,, % chr(32)
Return
Gedankenblitz. Betrifft ja eigentlich auch, bzw zuerst Gui, Add, ListView da dort ebenfalls die gleiche Anzahl an Einträgen vorgenommen wird.
Ziel ist es, aus einer langen unübersichtlichen Konfigurationszeile (die hier natürlich gekürzt ist) gestaffelte :arrow: (continuation section), und damit übersichtlichere kurze Einträge zu generieren.
Nachtrag: Gui, Add, ListView kann das ...

Code: Select all

; doof zu warten/sichten
; Gui, Add, ListView,, langer spaltenkopf| superlanger spaltenkopf| ultrasuperlanger spaltenkopf mit zusatzinformation die kaum ein mensch braucht| und wenn hier jetzt noch zwanzig zeilen mehr kommen| würde das eine verdammt lange einzelne zeile werden, und das wäre nur was für einzeilenliebhaber.
; einfacher zu sichten
  Gui, Add, ListView,,
					( LTrim
					langer eintrag|
					superlanger eintrag|
					ultrasuperlanger eintrag mit zusatzinformation die kaum ein mensch braucht|
					und wenn hier jetzt noch zwanzig zeilen mehr kommen|
					würde das eine verdammt lange einzelne zeile werden|
					und das wäre nur was für einzeilenliebhaber.			
					)

Re: LV_Add("",<continuation section>)

Post by toralf » 24 May 2020, 05:40

Kannst du bitte ein paar Beispiel Zeilen deines Problems spendieren, und nennen was genau deine Erwartungen sind?

LV_Add("",<continuation section>)

Post by BNOLI » 24 May 2020, 05:18

Hallo,
:arrow: LV_ADD() tendiert bei langen Spalteneinträgen in Richtung Bandwurm, welcher selbst bei 16:9 PC screen gern zum rechten Bildschirmrand hinaus mäandert :roll:
Meine Versuche die Komma-separierten Feldeinträge in einer 'continuation-section' zu layern blieben jedoch erfolglos. Ich fürchte, ich ende mit Format() (nettes Wortspiel :lol:)

Kennt jemand von Euch evtl. eine(n) Lösung/workaround??

:)

Top