Notifications
Clear all

[Closed] Help: ActiveX

Hi, Guys,

I have been trying very hard to get this tab strip working, I have tried everything i can think of to get this working but to no avail… grrr…

So here’s the code, which i have mostly developed form reading other scripts, as in this case i did not find the maxreference that helpful (Though as usual the answer is most likely there)… Thanks in advanced for your help!

Cheers
Dave

try(destroyDialog test)catch()

rollout test “test bed” width:312 height:704

(

local tabNames = #(“Quick”, “Advanced”, “Cameras”, “Lights”, “Help”)

local roll_ar = #(“vrman”, “advanRoll”, “camRoll”, “LightRoll”, “helpRoll”)

local rollWidth = #(312,312,312,312,312)

local rollHeight = #(704,704,704,704,704)

activeXcontrol ax “MSComctlLib.TabStrip.2” height:20

subRollout sub1 width:314 height:0 pos:[1, 312 – 2]

on test open do

(

ax.tabs.clear()

ax.multiRow = false

for x = 1 to tabNames.count do

(

newTab = ax.tabs.add()

newTab.caption = tabNames[x]

)

)

FN btCon_fn btPres =

(

if btPres == 1 then

(

sub1.width = floatWidth

sub1.height = floatHeight

test.width = floatWidth

test.height = floatHeight

for x in roll_ar do (if x != undefined do (removeSubRollout Sub1 x))

)

else

(

for x in roll_ar do (if x != undefined do (removeSubRollout Sub1 x))

sub1.width = (floatWidth + rollWidth[btPres])

sub1.height = (floatHeight + rollHeight[btPres])

test.width = (floatWidth + rollWidth[btPres])

test.height = (floatHeight + rollHeight[btPres])

addSubRollout Sub1 roll_ar[btPres]

)

)

on ax click do

(

axT = ax.selectedItem

btCon_fn axT.index

for x = 1 to tabNames.count do ax.tabs[x].highLighted = false

ax.tabs[axT.index].highLighted = true

/*

clearListener()

–Show all the stuff

showProperties ax.tabs[1]

print “————–”

showMethods ax.tabs

print “————–”

showEvents ax.tabs

*/

)

)

rollout vrman “Quick Settings”

(

)

rollout advanRoll “Advanced Settings”

(

)

rollout camRoll “Camera Settings”

(

)

rollout LightRoll “Light Settings” width:312 height:695

(

)

createDialog test 316 715

4 Replies

everything looks ok, but i only noticed that you havent defined values for these:


floatWidth
floatHeight 

this may cause some erros i suppose.

I noticed that about 20mins after the post, the error i get is

Rollout Handler Exception: – Type error: AddSubRollout requires RolloutClass, got: “vrman”

I still cant work it out, by my logic and understanding it should work!

cheers
Dave

It’s not complete but it’s fix a couple of immediate issues.

Your problem was you were setting the rollout array to be strings and not rollouts and you were also not forward defining the rollouts before you started to use them…


 try(destroyDialog test)catch()
 
 
 floatWidth = 316
 floatHeight = 715
 
 --Forward defined rollouts
 rollout vrman "" ( )
 rollout advanRoll "" ( )
 rollout camRoll "" ( )
 rollout LightRoll "" ( )
 rollout helpRoll "" ( )
 
 --Rollout array with rollout objects
 roll_ar = #(vrman, advanRoll, camRoll, LightRoll, helpRoll)
 
 rollout test "test bed" width:312 height:704
 
 	(
 	
 	local tabNames = #("Quick", "Advanced", "Cameras", "Lights", "Help")
 	
 	local roll_ar = #(vrman, advanRoll, camRoll, LightRoll, helpRoll)
 	
 	local rollWidth = #(312,312,312,312,312)
 	
 	local rollHeight = #(704,704,704,704,704)
 	
 	
 	
 	activeXcontrol ax "MSComctlLib.TabStrip.2" height:20
 	
 	subRollout sub1 width:314 height:0 pos:[1, 312 - 2]
 	
 	
 	
 	on test open do
 	
 		(
 		
 		
 		
 		ax.tabs.clear()
 		
 		ax.multiRow = false
 		
 		
 		
 		for x = 1 to tabNames.count do
 		
 			(
 			
 			newTab = ax.tabs.add()
 			
 			newTab.caption = tabNames[x]
 			
 			)
 		
 		)
 	
 	FN btCon_fn btPres =
 	
 		(
 		
 		if btPres == 1 then
 		
 			(
 			
 			sub1.width = floatWidth
 			
 			sub1.height = floatHeight
 			
 			test.width = floatWidth
 			
 			test.height = floatHeight
 			
 			for x in roll_ar do (if x != undefined do (removeSubRollout Sub1 x))
 			
 			)
 		
 		else
 		
 			(
 			
 			for x in roll_ar do (if x != undefined do (removeSubRollout Sub1 x))
 			
 			sub1.width = (floatWidth + rollWidth[btPres])
 			
 			sub1.height = (floatHeight + rollHeight[btPres])
 			
 			test.width = (floatWidth + rollWidth[btPres])
 			
 			test.height = (floatHeight + rollHeight[btPres])
 			
 			addSubRollout Sub1 roll_ar[btPres]
 			
 			)
 		
 		)
 	
 	on ax click do
 	
 		(
 		
 		axT = ax.selectedItem
 		
 		btCon_fn axT.index
 		
 		for x = 1 to tabNames.count do ax.tabs[x].highLighted = false
 		
 		ax.tabs[axT.index].highLighted = true
 		
 		
 		
 		/*
 		
 		clearListener()
 		
 		--Show all the stuff
 		
 		showProperties ax.tabs[1]
 		
 		print "--------------"
 		
 		showMethods ax.tabs
 		
 		print "--------------"
 		
 		showEvents ax.tabs
 		
 		*/
 		
 		)
 	
 	)
 
 rollout vrman "Quick Settings"
 
 	(
 	
 	
 	
 	)
 
 rollout advanRoll "Advanced Settings"
 
 	(
 	
 	
 	
 	)
 
 rollout camRoll "Camera Settings"
 
 	(
 	
 	)
 
 rollout LightRoll "Light Settings" width:312 height:695
 
 	(
 	
 	
 	
 	)
 
 
 
 createDialog test floatWidth floatHeight

Hey, Impus,

My script is all working now and thanx once again for you help, I cant believe i didnt realise i had defined strings… arrrr… anyways thanx very much help…

Cheers
Dave