Results 1 to 10 of 15

Thread: Has skinning your apps still supported?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jun 2016
    Location
    Point Cook, Victoria, Australia
    Posts
    382

    Default Re: Has skinning your apps still supported?

    The New StatPnl.pkg

    Code:
    //New StatPnl.pkg // Modified version of DAC's StatPnl.pkg which contains the skin framework fixes and also // introduces the Cancel_Button_Visible_State property for use when you do not wish a Cancel // button to be displayed. Take note though that Cancel_Button_Visible_State is totally // ignored if Allow_Cancel_State is True!!! // // StatPnl.pkg - creates the standard status_panel object. // // // This is the default Status Panel object used by any of the DataFlex classes that // invoke the standard status panel. The standard has always been that the package name // is StatPnl.pkg and the name of the object is Status_Panel. As of 12.0, there are major // changes in the way the status panel operates The Sentinel based external status panel used in // prior revisions has been replace with status panel that is part of the application. // This should work much better and faster than the old sentinel based solution. // While the way this operates has changed, the interface has not and therefore this should work // with most applications. // // As of 12.0, we have added a global handle that contains the object ID of this status panel. // This variable ghoStatusPanel can be used in place of the object name Status_Panel. This provides // a cleaner more robust interface. // // // Compatibility Note: // // When used in the standard way, this change will require no changes. A developer will only need to // change their code if they've modified the sentinel program, which was a difficult thing to do. // // If for some reason you application will not work using this as a replacement for the old status // panel, you've probably done something special with the old status-panel. If you don't want to // figure out how to use the new one and you want to continue using the old one you are going to need // to add some code to include the old status panel in your application. Add the following to your project (your src). // // Use StatPnl.pkg // Make sure you load the new status panel object first. this is not optional! // Use OldStatPnl.pkg // load the old status panel. Status_Panel is now this old object // // If you do this, you will lose access to the new status-panel via Status_Panel. However, you // can still access the new object via the ghoStatusPanel handle. // // // Creating your own Status Panel objects // // If a developer wishes to create a custom panel, they should use this package as their template. // This panel can be visually modeled and changed any way you wish. Just save your new custom panel // with a different file and object name and direct your status panel request to the new object. // // If the new panel changes the interface and updates objects that are not currently defined, you // want to make sure you send the message ProcessEvents after you've updated the object. This allows // the object to paint when inside of a tight loop. For example, if you wanted to add a progress // bar (cProgressBar) you would want to Send ProcessEvents after you update the progress bar. // e.g. // Procedure UpdateStatusBar // Send DoAdvance of oProgressBar // Send ProcessEvents // End_Procedure // // Of course, if you use the standard interfaces in status bar and your forward send these // messages this will be done for you. // // the standard Interface for status panels are: // // Send Initialize_StatusPanel - initializes values for caption, title & message // Send Start_StatusPanel - start the status panel // Send Stop_StatusPanel - stop the status panel // Send Update_StatusPanel - update the status panel's action area // Get Check_StatusPanel - check for cancel (if cancel or pbCancel is set, close the panel) // // Get/Set Caption_Text - updates the caption bar // Get/Set Title_Text - updates the title area // Get/Set Message_Text - updates the Message area // Get/Set Action_Text - updates the action area // Get/Set Button_Text - updates the button area // // Get/Set Allow_cancel_state - determines if panel can be canceled // Send EnableCancelButton - code you should provide to enable/disable cancel button // // Get/Set Cancel_Button_Visible_State - if panel cannot be cancelled, this determines if the cancel button is visible or not // // ghoStatusPanel - global handle that points to the standard status panel. Use cProcessStatusPanel.pkg Use cCJSkinFramework.pkg #IFNDEF ghoStatusPanel Global_Variable Handle ghoStatusPanel // will contain the ID of the global StatusPanel object #ENDIF Object Status_Panel is a cProcessStatusPanel Property Boolean Cancel_Button_Visible_State True Move Self to ghoStatusPanel // this can be used throughout your applicaton to access this object Set Size to 80 166 // 20161105 - begin // When a ModalPanel (although it could be any object which has its Popup_State set to True) // is continuously called it gets smaller and smaller each time it is invoked. // This only happens when using the skin framework and this totally fixes the problem - 100% perfect. // Refer to Procedure Activate for this fix. // Also note that if you set piMinSize within a ModalPanel, this will also cause the right and bottom // edge to not get paged properly. Additionally, setting an icon within the object will be totally ignored, // so refer Procedure Page below which fixes both of these problems. Procedure Activate Integer iSize Get GuiSize to iSize Forward Send Activate Set GuiSize to (Hi(iSize)) (Low(iSize)) Send Adjust_Logicals End_Procedure // Procedure Page Integer iPageObject // Integer iSize // Set Icon to "" // Replace this with your chosen icon. // Get piMinSize to iSize // If (iSize <> 0) Set piMinSize to (Hi(iSize)) (Low(iSize) + 1) // Forward Send Page iPageObject // End_Procedure Procedure Page Integer iPageObject Integer hWnd Set Icon to "" // Replace this with your chosen icon. Get Window_Handle to hWnd If ((ghoSkinFramework <> 0) and (hWnd <> 0)) Send ComRemoveWindow to ghoSkinFramework hWnd Forward Send Page iPageObject Get Window_Handle to hWnd If ((ghoSkinFramework <> 0) and (hWnd <> 0)) Send ComApplyWindow to ghoSkinFramework hWnd End_Procedure // 20161105 - end Object oTitleTxt is a TextBox set location to 10 10 Set Auto_Size_State to False Set size to 20 150 Set Justification_Mode to JMode_Center end_object object oMessageTxt is a TextBox Set location to 25 10 Set Auto_Size_State to False Set size to 20 150 end_object object oActionTxt is a TextBox set location to 45 10 end_object object oStopButton is a Button Set Location to 60 58 Set Label to C_$Cancel procedure OnClick send Close_panel end_procedure end_object // These messages bind the standard cProcessStatusPanel interface to the actual // objects defined within this instance of the status panel. // note: all of the messages that change text should be forwarded // as the forwarded messages allows the panel to paint when in a tight loop Procedure Set Message_Text string sText Set Label of oMessageTxt to sText Forward Set Message_Text to sText End_Procedure Function Message_Text returns string Function_Return (Label(oMessageTxt)) End_Function Procedure Set Action_Text string sText Set Label of oActionTxt to sText Forward Set Action_Text to sText End_Procedure Function Action_Text returns string Function_Return (Label(oActionTxt)) End_Function Procedure Set Button_Text string sText Set Label of oStopButton to sText Forward Set Button_Text to sText End_Procedure Function Button_Text returns string Function_Return (Label(oStopButton)) End_Function Procedure Set Title_Text string sText Set Label of oTitleTxt to sText Forward Set Title_Text to sText End_Procedure Function Title_Text returns string Function_Return (Label(oTitleTxt)) End_Function // gets called when status panel is activated passing whether a button // should appear Procedure EnableCancelButton Boolean bEnable Boolean bVisible Get Cancel_Button_Visible_State to bVisible If (bEnable = False) Begin Set Visible_State of oStopButton to bVisible End Set Enabled_State of oStopButton to bEnable End_Procedure End_Object

    Last edited by Rachael; 10-Jul-2019 at 03:50 PM.
    Regards,
    Rachael Warlond

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •