bool BarLine::HasRepetitionDots() const { if (GetForm() == BARRENDITION_rptstart || GetForm() == BARRENDITION_rptend || GetForm() == BARRENDITION_rptboth) { return true; } return false; }
void PS_TransparencyDialog::TransparencyGroupUIC::InitFramedUI(char inLabel[], Widget parent, const ArgListC& inArgs) { // form BaseUIC::InitFramedUI(inLabel, parent, inArgs); // label ArgListC args; args.StdSplitSetup(20); const char* tranTypeStrs[] = {"Opaque", "Constant", "Variable"}; tranTypeUI.PreInitSetUp(tranTypeStrs, 3); tranTypeUI.InitWidget(GetForm(), args); tranTypeUI.AddOtherObjectCallback(SetAllSensitiveCB, this); args.StdSplitMiddle(20, 45); constantTransFactorUI.AttachLabelToObject(); constantTransFactorUI.SetFieldFormat(SC_DecFormat(3)); constantTransFactorUI.SetFieldLen(5); constantTransFactorUI.InitLabeledUI("Constant", GetForm(), args); args.StdSplitMiddle(50, 75); startTransFactorUI.AttachLabelToObject(); startTransFactorUI.SetFieldFormat(SC_DecFormat(3)); startTransFactorUI.SetFieldLen(5); startTransFactorUI.InitLabeledUI("Start", GetForm(), args); args.StdSplitFinish(25); endTransFactorUI.AttachLabelToObject(); endTransFactorUI.SetFieldFormat(SC_DecFormat(3)); endTransFactorUI.SetFieldLen(5); endTransFactorUI.InitLabeledUI("End", GetForm(), args); }
void ExecuteCommandDialog::handleCurrentChanged (int id) { if (!dynamic_cast<WaitPage*> (currentPage ())) return; const auto& ids = pageIds (); const int pos = ids.indexOf (id); if (pos <= 0) return; const auto prevPage = page (ids.at (pos - 1)); if (dynamic_cast<CommandsListPage*> (prevPage)) { const AdHocCommand& cmd = dynamic_cast<CommandsListPage*> (prevPage)->GetSelectedCommand (); if (cmd.GetName ().isEmpty ()) deleteLater (); else ExecuteCommand (cmd); } else if (dynamic_cast<CommandResultPage*> (prevPage)) { const auto crp = dynamic_cast<CommandResultPage*> (prevPage); const auto& action = crp->GetSelectedAction (); if (action.isEmpty ()) return; auto result = crp->GetResult (); result.SetDataForm (crp->GetForm ()); ProceedExecuting (result, action); } }
WXWINHANDLE wxTopLevelWindowPalm::GetWinHandle() const { FormType *form = GetForm(); if(form) return FrmGetWindowHandle(form); return 0; }
TGUITextFrame::TGUITextFrame() : TGUIView( textFrameViewZ ), memo( NULL ) { memo = new TMemo( ( TComponent* )NULL ); memo->Parent = GetForm(); memo->BiDiMode = bdLeftToRight; // We try to handle bidirectional input ourselves. }
void wxTopLevelWindowPalm::DoGetSize( int *width, int *height ) const { RectangleType rect; FrmGetFormBounds( GetForm() , &rect ); if(width) *width = rect.extent.x; if(height) *height = rect.extent.y; }
static BOOL test_GetForm(struct torture_context *tctx, LPSTR servername, HANDLE handle, LPSTR formname) { DWORD levels[] = { 1, 2 }; DWORD success[] = { 1, 0 }; DWORD i; LPBYTE buffer = NULL; for (i=0; i < ARRAY_SIZE(levels); i++) { DWORD needed = 0; DWORD err = 0; char tmp[1024]; torture_comment(tctx, "Testing GetForm(%s) level %d", formname, levels[i]); GetForm(handle, formname, levels[i], NULL, 0, &needed); err = GetLastError(); if (err == ERROR_INSUFFICIENT_BUFFER) { err = 0; buffer = malloc(needed); torture_assert(tctx, buffer, "malloc failed"); if (!GetForm(handle, formname, levels[i], buffer, needed, &needed)) { err = GetLastError(); } } if (err) { sprintf(tmp, "GetForm failed level %d on [%s] (buffer size = %d), error: %s\n", levels[i], servername, needed, errstr(err)); if (success[i]) { torture_fail(tctx, tmp); } else { torture_warning(tctx, tmp); } } free(buffer); buffer = NULL; } return TRUE; }
void PenAndSliderUIC::StdInit( char label[], Widget parent, const ArgListC& inArgs) { BaseUIC::InitFramedUI(label, parent, inArgs); ArgListC args; args.Clear(); args.TopFormAttach(); args.RightPosAttach(25); penUI.InitWidget(GetForm(), args); args.Clear(); args.TopFormAttach(); args.LeftWidgetAttach(penUI.GetWidget()); args.LeftOffset(5); args.RightFormAttach(); intensityUI.SetSliderVals(0.0, 1.0, 0, 1000, 10); intensityUI.InitLabeledUI("Intensity:", GetForm(), args); }
// get the origin of the client area in the client coordinates wxPoint wxFrame::GetClientAreaOrigin() const { // there is no API to get client area but we know // it starts after titlebar and 1 pixel of form border Coord maxY = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y), X = 1, Y = 0; while ( Y < maxY ) { if(!FrmPointInTitle((FormType*)GetForm(),X,Y)) return wxPoint(X,Y+1); Y++; } return wxPoint(X,0); }
BOOL bAddMiniForms( HANDLE hPrinter, /* Access to the printer */ BOOL bUpgrade, PRASDDUIINFO pRasdduiInfo /* Global Data Access */ ) { short *psPSInd; /* Scan the PAPERSOURCE selection */ PAPERSIZE *pPS; /* Scanning PAPERSIZE data */ FORM_INFO_1 fi1; /* The info the spooler wants! */ WCHAR awchForm[ 64 ]; /* The name of the form */ psPSInd = (short *)((BYTE *)pdh + pdh->loHeap + pModel->rgoi[ MD_OI_PAPERSIZE ]); fi1.Flags = FORM_PRINTER; fi1.pName = awchForm; fi1.ImageableArea.left = 0; fi1.ImageableArea.top = 0; for( ; *psPSInd; ++psPSInd ) { pPS = (PAPERSIZE *)GetTableInfoIndex( pdh, HE_PAPERSIZE, *psPSInd - 1 ); if( !pPS || pPS->sPaperSizeID <= DMPAPER_USER ) continue; /* Standard rasdd defined */ if( iLoadStringW( &WinResData, pPS->sPaperSizeID, awchForm, sizeof( awchForm ) ) == 0 ) { #if DBG DbgPrint( "rasddUI!bAddMiniForms: Could not load form name string for index %d\n", pPS->sPaperSizeID ); #endif continue; /* See if there are others */ } /* * Now have a minidriver specific form size! This information * needs to be communicated to the spooler. */ fi1.Size.cx = MASTERTOX( (long)pPS->ptSize.x ); fi1.Size.cy = MASTERTOY( (long)pPS->ptSize.y ); fi1.ImageableArea.right = fi1.Size.cx; fi1.ImageableArea.bottom = fi1.Size.cy; //This is the upgrade case if (bUpgrade) { FORM_INFO_1 FormInfo; DWORD dw = 0; if ( GetForm( hPrinter, awchForm, 1, (LPBYTE)&FormInfo, sizeof(FORM_INFO_1), &dw ) ) { /* This means NT 351 */ if ( FormInfo.Flags & FORM_USER ) DeleteForm(hPrinter,awchForm); } } AddForm( hPrinter, 1, (BYTE *)&fi1 ); } return TRUE; }
int main (int argc, char* argv[]) { HANDLE printer; DWORD needed; PFORM_INFO_1 buffer1 = NULL; if (argc < 3) { fprintf (stderr, "useage: %s <printername> <form>\n", argv[0]); exit (-1); } /* open the printer */ if (!OpenPrinter (argv[1], &printer, NULL)) { fprintf (stderr, "Unable to open %s!\n", argv[1]); exit (-1); } else { printf ("Printer [%s] opened successfully.\n\n", argv[1]); } /* INFO LEVEL 1 */ GetForm(printer, argv[2], 1, (LPBYTE)buffer1, 0, &needed); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { fprintf (stderr, "Error getting form information for [%s] using NULL buffer.\n", argv[2]); exit (-1); } if ((buffer1 = (LPBYTE)malloc(needed)) == NULL) { fprintf (stderr, "Unable to malloc memory for FORM_INFO_1 buffer!\n"); exit (-1); } if (!GetForm(printer, argv[2], 1, (LPBYTE)buffer1, needed, &needed)) { fprintf (stderr, "Error getting form information for [%2].\nSize of buffer = %d\n", argv[2], needed); exit (-1); } printf ("Form Info Level 1:\n"); print_form_info_1 (buffer1); printf ("\n"); free (buffer1); /* close the printer */ if (!ClosePrinter(printer)) { fprintf (stderr, "Error closing printer!\n"); exit (-1); } else { printf ("Printer [%s] closed successfully.\n", argv[1]); } return 0; }