Jump to content
Sign in to follow this  
E1M1

Is it possible to tell listview in what direction to add new columns

Recommended Posts

E1M1

Hi

New colums always appear at left. I would like to know if I can tell listview to add new columns right or do I just have to reverse both arrays first?. When you click "Generate" button ¬(A&¬BvB&¬CvC&¬A) gets written backwards.

#include <GuiListView.au3>
#include <array.au3>
;¬(A&¬BvB&¬CvC&¬A)

GUICreate("Truth table", 800, 600)
$in = GUICtrlCreateInput("¬(A&¬BvB&¬CvC&¬A)", 0, 1, 195)
$gen = GUICtrlCreateButton("Generate", 200, 1)
$list = GUICtrlCreateListView("", 0, 25, 800, 575)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3
            Exit
        Case $gen
            GenerateTable(GUICtrlRead($in))
    EndSwitch
WEnd


Func GenerateTable($sExp)
    $ColWidth = 20
    _GUICtrlListView_DeleteAllItems($list)
    While _GUICtrlListView_GetColumnCount($list) > 0
        _GUICtrlListView_DeleteColumn($list, 0)
    WEnd
    $chars = GetChars($sExp)
    For $i = 1 to $chars[0]
        _GUICtrlListView_InsertColumn($list, 0,$chars[$i],$ColWidth)
    Next
    $aExp = StringSplit($sExp,"")
    For $i = 1 to $aExp[0]
        _GUICtrlListView_InsertColumn($list, 0,$aExp[$i],$ColWidth)
    Next

    GUICtrlCreateListViewItem("sdfds", $list)
EndFunc   ;==>GenerateTable

Func GetChars($sStr)
    $aChars = StringSplit($sStr,"")
    $sChars = ""
    For $i = 1 To $aChars[0]
        if StringRegExp ( $aChars[$i], "[A-Z]") Then
            If not StringInStr($sChars,$aChars[$i]) Then
                $sChars &= $aChars[$i]
            EndIf
        EndIf
    Next
    $aRet = StringSplit($sChars,"")
    _ArraySort($aRet,0,1)
    Return $aRet
EndFunc

edited

Share this post


Link to post
Share on other sites
FireFox

Hi,

New colums always appear at left. I would like to know if I can tell listview to add new columns right or do I just have to reverse both arrays first?

I don't think it's possible (never seen that), so why do you want do that?

You could create blank items and only write the items from the right.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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
Sign in to follow this  

×