Here's a quick function from Martin Kusl that allows you to set a plus or a minus sign for a particular item in a TreeView:
void SetPlus(WTreeViewItemHandle item,WBool sign)
Stew Stryker writes us:
Power++ has a ScrollToRow(), but if you're manually controlling how people move between columns and do a SetColumn(), how do you get the screen to scroll along with it? I've seen a one-page PowerBuilder routine that would handle it, but had trouble implementing in Power++.
But the answer is that ScrollToRow() will automatically scroll to the correct column after a SetColumn().
Author: Steffen Uhlig
I tried to define my own templated classes within Power++. As long as all code is within a header file (*.hpp) or the header part of a managed class (*.wxc) there is no difference to writing plain classes.
Then I moved parts of the code definition to the implementation part (*.cpp). The compilation was fine but linking failed with the linker error 1028: "%S is an undefined reference"
After reading the manual I found a hint at
Placing class templates
You can list the declaration of the class templates in a header file and define its member functions in a CPP file. However, since the compiler does not compile template code, you must include the CPP file (instead of the header file) in the source code of CPP files that use the class template. An alternative to this approach is to declare and define the class template in a header file and then include the header file in the source code of CPP files that use the class template.
Resume: The trick is to include the CPP file instead of the header file into the class where you use your new templated class. The CPP file in turn includes the header file. Therefore the header is visible automatically to the class where you use the templated class.
Steps to create a template classTo demonstrate the creation of a templated class we'll define a container class which holds a single element of the arbitrary type T.
template <class T>just before the first read-only line (where the class declaration specification gets defined).
_elementwithin the class declarations as type
T. When you later instantiate the class ContainerT for, say, an integer, you would write
ContainerT<int> _myIntCont; // a container which holds a single integer
"ContainerT<T>"and add the line
template <class T>before the function / method / property definition.
ContainerTyou must include the CPP file instead of the usual HPP file:
After successfully creating the templated class I wanted to create
another class which inherits from my brand new
ContainerT class. But the Power++ IDE does not let me specify templates
as base classes:
Since this is a limitation of the IDE and not of the compiler we can work around this by specifying an alias name for the instantiated template class, e.g.
IntContainer. We only have to define the alias in the header section of the class which inherits from the templated class:
typedef ContainerT<int> IntContainer;
So, for my example of a class which inherits from WListBox and