Purebasic openwindow
Constants #DateFormat = "%dd/%mm/%yyyy" Straight through to the event procedures and let them worry about getting the jobs done. We’ve no reason to do so – all should be well.įinally, we despatch the recorded event values in EventWindow, EventGadget, EventType Providing we don’t attempt to change any of the stored values using *EventGadgets – and It is defined as the BASEWINDOW type and BASEWINDOW is the ancestor structure to the other The BUTTONWINDOW, DATEWINDOW or TRACKWINDOW type we can use *EventGadgets this way because Īlthough the memory allocations actually made by the CreateWindow procedures will be of Use *EventGadgets\WindowClass to call the correct resize window procedure. If *ThisData\WindowClass #WindowClassButton Supplied as the argument something like this:
#Purebasic openwindow how to#
That we need to work with in each of these procedures:Įach procedure only knows how to handle one type of window – so before we start work weĬheck the WindowClass value to make sure that a window of the correct type has been We can then use this pointer to retrieve the references to the actual controls In all these procedures we use the ActiveWindows map to retrieve the pointer to the memoryĪllocation. This procedure knows what to do whenĪny of the gadgets on the window are activated by the user. We also provide a new procedure – EventsButtonWindow. Similarly we provide DestroyWindow and ResizeWindow procedures to take care of these functions. Window’s gadgets are different and setting a different value in WindowClass. They work in a similar way to that described, differing only where the There are two more CreateWindow procedures this time – one for each class of the other Type of window, and therefore which type of structure, has been created – we will need to We also set the WindowClass value in the structure to #WindowClassButton to indicate which This is how we get around the problem of not beingĪble to store all three of the different structures in the same map. Use the AllocateMemory function to allocate memory for aīUTTONWINDOW structure, we then store a pointer to this memoryĪllocation in the ActiveWindows map. However this time the results are not stored directly in the ActiveWindows map. Now look at the CreateButtonWindow procedure. There is a good reason for this, we need to store threeĭifferent structure types to make this program work – and we can’t do this in a single map.Īlso notice that *EventGadgets is defined using the BASEWINDOW structure.
In the Variables section note that again a mapĬalled ActiveWindows is created, however this time it is of integer type, it doesn’t useĪny of the defined structures. Unique controls that they require and which are not provided for by the BASEWINDOW structure. The remaining structures extend the BASEWINDOW structure with values for each of the Theįirst, BASEWINDOW, defines a WindowClass value and a Menu value – these values are In the Structures section 4 structures are defined. Of any of the three supported window types or to close the current window. Track bars are moved the string gadget is updated with the value of the second trackĮach window contains a menu bar with items to create a new instance Value between 0 and 100, and a string gadget. The Track window – contains two track bars, with a Is clicked, it is the currently selected date that is added to the list view. Window layout is altered to accommodate this additional control. Window but also contains a calendar gadget too, the The Date window – contains a list view and two buttons in the same way as the Button 'Remove' button is clicked the currently highlighted entry in the list view is removed. Is clicked a random integer is added to the list view, when the The Button window – contains a list view and twoīuttons labelled 'Add' and 'Remove'. Multiple instances of several different types of window, in this case three: One we are going to extend this concept further – developing a program that can support In the previous article we examined one way in which a programĬan support multiple instances of a single type of window.
#Purebasic openwindow windows#
UserGuide - Managing multiple windows with different content