The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Questions about getn dialog

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
couturier Posted - 02/22/2020 : 4:59:53 PM
Origin Ver. and Service Release (Select Help-->About Origin): 2020
Operating System: win10

I have a getn dialog with which I will do various operations on a custom report wks.
While dialog is open, I'd like to scroll that wks up and down to check things.

wks_scroll_into_view() kind of works but is not good.

It seems to me I could do this with window::setscrollpos, that I would control with getn_slider
I've tried to play with it and getscrollrange but couldn't succeed

Otherwise, is there any option so that getn would be non modal, so I can access wks and review it ?

Thanx
10   L A T E S T    R E P L I E S    (Newest First)
couturier Posted - 02/26/2020 : 7:21:58 PM

I think that scroll thing will wait
Castiel Posted - 02/25/2020 : 8:32:00 PM
quote:
Originally posted by couturier

Thanx a lot Castiel for this hack

Is there any event that could tell me if user has selected another window ?




There may or may not be such an event of GetN dialog I've no idea of.

According to the description, I deem this is the right time you create your own dialog instead of using GetN.

If you are trying to create a dialog similiar to the Column Properties dialog, press shift+alt+O in Code Builder to open ColumnProperties.h in which you will find

ON_CHANGE_LAYER( OnChangeLayer )
ON_CHANGE_PAGE( OnChangePage )
ON_CHANGE_SELECTION( OnSelectionChange )
ON_CHANGE_DATASET(OnChangeDataset )

The implementation is in ColumnProperties.c


                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
couturier Posted - 02/25/2020 : 11:52:03 AM
Thanx a lot Castiel for this hack

Is there any event that could tell me if user has selected another window ?
Castiel Posted - 02/24/2020 : 7:18:25 PM
quote:
Originally posted by couturier

Hi Nikolay,

thanks for that trick. But I don't want to show an additional item in my dialog.

I'm wondering if it's possible to use Dialog::Create to make the getn modalless.
Or if I can show a _ icon in title bar (left to X icon) so I can roll up the dialog and access the wks, just like in nonlinear curve fit dialog



GetN dialog cannot be modeless. You may create one from resource dll.

However, if GetN is the preferred option and you can stand the dialog position, just hack a modeless one like this:


#include <origin.h>
#include <GetNBox.h>

static bool hackEvent(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)    
{
	if(nType < 0)
		return false;
	
	Window dlg(dlgGetNBox);
	dlg.SendMessage(WM_CLOSE);
    return false;
}
void MakeGetNModeless()
{
	GETN_TREE(hack)
	GetNBox(hack, NULL, NULL, NULL, hackEvent);
	return;
}

static bool gtEvent(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)    
{
	if(nRow < 0)
	{
		MakeGetNModeless();
		return false;
	}
	
    return false;
}

void foo()
{
	GETN_TREE(gt)
	if(GetNBox(gt, NULL, NULL, NULL, gtEvent))
	{
	}
	return;
}



                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
nick_n Posted - 02/24/2020 : 5:55:02 PM
Hi,
Seems, you have to use HTMLDlg. Unfortunately, I have only little expirience in that class. I found some examples of using in "C:\Users\...\AppData\Local\OriginLab\Apps". Pay attention to:
ModifyStyle(0, WS_MAXIMIZEBOX|WS_MINIMIZEBOX);, it is your case.
Regards,

Nikolay
couturier Posted - 02/24/2020 : 2:24:43 PM
quote:
Do you mean something like: BOOL Rollup( BOOL bClose = TRUE )?

EXACTLY
However, the dialog class is poorly documented.
Do you know how to use ?
nick_n Posted - 02/24/2020 : 12:45:48 PM
Do you mean something like: BOOL Rollup( BOOL bClose = TRUE )?

Nikolay
couturier Posted - 02/23/2020 : 08:34:34 AM
Another thing came to my mind:
I can show a scrollbox in the getn:
HWND hh = GetWindow(OGW_DB_ACTIVE_DLG);
Window wnd(hh);
wnd.SetScrollRange( SB_VERT, 0, 50 );

Maybe this scrollbox could be linked to that in the wks:
Worksheet wks = Project.ActiveLayer();
WorksheetPage wksPg;
wks.GetParent(wksPg);
Window winWks = wksPg.GetWindow();

int nMinPos, nMaxPos;
winWks.GetScrollRange( SB_VERT, nMinPos, nMaxPos );

I could set the same scroll range in the getn.
Moving the scroll bar in getn would move the wks with;
winWks.SetScrollPos( SB_VERT, wnd.GetScrollPos(SB_VERT));

However, nMinPos and nMaxPos don't get the wks scroll range :(

Is it something that can work ?
couturier Posted - 02/23/2020 : 05:17:21 AM
Hi Nikolay,

thanks for that trick. But I don't want to show an additional item in my dialog.

I'm wondering if it's possible to use Dialog::Create to make the getn modalless.
Or if I can show a _ icon in title bar (left to X icon) so I can roll up the dialog and access the wks, just like in nonlinear curve fit dialog
nick_n Posted - 02/22/2020 : 6:01:07 PM
Hi Couturier,
Personally for me GETN_BOX(trGetN) GETN_INTERACTIVE works perfect .
I do not really get any range selection from it but that allows to navigate anywhere (not elegant?).
Regards,

Nikolay

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000