KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

ToolTiptext

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
danilda
KiXforms Follower
KiXforms Follower


Joined: 20 Jul 2007
Posts: 16

PostPosted: Wed Sep 19, 2007 6:28 pm    Post subject: ToolTiptext Reply with quote

I am using tooltiptext because my users want to be able to do a mouseover and see the description and members of a group. I am using the below code, but I am not getting multiple users in the tooltiptext. Can someone tell me what I am doing wrong? Thanks

Code:

$aAttributes = "Name", "Description", "Member"
$sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$strFilter = "(&(objectClass=group)(!sAMAccountName=IT Department)(!sAMAccountName=Sales-1))"
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"name")

global $Checkboxes[UBound($aresults)], $h, $i, $bresults

$checkboxes[$r] = $groupbox3.Controls.CheckBox($aresults[$r,0], $h, $i, 240, 15)


For each $rr in $aresults[$r,1]
For each $rt in $aresults[$r,2]
$rt=right(split($rt,",")[0],-3)
$rt= $rt + chr(13)
$checkboxes[$r].Tooltiptext = "Description: " + $rr + CHR(13) + "Members:" + CHR(13) + "   " + $rt
Next
Next
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Sep 21, 2007 9:49 am    Post subject: Reply with quote

The multilined TooltipText wasn't available from the beginning.
What is your Kixforms version ? Does it differ from the latest development build ? Try with the latest...

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
danilda
KiXforms Follower
KiXforms Follower


Joined: 20 Jul 2007
Posts: 16

PostPosted: Fri Sep 21, 2007 12:14 pm    Post subject: Reply with quote

Kixforms.dll -- v2.46.36.0
Kixforms System.dll -- v3.1.46.0

I replaced kixforms.dll v2.46.36.0 with v2.47.4.0 and still not getting what I want. Do you have a better way to do what I need?

thanks -- dee
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Mon Sep 24, 2007 6:53 am    Post subject: Reply with quote

Hmm, not without having a working script.
I can't reproduce with the snippet you have posted.

Best for us would be to have a minimalistic scriptlet that is executable and shows only the problem ...

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
danilda
KiXforms Follower
KiXforms Follower


Joined: 20 Jul 2007
Posts: 16

PostPosted: Mon Sep 24, 2007 12:48 pm    Post subject: Reply with quote

Here is my coding:

Code:

Break On

$System = CreateObject("Kixtart.System")
;************* Form **************
$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.Height = 941
;$Form.Height = 130
$Form.Left = -4
$Form.Text = "Create Network User Application"
$Form.Top = -118
$Form.Width = 1273
;**************************************

; == Return the Name, AdsPath and members of all groups =========
$aAttributes = "Name", "Description", "Member"
$sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$strFilter = "(&(objectClass=group)(!sAMAccountName=IT Department)(!sAMAccountName=Sales-1))"
;Return Group/Distribution Lists
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"name")

;variables
global $rt[UBound($aresults)], $Checkboxes[UBound($aresults)], $h, $i, $bresults


$groupbox3 = $Form.Controls.GroupBox("Groups/Distribution Lists:", 0, 230, 1265, 605)

dee()
$FirstName.setfocus
$Form.Center
$Form.Show


While $Form.Visible
$=Execute($Form.DoEvents())
Loop

Exit 1

;Functions


Function Dee()
$h = 10
$i = 15
For $r = 0 to Ubound($aResults)
if $i = 600
$h=$h+250
$i = 15
endif

$checkboxes[$r] = $groupbox3.Controls.CheckBox($aresults[$r,0], $h, $i, 240, 15)

For each $rr in $aresults[$r,1]
For each $rt in $aresults[$r,2]
$rt=right(split($rt,",")[0],-3)
While instr($rt,"  ")
   $rt = Join(split($rt,"  ")," ")
Loop
$checkboxes[$r].Tooltiptext = "Description: " + $rr + CHR(13) + "Members:" + CHR(10) + "   " + $rt
Next
Next

$i=$i+15

Next


EndFunction


Function fnLDAPQuery($What,Optional $From,Optional $Filter,Optional $OrderBy,Optional $Scope,
Optional $User,Optional $Pswd)

Dim $oCon,$oCMD,$oRS,$sQ,$aR,$C,$R

$sQ="<"+Iif($From="","LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext"),
$From)+">;"+$Filter+";"+Iif(VarType($What)>8192,Join($What,','),$What)+";"+
Iif($Scope<>"base" AND $Scope<>"onelevel","subtree",$Scope)

$oCon=CreateObject("ADODB.Connection")
$oCon.Provider="ADsDSOObject"
$oCon.Properties("Encrypt Password").Value=1
$oCon.Properties("ADSI Flag").Value=1
If $User AND $Pswd
$oCon.Properties("User ID").Value=$User
$oCon.Properties("Password").Value=$Pswd
EndIf
$oCon.Open("Active Directory Provider")

$oCMD=CreateObject("ADODB.Command")
$oCMD.ActiveConnection=$oCon
$oCMD.CommandText=$sQ
$oCMD.Properties("Page Size").Value=1000
$oCMD.Properties("Timeout").Value=30
$oCMD.Properties("Cache Results").Value=0

If InStr($OrderBy,"distinguishedName")
$oRS=CreateObject("ADODB.Recordset")
$oRS.CursorLocation=3
$oRS.Sort=$OrderBy
$oRS.Open($sQ,$oCon,0,1,1)
Else
If $OrderBy
$oCMD.Properties("Sort On").Value=$OrderBy
EndIf
$oRS=$oCMD.Execute
EndIf
If @ERROR Exit @ERROR EndIf
If $oRS.BOF AND $oRS.EOF Exit @ERROR EndIf

$aR = $oRS.GetRows()
Dim $aFR[Ubound($aR,2),Ubound($aR,1)]
For $R=0 to Ubound($aR,2)
For $C=0 to Ubound($aR,1)
$aFR[$R,$C]=$aR[$C,$R]
Next
Next

$fnLDAPQuery=$aFR
EndFunction

exit
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Tue Sep 25, 2007 12:32 pm    Post subject: Reply with quote

Well, I can't beat your code to run in my environment, sorry.

For crosschecking, I scribbled this short code :

Code:

break on

$s = createobject("Kixtart.System")
$f = $s.Form()

$chk1 = $f.Controls.Add("CheckBox")
$chk1.Text = "CheckBox #1"
$chk1.Bounds = 5,10,100,20
$chk1.ToolTipText = "This is checkbox #1" + chr(10) + "More information...." + chr(10) + "Yet some more info"

$f.Show

while $f.Visible
    $_ = execute($f.DoEvents)
loop

exit 0


What do you see as Tooltiptext if you run this on your side?

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Tue Sep 25, 2007 12:40 pm    Post subject: Re: ToolTiptext Reply with quote

Now I think I got you....

danilda wrote:
... I am not getting multiple users in the tooltiptext. ...
Code:

$rt=right(split($rt,",")[0],-3)


Well, maybe because in this line you strip everything after the first comma and the first 3 chars from the variable you later try to get your user member information from ?

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Tue Sep 25, 2007 12:50 pm    Post subject: Reply with quote

Maybe we get farther if you provide a typical example of what are the contents of $rr and $rr before the string manipulation.

I might be able to able to cobble together a ToolTipText with the correct contents for you Wink

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
danilda
KiXforms Follower
KiXforms Follower


Joined: 20 Jul 2007
Posts: 16

PostPosted: Tue Sep 25, 2007 12:56 pm    Post subject: Reply with quote

$rr is the description field for the group and $rt would be the members in that group.
$rt before manipulation is cn=John Doe,ou=users,ou=Training,dc=something,dc=com

When I do a $rt ? each member does appear on a separate line, but can't get it to work with the tooltip.

Thanks for your help, I really appreciate it.
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Tue Sep 25, 2007 1:09 pm    Post subject: Reply with quote

Ah, I see ...

Right, try this for size (untested)

Code:

.
.
.
function dee()
    $h = 10
    $i = 15
    for $r = 0 to ubound($aresults)
        if $i = 600
            $h = $h + 250
            $i = 15
        endif
        $checkboxes[$r] = $groupbox3.Controls.CheckBox($aresults[$r,0], $h, $i, 240, 15)
        dim $ToolTip
        for each $rr in $aresults[$r,1]
            $ToolTip = "description: " + $rr + chr(10) + "members:" + chr(10)
            for each $rt in $aresults[$r,2]
                $rt=right(split($rt,",")[0],-3)
                while instr($rt,"  ")
                    $rt = join(split($rt,"  ")," ")
                loop
                $ToolTip = $ToolTip + $rt + chr(10)
            next
        next
        $checkboxes[$r].ToolTipText = $ToolTip
        $i=$i+15
    next
endfunction
.
.
.



nb, sorry for mixing up the cases in your code, but I am an incurable disciple of lowercase Kix and CamelCase kixforms code Rolling Eyes

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Les
KiXforms Aficionado
KiXforms Aficionado


Joined: 24 Dec 2003
Posts: 317

PostPosted: Tue Sep 25, 2007 5:31 pm    Post subject: Reply with quote

Is a LF (10) enough or do you need CRLF (13)(10). Try using @CRLF.
_________________
The Repro Man
Stealing for a living!
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Tue Sep 25, 2007 6:19 pm    Post subject: Reply with quote

either CR or LF will do.
I think with both you'll get odd cahracters before or after the break...

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
danilda
KiXforms Follower
KiXforms Follower


Joined: 20 Jul 2007
Posts: 16

PostPosted: Wed Sep 26, 2007 2:58 pm    Post subject: Reply with quote

Jochen, thanks for all your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group