//===============================================================================
// Xe UI toolkit
//
// XeCascadeButton
//  Private header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Jul-11 01:35:47
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XeCascadeButtonP_h
#define _XeCascadeButtonP_h

#include <Xe/LabelP.h>
#include <Xe/CascadeButton.h>

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif


#define XeMENUPANE_CASCADE_ARROWWIDTH  11

//================================
// Class definition
//================================

#define XeCascadeButtonClassCore\
	XeLabelClassCore

typedef struct _XeCascadeButtonClassRec
{
	XeCascadeButtonClassCore;
} XeCascadeButtonClassRec;

extern XeCascadeButtonClassRec  _XeCascadeButton_class;


//================================
// Instance definition
//================================
// Instance part
//================================
typedef struct
{
// Resources
	XeColor         ArmColor, ArmForegroundColor;
	XeCallbackList  ArmCallback, DisarmCallback, ActivateCallback;
	int             ArrowLength, ArrowWidth, ArrowSpacing;
	XeWidget        SubMenuID;
	int             MappingDelay, PostMenuTo;
	EpImage*        ArmImage;
	EpImage*        ActiveImage;

// Use scroll wheel for flipping through option menu items on the CascadeButton, without dropping down the OptionMenu
	EBool           ScrollToFlipOptionMenuItems;

// Private variables
	int             DefShadowSpacing;
	EBool           Active, Armed, MenuPosted, ShowArrow;
	uint8_t         DragMode;
} XeCascadeButtonPart;


//================================
// Instance record
//================================
typedef struct _XeCascadeButtonRec
{
	XeWidgetCore;
	XeBasePart           Base;
	XePrimitivePart      Primitive;
	XeLabelPart          Label;
	XeCascadeButtonPart  CascadeButton;
} XeCascadeButtonRec;


extern void  _XeCascadeButton_Redraw(XeWidget PW, const EBool PDoLayout);
extern void  XeOptionMenuCascadeButton_RecomputeSize(XeWidget PW);


#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}	// Close scope of 'extern "C"' declaration
#endif

#endif // _XeCascadeButtonP_h
