BCU main page Bridge Commander Universe
...welcome to the new world.
 
 FAQFAQ  RanksRanks  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  Staff SiteStaff Site    RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to show an icon in a window/subpane?

 
Post new topic   Reply to topic    Bridge Commander Universe Forum Index -> BC Scripting
View previous topic :: View next topic  
Author Message

USS Frontier

Sovereign-Class
Cadet 1st Class
Cadet 1st Class




Joined: 19 Sep 2005
Posts: 76

Offline

 

 



Reply with quote

Post Posted: 09-27-2006 11:19 PM Post subject: How to show an icon in a window/subpane?

It's a problem i'm having, i've got a button that shows a window, then i created a STSubPane inside it. and inside this subpane, i need to show various icons in a specific coordinate, to make a map.

But how do I show an icon inside this subpane, in the X,Y coordinate?

I've already created an IconGroup with the icons I made, plus the rest of the Icons I need are from the game.


_________________
"Revenge is a dish best served cold"
Old Klingon Proverb

Orca Class WIP <----Needing some help

Back to top
View user's profile Send private message

Imperial_Destroyer

Rear Admiral
Rear Admiral


Age: 26
Zodiac: Sagittarius
Joined: 01 Nov 2004
Posts: 1604
Location: Georgia
Offline

 

 



Reply with quote

Post Posted: 09-28-2006 12:38 AM Post subject:

how i don't know, just that the x-y plane starts in the upper left corner and is positive in the down and right directions


_________________
did you hear the one where a lawyer had to teach a priest about ethics?

Back to top
View user's profile Send private message

USS Frontier

Sovereign-Class
Cadet 1st Class
Cadet 1st Class




Joined: 19 Sep 2005
Posts: 76

Offline

 

 



Reply with quote

Post Posted: 09-28-2006 12:43 AM Post subject:

Actually how i've already find out, i was having problem in showing the icon.
But then i've also find out that the problem was the icon number, it was wrong. So i just gotta see what is the icon number of the icon i'm looking for.


_________________
"Revenge is a dish best served cold"
Old Klingon Proverb

Orca Class WIP <----Needing some help

Back to top
View user's profile Send private message

MLeo

Fleet Admiral
Fleet Admiral


Age: 22
Zodiac: Aquarius
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands
Offline

 

 



Reply with quote

Post Posted: 09-28-2006 04:54 PM Post subject:

To get the icon number, look in scripts/Icons (if your icon is a standard icon).

If you loaded it, then you already know the right group and number.


Also, the signature of AddChild is:
AddChild(pTGUI, x, y, bFront)


_________________

How to beat the Black Screen Of Death and Script problems Also handles Console/Screen/Error report/dump.
BC Technical FAQ [Last updated 26/12/2005]
"Trust me, I'm a con artist" - Moist von Lipwig, "Going Postal, Discworld"

Back to top
View user's profile Send private message Send e-mail MSN Messenger

USS Frontier

Sovereign-Class
Cadet 1st Class
Cadet 1st Class




Joined: 19 Sep 2005
Posts: 76

Offline

 

 



Reply with quote

Post Posted: 09-28-2006 05:15 PM Post subject:

The Icon Number wasn't wrong after all, the problem is that when it created the icon, for some reason, that icon group didn't existed... So i added a
Code:

App.g_kIconManager.RegisterIconGroup("GravityFXIcons", "GravityFXIcons", "GravityFXIcons")

to the function that was creating the icon group and it worked... I have no clue to what are these 3 strings needed, nor why i needed to put this line to work, i saw a bunch of other scripts that created icon groups in the same way as i was doing and none of them had this line, and yet all of them are working...

Also, MLeo, that bFront arg is to make the icon in front of the window/pane?

EDIT:
And how can i get the object/instance of the Map Window? So then after it i can check to see if it is enabled, meaning that the user is using the MapWindow.


_________________
"Revenge is a dish best served cold"
Old Klingon Proverb

Orca Class WIP <----Needing some help

Back to top
View user's profile Send private message

MLeo

Fleet Admiral
Fleet Admiral


Age: 22
Zodiac: Aquarius
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands
Offline

 

 



Reply with quote

Post Posted: 09-28-2006 07:21 PM Post subject:

The gravity well idea?


I've had a case once where I didn't put a 1 at the end (usually you can leave it at 0) and the object appeared at the back of a couple of other elements.

Setting it to 1 (or use pParent.MoveToFront(pElement)) solved it.


To get the map window:
Code:
pTopWindow = App.TopWindow_GetTopWindow()
pMapWindow = App.MapWindow_Cast(pTopWindow.FindMainWindow(App.MWT_TACTICAL_MAP))




If you look closely at those strings, and compare them to the icons directory (and it's files), you will see that it's the name, the file and the function to be called to load it.

Also, it's usually a good idea (just as the default icons do) to try and get the group, and if it isn't created, create it.


_________________

How to beat the Black Screen Of Death and Script problems Also handles Console/Screen/Error report/dump.
BC Technical FAQ [Last updated 26/12/2005]
"Trust me, I'm a con artist" - Moist von Lipwig, "Going Postal, Discworld"

Back to top
View user's profile Send private message Send e-mail MSN Messenger

USS Frontier

Sovereign-Class
Cadet 1st Class
Cadet 1st Class




Joined: 19 Sep 2005
Posts: 76

Offline

 

 



Reply with quote

Post Posted: 09-28-2006 07:31 PM Post subject:

lol yeah the gravity well idea

Thanks about the Map stuff, and the explanation of AddChild.

I saved the icon group when it was created to a global variable, then ingame when it were to show an icon and it didn't appeared I opened the console and checked the value of that global variable, the icon group had been created.


_________________
"Revenge is a dish best served cold"
Old Klingon Proverb

Orca Class WIP <----Needing some help

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic

All times are GMT

Page 1 of 1
   Bridge Commander Universe Forum Index -> BC Scripting
 
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

Powered by phpBB © 2001, 2005 phpBB Group
Bridge Commander Universe is a Nightsoft company. All rights reserved.