Hide and UnHide DIALOG
Hide and UnHide DIALOG
How can I hide and unhide a dialog like the screen below ?-
- Attachments
-
- UnHide.jpg (40.73 KiB) Viewed 20335 times
-
- Hide.jpg (20.34 KiB) Viewed 20335 times
Re: Hide and UnHide DIALOG
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".
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
Jimmy
Re: Hide and UnHide DIALOG
How is this dialog created?
The eXpress train is coming - and it has more cars.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Hide and UnHide DIALOG
I think, he only want to know, how he can do this with XBase/eXPress.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Hide and UnHide DIALOG
YES. I only want know how this dialog can be created in Xbase++/express++
Re: Hide and UnHide DIALOG
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.
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."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Hide and UnHide DIALOG
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"
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.
Re: Hide and UnHide DIALOG
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
Just a thought,
Terry
Re: Hide and UnHide DIALOG
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.
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.
Re: Hide and UnHide DIALOG
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.
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.