Is it possible to minimize a dialog to the taskbar?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

User avatar
migro
Macro Veteran
Posts: 151
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Wed Dec 28, 2011 4:05 pm

Got some additional information.

When clicking once at one of the two taskbar tabs, the second one disapears.
regards
migro

User avatar
migro
Macro Veteran
Posts: 151
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Tue Jan 29, 2013 12:08 am

Thanks to Marcus, with the following approach from him the issue, what has caused me terrible headaches for so long, was solved:
My version uses the page control's onChange handler to see which page is selected and then update the label caption accordingly. The benefit of this is that OnChange is not triggered until the user makes a change and so is not fired by the dialog being displayed and therefore there is no impact.

Code: Select all

// COMPILE_OPTS|c:\temp\Test2.exe||CONSOLE=0|INCLUDES=1| /NOSYSTRAY /HIDE
Dialog>Dialog1
object Dialog1: TForm
  Left = 255
  Top = 101
  HelpContext = 5000
  BorderIcons = [biSystemMenu, biMinimize]
  BorderStyle = bsSingle
  Caption = 'Custom Dialog'
  ClientHeight = 617
  ClientWidth = 696
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = True
  PixelsPerInch = 96
  TextHeight = 13
  object LabelToolTip: TLabel
    Left = 512
    Top = 112
    Width = 175
    Height = 449
    AutoSize = False
    Caption = 'Tooltip...'
    Color = 11769220
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clblue
    Font.Height = -15
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    ParentColor = False
    ParentFont = False
    Transparent = True
    WordWrap = True
  end
  object PageControl1: TPageControl
    Left = 0
    Top = 50
    Width = 485
    Height = 513
    ActivePage = ConfigTab
    TabOrder = 0
    object ConfigTab: TTabSheet
      Caption = 'Backup/Restore'
      ExplicitLeft = 0
      ExplicitTop = 0
      ExplicitWidth = 0
      ExplicitHeight = 393
    end
    object NotificationTab: TTabSheet
      Caption = 'Notification'
    end
  end
end
EndDialog>Dialog1

   Let>str501=This is the tooltip for Backup/Restore tab ...
   Let>str502=This is the tooltip for Notification tab ...

   AddDialogHandler>Dialog1,PageControl1,OnChange,DoToolTip

Show>Dialog1,r

SRT>DoToolTip
    GetDialogProperty>Dialog1,PageControl1,TabIndex,nTabIndex
    If>nTabIndex=0
        Let>newTip=str501
    Endif
    If>nTabIndex=1
        Let>newTip=str502
    Endif
    SetDialogProperty>Dialog1,LabelToolTip,Caption,newTip
END>DoToolTip

regards
migro

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts