bool MoviesMainDialog::handleInitDialog(HWND fw, long ip) { list_.attachControl(handle(), IDC_LIST); list_.setStyleEx(LVS_EX_GRADIENT | LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_NOHSCROLL); list_.setTextBkColor(CLR_NONE); LVCOLUMN col = {0}; col.mask = LVCF_TEXT; col.pszText = _T(""); list_.insertColumn(0, col); HIMAGELIST il = ImageList_LoadBitmap(GetInstance(), MAKEINTRESOURCE(IDB_MOVIES), 17, 1, RGB(255, 255, 255)); if (NULL != il) list_.setImageList(il, LVSIL_SMALL); Rect r; innerBounds(r); renderer_.create(WS_TABSTOP, r, handle()); renderer_.definition.setHyperlinkHandler(GetHyperlinkHandler()); ModuleDialog::handleInitDialog(fw, ip); setDisplayMode(displayMode_); UniversalDataFormat* udf = UDF_ReadFromStream(moviesDataStream); if (NULL != udf) { udf_ = udf; prepareTheatresList(); setDisplayMode(showTheatres); } Preferences& prefs = *GetPreferences(); if (NULL == prefs.moviesLocation || 0 == Len(prefs.moviesLocation)) { char_t* loc = NULL; if (IDOK == ChangeLocationDialog::showModal(loc, handle())) { free(prefs.moviesLocation); prefs.moviesLocation = loc; if (NULL != prefs.moviesLocation) MoviesFetchData(); } } return false; }
struct fill *fillSpace(struct chrom *chrom, struct space *space, struct chain *chain, struct cBlock *startBlock, boolean isQ) /* Fill in space with chain, remove existing space from chrom, * and add smaller spaces on either side if big enough. */ { struct fill *fill; int s, e; struct space *lSpace, *rSpace; if (!innerBounds(startBlock, isQ, space->start, space->end, &s, &e)) return NULL; assert(s < e); AllocVar(fill); fill->start = s; fill->end = e; fill->chain = chain; rbTreeRemove(chrom->spaces, space); if (s - space->start >= minSpace) { AllocVar(lSpace); lSpace->gap = space->gap; lSpace->start = space->start; lSpace->end = s; rbTreeAdd(chrom->spaces, lSpace); } if (space->end - e >= minSpace) { AllocVar(rSpace); rSpace->gap = space->gap; rSpace->start = e; rSpace->end = space->end; rbTreeAdd(chrom->spaces, rSpace); } slAddHead(&space->gap->fillList, fill); return fill; }