Hide and UnHide DIALOG

This forum is for eXpress++ general support.
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Hide and UnHide DIALOG

#1 Post by unixkd »

How can I hide and unhide a dialog like the screen below ?-
Attachments
UnHide.jpg
UnHide.jpg (40.73 KiB) Viewed 15271 times
Hide.jpg
Hide.jpg (20.34 KiB) Viewed 15271 times

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Hide and UnHide DIALOG

#2 Post by Auge_Ohr »

hi,

without knowing where you Dialog come from, but i think it is the "external" Twain Dialog ?

while it is not Xbase++ you can not :hide() or :show() it if you have no "Connection" to it
like a activeX.

so you only can try Windows API SENDMESSAGE() when you have the "Handle" of the "Twain Dialog".
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Hide and UnHide DIALOG

#3 Post by rdonnay »

How is this dialog created?
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Hide and UnHide DIALOG

#4 Post by Wolfgang Ciriack »

I think, he only want to know, how he can do this with XBase/eXPress.
_______________________
Best Regards
Wolfgang

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: Hide and UnHide DIALOG

#5 Post by unixkd »

YES. I only want know how this dialog can be created in Xbase++/express++

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Hide and UnHide DIALOG

#6 Post by Tom »

1. Create the dialog with all elements. Use the FIT clause at DCREAD GUI. Store the dialog size at the EVAL clause of DCREAD like this: {||aDlgSize := oDialog:DCCurrentSize()}.

2. At the Show/Hide-button, toggle a variable "lShowSettings" (.T./.F.). If "lShowSettings" becomes .T., call oDialog:DCSetSize(aDlgSize). If "lShowSettings" becomes .F., also call oDialog:DCSetSize(), but don't use aDlgSize completely. If "nLine" is the line of the first object which is to be hidden, do it this way: aDialog:DCSetSize({aDlgSize[1],nLine-1}).

3. In addition, add "HIDE {||!lShowSettings}" to all items in the "settings" area.

That's it. This may cause problems if this dialog is resizable, so use NORESIZE at DCGET OPTIONS.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Hide and UnHide DIALOG

#7 Post by rdonnay »

Tom -

I don't think your solution will work. It isn't that easy because of the Xbase++ coordinate system.

I wrote a sample that I tested. See below.
It requires putting everything in the top portion of the dialog onto a static and then moving the static before resizing.

#INCLUDE "dcdialog.CH"

Code: Select all

FUNCTION Main()

LOCAL GetList[0], oTab1, oTab2, oMemo, oMenuBar, oMenu1, oMenu2, oMenu3, ;
      oDlg, lHidden, oStatic

DCMENUBAR oMenuBar
  DCSUBMENU oMenu1 PROMPT 'File' PARENT oMenuBar
  DCSUBMENU oMenu2 PROMPT 'Camera' PARENT oMenuBar
  DCSUBMENU oMenu3 PROMPT 'Help' PARENT oMenuBar

oMemo := ''
lHidden := .f.

@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT OBJECT oStatic SIZE 66,12
@ 0,0 DCMULTILINE oMemo SIZE 50,12 PARENT oStatic
@ 0,51 DCPUSHBUTTON CAPTION 'Capture to TWAIN' SIZE 15,1.2 PARENT oStatic
@ 2,51 DCPUSHBUTTON CAPTION 'Capture to File' SIZE 15,1.2 PARENT oStatic
@ 4,51 DCPUSHBUTTON CAPTION 'Update AE/AF' SIZE 15,1.2 PARENT oStatic
@10,51 DCPUSHBUTTON CAPTION {||IIF(lHidden,'Show Settings','Hide Settings')} ;
                    ACTION  {||HideShowTabs(@lHidden,oDlg,oTab1,oTab2,oStatic,GetList)} ;
                    SIZE 15, 1.2 PARENT oStatic

@ 13,0 DCTABPAGE oTab1 CAPTION 'Settings' SIZE 66,12
@ 0,0 DCTABPAGE oTab2 CAPTION 'Profile' RELATIVE oTab1

@ 2,2 DCSAY 'This is the stuff on Tab Page 1' SAYSIZE 0 PARENT oTab1
@ 2,2 DCSAY 'This is the stuff on Tab Page 2' SAYSIZE 0 PARENT oTab2

DCREAD GUI FIT TITLE 'Testing Tab Hide' ;
   EVAL {|o|oDlg := o}

RETURN nil

* -----------

PROC appsys ; RETURN

* -----------

STATIC FUNCTION HideShowTabs( lHidden, oDlg, oTab1, oTab2, oStatic, GetList )

lHidden := !lHidden

IF lHidden
  oStatic:setPos({10,10})
  oTab1:hide()
  oTab2:hide()
  oDlg:SetSize({oDlg:currentSize()[1],oStatic:currentSize()[2]+75})
ELSE
  oStatic:setPos({oStatic:currentPos()[1],oTab1:currentSize()[2]+30})
  oTab1:show()
  oTab2:show()
  oDlg:SetSize({oDlg:currentSize()[1],oTab1:currentSize()[2]+oStatic:currentSize()[2]+95})
ENDIF

DC_GetRefresh(GetList)

RETURN nil
The eXpress train is coming - and it has more cars.

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: Hide and UnHide DIALOG

#8 Post by TWolfe »

If you just want to hide the dialog for a while why not just move it off the active desktop. It is much faster to move the dialog than to 'hide / unhide', it also avoids any sizing issues.

Just a thought,
Terry

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: Hide and UnHide DIALOG

#9 Post by unixkd »

Hi Roger/ ALL for your solutions.

You can download the trial version of this small twain driver software from www.akond.net install it and just run it as a standalone program to see fully how the dialog behave so that your can adjust you sample solution more appropriately.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Hide and UnHide DIALOG

#10 Post by rdonnay »

I guess we were misunderstanding what you are asking for.

Tom and I thought that you were trying to make an eXpress++ dialog similar to the Twain dialog and hide the tabpages only.
The eXpress train is coming - and it has more cars.

Post Reply